Loan Policy Storage (v2.4)

http://localhost:9130

Table of contents

Loan Policy Storage API

Storage for loan policies

/loan-policy-storage

GET /loan-policy-storage/loan-policies

Retrieve a list of loan-policy items.

GET /loan-policy-storage/loan-policies
Query Parameters
  • totalRecords: (string - default: auto - pattern: exact|estimated|none|auto)

    How to calculate the totalRecords property. "exact" for the correct number, "estimated" for an estimation, "auto" to automatically select "exact" or "estimated", "none" for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords

    Example:

    none
  • offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)

    Skip over a number of elements by specifying an offset value for the query

    Example:

    0
  • limit: (integer - default: 10 - minimum: 0 - maximum: 2147483647)

    Limit the number of elements returned in the response. Using limit=0 will return totalRecords with the exact value. For details about totalRecords see https://github.com/folio-org/raml-module-builder#estimated-totalrecords

    Example:

    10
  • query: (string)

    A query expressed as a CQL string (see dev.folio.org/reference/glossary#cql) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.

    searchable using CQL

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    id="cf23adf0-61ba-4887-bf82-956c4aae2260"
    

Response 200

Returns a list of loan-policy items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of loan policies",
  "type": "object",
  "properties": {
    "loanPolicies": {
      "description": "List of items",
      "id": "loanPolicies",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Rules governing loans",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "description": "The name of the policy.",
            "type": "string"
          },
          "description": {
            "description": "Description of the loan policy",
            "type": "string"
          },
          "loanable": {
            "description": "Flag that indicates whether this policy allows loans",
            "type": "boolean"
          },
          "loansPolicy": {
            "type": "object",
            "description": "Settings for loans",
            "additionalProperties": false,
            "properties": {
              "profileId": {
                "type": "string",
                "description": "Loan profile"
              },
              "period": {
                "type": "object",
                "description": "Loan period",
                "$schema": "http://json-schema.org/draft-04/schema#",
                "properties": {
                  "duration": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                  },
                  "intervalId": {
                    "type": "string",
                    "description": "Interval for the period, e.g. hours, days or weeks",
                    "enum": [
                      "Minutes",
                      "Hours",
                      "Days",
                      "Weeks",
                      "Months"
                    ]
                  }
                },
                "required": [
                  "duration",
                  "intervalId"
                ],
                "additionalProperties": false
              },
              "closedLibraryDueDateManagementId": {
                "type": "string",
                "description": "Closed library due date management"
              },
              "gracePeriod": {
                "type": "object",
                "description": "Grace period",
                "$schema": "http://json-schema.org/draft-04/schema#",
                "properties": {
                  "duration": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                  },
                  "intervalId": {
                    "type": "string",
                    "description": "Interval for the period, e.g. hours, days or weeks",
                    "enum": [
                      "Minutes",
                      "Hours",
                      "Days",
                      "Weeks",
                      "Months"
                    ]
                  }
                },
                "required": [
                  "duration",
                  "intervalId"
                ],
                "additionalProperties": false
              },
              "openingTimeOffset": {
                "type": "object",
                "description": "Opening offset time period",
                "$schema": "http://json-schema.org/draft-04/schema#",
                "properties": {
                  "duration": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                  },
                  "intervalId": {
                    "type": "string",
                    "description": "Interval for the period, e.g. hours, days or weeks",
                    "enum": [
                      "Minutes",
                      "Hours",
                      "Days",
                      "Weeks",
                      "Months"
                    ]
                  }
                },
                "required": [
                  "duration",
                  "intervalId"
                ],
                "additionalProperties": false
              },
              "fixedDueDateScheduleId": {
                "type": "string",
                "description": "Fixed due date schedule (due date limit)"
              },
              "itemLimit": {
                "type": "integer",
                "description": "Number of items allowed",
                "minimum": 1,
                "maximum": 9999
              },
              "forUseAtLocation": {
                "type": "boolean",
                "description": "Indicates that loaned items must be used in the library, i.e. in a reading room"
              },
              "holdShelfExpiryPeriodForUseAtLocation": {
                "type": "object",
                "description": "Expiration period for items on the hold shelf for use at the location",
                "$schema": "http://json-schema.org/draft-04/schema#",
                "properties": {
                  "duration": {
                    "type": "integer",
                    "description": "Duration interval"
                  },
                  "intervalId": {
                    "type": "string",
                    "description": "Unit of time for the duration",
                    "enum": [
                      "Minutes",
                      "Hours",
                      "Days",
                      "Weeks",
                      "Months"
                    ],
                    "default": "Days"
                  }
                },
                "required": [
                  "duration",
                  "intervalId"
                ]
              }
            }
          },
          "renewable": {
            "type": "boolean",
            "description": "Is item renewable"
          },
          "renewalsPolicy": {
            "type": "object",
            "description": "Settings for renewals",
            "properties": {
              "unlimited": {
                "type": "boolean",
                "description": "Unlimited renewals"
              },
              "numberAllowed": {
                "type": "number",
                "description": "Number of renewals allowed"
              },
              "renewFromId": {
                "type": "string",
                "description": "Renew from date"
              },
              "differentPeriod": {
                "type": "boolean",
                "description": "Renewal period different from original loan"
              },
              "period": {
                "type": "object",
                "description": "Alternate loan period for renewals",
                "$schema": "http://json-schema.org/draft-04/schema#",
                "properties": {
                  "duration": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                  },
                  "intervalId": {
                    "type": "string",
                    "description": "Interval for the period, e.g. hours, days or weeks",
                    "enum": [
                      "Minutes",
                      "Hours",
                      "Days",
                      "Weeks",
                      "Months"
                    ]
                  }
                },
                "required": [
                  "duration",
                  "intervalId"
                ],
                "additionalProperties": false
              },
              "alternateFixedDueDateScheduleId": {
                "type": "string",
                "description": "Alternate fixed due date schedule (due date limit) for renewals"
              }
            }
          },
          "requestManagement": {
            "type": "object",
            "description": "Settings for various request types",
            "additionalProperties": false,
            "properties": {
              "recalls": {
                "type": "object",
                "description": "Settings for recall requests",
                "additionalProperties": false,
                "properties": {
                  "alternateGracePeriod": {
                    "type": "object",
                    "description": "Alternate grace period for recalled items",
                    "$schema": "http://json-schema.org/draft-04/schema#",
                    "properties": {
                      "duration": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                      },
                      "intervalId": {
                        "type": "string",
                        "description": "Interval for the period, e.g. hours, days or weeks",
                        "enum": [
                          "Minutes",
                          "Hours",
                          "Days",
                          "Weeks",
                          "Months"
                        ]
                      }
                    },
                    "required": [
                      "duration",
                      "intervalId"
                    ],
                    "additionalProperties": false
                  },
                  "minimumGuaranteedLoanPeriod": {
                    "type": "object",
                    "description": "Minimum guaranteed loan period",
                    "$schema": "http://json-schema.org/draft-04/schema#",
                    "properties": {
                      "duration": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                      },
                      "intervalId": {
                        "type": "string",
                        "description": "Interval for the period, e.g. hours, days or weeks",
                        "enum": [
                          "Minutes",
                          "Hours",
                          "Days",
                          "Weeks",
                          "Months"
                        ]
                      }
                    },
                    "required": [
                      "duration",
                      "intervalId"
                    ],
                    "additionalProperties": false
                  },
                  "recallReturnInterval": {
                    "type": "object",
                    "description": "Recall return interval",
                    "$schema": "http://json-schema.org/draft-04/schema#",
                    "properties": {
                      "duration": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                      },
                      "intervalId": {
                        "type": "string",
                        "description": "Interval for the period, e.g. hours, days or weeks",
                        "enum": [
                          "Minutes",
                          "Hours",
                          "Days",
                          "Weeks",
                          "Months"
                        ]
                      }
                    },
                    "required": [
                      "duration",
                      "intervalId"
                    ],
                    "additionalProperties": false
                  },
                  "allowRecallsToExtendOverdueLoans": {
                    "type": "boolean",
                    "description": "Whether recalls are allowed to extend overdue loans",
                    "default": false
                  },
                  "alternateRecallReturnInterval": {
                    "type": "object",
                    "description": "Alternate recall return interval for overdue loans",
                    "$schema": "http://json-schema.org/draft-04/schema#",
                    "properties": {
                      "duration": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                      },
                      "intervalId": {
                        "type": "string",
                        "description": "Interval for the period, e.g. hours, days or weeks",
                        "enum": [
                          "Minutes",
                          "Hours",
                          "Days",
                          "Weeks",
                          "Months"
                        ]
                      }
                    },
                    "required": [
                      "duration",
                      "intervalId"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "holds": {
                "type": "object",
                "description": "Settings for hold requests",
                "additionalProperties": false,
                "properties": {
                  "alternateCheckoutLoanPeriod": {
                    "type": "object",
                    "description": "Alternate loan period at checkout for items with active, pending hold request",
                    "$schema": "http://json-schema.org/draft-04/schema#",
                    "properties": {
                      "duration": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                      },
                      "intervalId": {
                        "type": "string",
                        "description": "Interval for the period, e.g. hours, days or weeks",
                        "enum": [
                          "Minutes",
                          "Hours",
                          "Days",
                          "Weeks",
                          "Months"
                        ]
                      }
                    },
                    "required": [
                      "duration",
                      "intervalId"
                    ],
                    "additionalProperties": false
                  },
                  "renewItemsWithRequest": {
                    "type": "boolean",
                    "description": "Allow renewal of items with active, pending hold request"
                  },
                  "alternateRenewalLoanPeriod": {
                    "type": "object",
                    "description": "Alternate loan period at renewal for items with active, pending hold request",
                    "$schema": "http://json-schema.org/draft-04/schema#",
                    "properties": {
                      "duration": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                      },
                      "intervalId": {
                        "type": "string",
                        "description": "Interval for the period, e.g. hours, days or weeks",
                        "enum": [
                          "Minutes",
                          "Hours",
                          "Days",
                          "Weeks",
                          "Months"
                        ]
                      }
                    },
                    "required": [
                      "duration",
                      "intervalId"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "pages": {
                "type": "object",
                "description": "Settings for page requests",
                "additionalProperties": false,
                "properties": {
                  "alternateCheckoutLoanPeriod": {
                    "type": "object",
                    "description": "Alternate loan period at checkout for items with active, pending page request",
                    "$schema": "http://json-schema.org/draft-04/schema#",
                    "properties": {
                      "duration": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                      },
                      "intervalId": {
                        "type": "string",
                        "description": "Interval for the period, e.g. hours, days or weeks",
                        "enum": [
                          "Minutes",
                          "Hours",
                          "Days",
                          "Weeks",
                          "Months"
                        ]
                      }
                    },
                    "required": [
                      "duration",
                      "intervalId"
                    ],
                    "additionalProperties": false
                  },
                  "renewItemsWithRequest": {
                    "type": "boolean",
                    "description": "Allow renewal of items with active, pending page request"
                  },
                  "alternateRenewalLoanPeriod": {
                    "type": "object",
                    "description": "Alternate loan period at renewal for items with active, pending page request",
                    "$schema": "http://json-schema.org/draft-04/schema#",
                    "properties": {
                      "duration": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                      },
                      "intervalId": {
                        "type": "string",
                        "description": "Interval for the period, e.g. hours, days or weeks",
                        "enum": [
                          "Minutes",
                          "Hours",
                          "Days",
                          "Weeks",
                          "Months"
                        ]
                      }
                    },
                    "required": [
                      "duration",
                      "intervalId"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "metadata": {
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "metadata.schema",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "type": "object",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "name",
          "loanable",
          "renewable"
        ]
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "loanPolicies",
    "totalRecords"
  ]
}

Example:

{
  "loanPolicies": [
    {
      "id": "d9cd0bed-1b49-4b5e-a7bd-064b8d177231",
      "name": "Example Loan Policy",
      "description": "An example loan policy",
      "loanable": true,
      "loansPolicy": {
        "profileId": "Rolling",
        "period": {
          "duration": 1,
          "intervalId": "Months"
        },
        "closedLibraryDueDateManagementId": "CURRENT_DUE_DATE",
        "gracePeriod": {
          "duration": 7,
          "intervalId": "Days"
        }
      },
      "renewable": true,
      "renewalsPolicy": {
        "unlimited": false,
        "numberAllowed": 3,
        "renewFromId": "CURRENT_DUE_DATE",
        "differentPeriod": true,
        "period": {
          "duration": 30,
          "intervalId": "Days"
        }
      }
    },
    {
      "id": "0df935eb-f3f4-4741-9ac6-33c500174b96",
      "name": "A minimal loan policy",
      "loanable": true,
      "renewable": false
    }
  ],
  "totalRecords": 2
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

unable to list loan-policies -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to list loan-policies -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

Response 501

Not implemented yet

POST /loan-policy-storage/loan-policies

Create a new loan-policy item.

POST /loan-policy-storage/loan-policies
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Rules governing loans",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "description": "The name of the policy.",
      "type": "string"
    },
    "description": {
      "description": "Description of the loan policy",
      "type": "string"
    },
    "loanable": {
      "description": "Flag that indicates whether this policy allows loans",
      "type": "boolean"
    },
    "loansPolicy": {
      "type": "object",
      "description": "Settings for loans",
      "additionalProperties": false,
      "properties": {
        "profileId": {
          "type": "string",
          "description": "Loan profile"
        },
        "period": {
          "type": "object",
          "description": "Loan period",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "minimum": 0,
              "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
            },
            "intervalId": {
              "type": "string",
              "description": "Interval for the period, e.g. hours, days or weeks",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ]
            }
          },
          "required": [
            "duration",
            "intervalId"
          ],
          "additionalProperties": false
        },
        "closedLibraryDueDateManagementId": {
          "type": "string",
          "description": "Closed library due date management"
        },
        "gracePeriod": {
          "type": "object",
          "description": "Grace period",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "minimum": 0,
              "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
            },
            "intervalId": {
              "type": "string",
              "description": "Interval for the period, e.g. hours, days or weeks",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ]
            }
          },
          "required": [
            "duration",
            "intervalId"
          ],
          "additionalProperties": false
        },
        "openingTimeOffset": {
          "type": "object",
          "description": "Opening offset time period",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "minimum": 0,
              "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
            },
            "intervalId": {
              "type": "string",
              "description": "Interval for the period, e.g. hours, days or weeks",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ]
            }
          },
          "required": [
            "duration",
            "intervalId"
          ],
          "additionalProperties": false
        },
        "fixedDueDateScheduleId": {
          "type": "string",
          "description": "Fixed due date schedule (due date limit)"
        },
        "itemLimit": {
          "type": "integer",
          "description": "Number of items allowed",
          "minimum": 1,
          "maximum": 9999
        },
        "forUseAtLocation": {
          "type": "boolean",
          "description": "Indicates that loaned items must be used in the library, i.e. in a reading room"
        },
        "holdShelfExpiryPeriodForUseAtLocation": {
          "type": "object",
          "description": "Expiration period for items on the hold shelf for use at the location",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "description": "Duration interval"
            },
            "intervalId": {
              "type": "string",
              "description": "Unit of time for the duration",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ],
              "default": "Days"
            }
          },
          "required": [
            "duration",
            "intervalId"
          ]
        }
      }
    },
    "renewable": {
      "type": "boolean",
      "description": "Is item renewable"
    },
    "renewalsPolicy": {
      "type": "object",
      "description": "Settings for renewals",
      "properties": {
        "unlimited": {
          "type": "boolean",
          "description": "Unlimited renewals"
        },
        "numberAllowed": {
          "type": "number",
          "description": "Number of renewals allowed"
        },
        "renewFromId": {
          "type": "string",
          "description": "Renew from date"
        },
        "differentPeriod": {
          "type": "boolean",
          "description": "Renewal period different from original loan"
        },
        "period": {
          "type": "object",
          "description": "Alternate loan period for renewals",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "minimum": 0,
              "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
            },
            "intervalId": {
              "type": "string",
              "description": "Interval for the period, e.g. hours, days or weeks",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ]
            }
          },
          "required": [
            "duration",
            "intervalId"
          ],
          "additionalProperties": false
        },
        "alternateFixedDueDateScheduleId": {
          "type": "string",
          "description": "Alternate fixed due date schedule (due date limit) for renewals"
        }
      }
    },
    "requestManagement": {
      "type": "object",
      "description": "Settings for various request types",
      "additionalProperties": false,
      "properties": {
        "recalls": {
          "type": "object",
          "description": "Settings for recall requests",
          "additionalProperties": false,
          "properties": {
            "alternateGracePeriod": {
              "type": "object",
              "description": "Alternate grace period for recalled items",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            },
            "minimumGuaranteedLoanPeriod": {
              "type": "object",
              "description": "Minimum guaranteed loan period",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            },
            "recallReturnInterval": {
              "type": "object",
              "description": "Recall return interval",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            },
            "allowRecallsToExtendOverdueLoans": {
              "type": "boolean",
              "description": "Whether recalls are allowed to extend overdue loans",
              "default": false
            },
            "alternateRecallReturnInterval": {
              "type": "object",
              "description": "Alternate recall return interval for overdue loans",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            }
          }
        },
        "holds": {
          "type": "object",
          "description": "Settings for hold requests",
          "additionalProperties": false,
          "properties": {
            "alternateCheckoutLoanPeriod": {
              "type": "object",
              "description": "Alternate loan period at checkout for items with active, pending hold request",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            },
            "renewItemsWithRequest": {
              "type": "boolean",
              "description": "Allow renewal of items with active, pending hold request"
            },
            "alternateRenewalLoanPeriod": {
              "type": "object",
              "description": "Alternate loan period at renewal for items with active, pending hold request",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            }
          }
        },
        "pages": {
          "type": "object",
          "description": "Settings for page requests",
          "additionalProperties": false,
          "properties": {
            "alternateCheckoutLoanPeriod": {
              "type": "object",
              "description": "Alternate loan period at checkout for items with active, pending page request",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            },
            "renewItemsWithRequest": {
              "type": "boolean",
              "description": "Allow renewal of items with active, pending page request"
            },
            "alternateRenewalLoanPeriod": {
              "type": "object",
              "description": "Alternate loan period at renewal for items with active, pending page request",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            }
          }
        }
      }
    },
    "metadata": {
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "type": "object",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "name",
    "loanable",
    "renewable"
  ]
}

Example:

{
  "id": "d9cd0bed-1b49-4b5e-a7bd-064b8d177231",
  "name": "Example Loan Policy",
  "description": "An example loan policy",
  "loanable": true,
  "loansPolicy": {
    "profileId": "Rolling",
    "period": {
      "duration": 1,
      "intervalId": "Months"
    },
    "closedLibraryDueDateManagementId": "CURRENT_DUE_DATE",
    "gracePeriod": {
      "duration": 7,
      "intervalId": "Days"
    },
    "openingTimeOffset": {
      "duration": 2,
      "intervalId": "Weeks"
    },
    "fixedDueDateScheduleId": "",
    "itemLimit": 1000
  },
  "renewable": true,
  "renewalsPolicy": {
    "unlimited": true,
    "numberAllowed": 2,
    "renewFromId": "CURRENT_DUE_DATE",
    "differentPeriod": true,
    "period": {
      "duration": 30,
      "intervalId": "Days"
    },
    "alternateFixedDueDateScheduleId": ""
  },
  "requestManagement": {
    "recalls": {
      "alternateGracePeriod": {
        "duration": 1,
        "intervalId": "Months"
      },
      "minimumGuaranteedLoanPeriod": {
        "duration": 2,
        "intervalId": "Weeks"
      },
      "recallReturnInterval": {
        "duration": 3,
        "intervalId": "Days"
      },
      "alternateRecallReturnInterval": {
        "duration": 4,
        "intervalId": "Hours"
      }
    }
  },
  "holds": {
    "recalls": {
      "alternateCheckoutLoanPeriod": {
        "duration": 1,
        "intervalId": "Months"
      },
      "renewItemsWithRequest": true,
      "alternateRenewalLoanPeriod": {
        "duration": 2,
        "intervalId": "Weeks"
      }
    }
  },
  "pages": {
    "recalls": {
      "alternateCheckoutLoanPeriod": {
        "duration": 1,
        "intervalId": "Months"
      },
      "renewItemsWithRequest": true,
      "alternateRenewalLoanPeriod": {
        "duration": 2,
        "intervalId": "Weeks"
      }
    }
  }
}

Response 201

Returns a newly created item, with server-controlled fields like 'id' populated

Headers
  • Location: required (string)

    URI to the created loan-policy item

Body

Media type: application/json

Type: any

Example:

{
  "id": "d9cd0bed-1b49-4b5e-a7bd-064b8d177231",
  "name": "Example Loan Policy",
  "description": "An example loan policy",
  "loanable": true,
  "loansPolicy": {
    "profileId": "Rolling",
    "period": {
      "duration": 1,
      "intervalId": "Months"
    },
    "closedLibraryDueDateManagementId": "CURRENT_DUE_DATE",
    "gracePeriod": {
      "duration": 7,
      "intervalId": "Days"
    },
    "openingTimeOffset": {
      "duration": 2,
      "intervalId": "Weeks"
    },
    "fixedDueDateScheduleId": "",
    "itemLimit": 1000
  },
  "renewable": true,
  "renewalsPolicy": {
    "unlimited": true,
    "numberAllowed": 2,
    "renewFromId": "CURRENT_DUE_DATE",
    "differentPeriod": true,
    "period": {
      "duration": 30,
      "intervalId": "Days"
    },
    "alternateFixedDueDateScheduleId": ""
  },
  "requestManagement": {
    "recalls": {
      "alternateGracePeriod": {
        "duration": 1,
        "intervalId": "Months"
      },
      "minimumGuaranteedLoanPeriod": {
        "duration": 2,
        "intervalId": "Weeks"
      },
      "recallReturnInterval": {
        "duration": 3,
        "intervalId": "Days"
      },
      "alternateRecallReturnInterval": {
        "duration": 4,
        "intervalId": "Hours"
      }
    }
  },
  "holds": {
    "recalls": {
      "alternateCheckoutLoanPeriod": {
        "duration": 1,
        "intervalId": "Months"
      },
      "renewItemsWithRequest": true,
      "alternateRenewalLoanPeriod": {
        "duration": 2,
        "intervalId": "Weeks"
      }
    }
  },
  "pages": {
    "recalls": {
      "alternateCheckoutLoanPeriod": {
        "duration": 1,
        "intervalId": "Months"
      },
      "renewItemsWithRequest": true,
      "alternateRenewalLoanPeriod": {
        "duration": 2,
        "intervalId": "Weeks"
      }
    }
  }
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to add loan-policy -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create loan-policies -- unauthorized

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.schema",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "id": "error.schema",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

Response 501

Not implemented yet

DELETE /loan-policy-storage/loan-policies

DELETE /loan-policy-storage/loan-policies

Response 204

All loans deleted

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

Response 501

Not implemented yet

GET /loan-policy-storage/loan-policies/{loanPolicyId}

Retrieve loan-policy item with given {loan-policyId}

GET /loan-policy-storage/loan-policies/{loanPolicyId}
URI Parameters
  • loanPolicyId: required (string)

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Rules governing loans",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "description": "The name of the policy.",
      "type": "string"
    },
    "description": {
      "description": "Description of the loan policy",
      "type": "string"
    },
    "loanable": {
      "description": "Flag that indicates whether this policy allows loans",
      "type": "boolean"
    },
    "loansPolicy": {
      "type": "object",
      "description": "Settings for loans",
      "additionalProperties": false,
      "properties": {
        "profileId": {
          "type": "string",
          "description": "Loan profile"
        },
        "period": {
          "type": "object",
          "description": "Loan period",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "minimum": 0,
              "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
            },
            "intervalId": {
              "type": "string",
              "description": "Interval for the period, e.g. hours, days or weeks",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ]
            }
          },
          "required": [
            "duration",
            "intervalId"
          ],
          "additionalProperties": false
        },
        "closedLibraryDueDateManagementId": {
          "type": "string",
          "description": "Closed library due date management"
        },
        "gracePeriod": {
          "type": "object",
          "description": "Grace period",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "minimum": 0,
              "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
            },
            "intervalId": {
              "type": "string",
              "description": "Interval for the period, e.g. hours, days or weeks",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ]
            }
          },
          "required": [
            "duration",
            "intervalId"
          ],
          "additionalProperties": false
        },
        "openingTimeOffset": {
          "type": "object",
          "description": "Opening offset time period",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "minimum": 0,
              "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
            },
            "intervalId": {
              "type": "string",
              "description": "Interval for the period, e.g. hours, days or weeks",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ]
            }
          },
          "required": [
            "duration",
            "intervalId"
          ],
          "additionalProperties": false
        },
        "fixedDueDateScheduleId": {
          "type": "string",
          "description": "Fixed due date schedule (due date limit)"
        },
        "itemLimit": {
          "type": "integer",
          "description": "Number of items allowed",
          "minimum": 1,
          "maximum": 9999
        },
        "forUseAtLocation": {
          "type": "boolean",
          "description": "Indicates that loaned items must be used in the library, i.e. in a reading room"
        },
        "holdShelfExpiryPeriodForUseAtLocation": {
          "type": "object",
          "description": "Expiration period for items on the hold shelf for use at the location",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "description": "Duration interval"
            },
            "intervalId": {
              "type": "string",
              "description": "Unit of time for the duration",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ],
              "default": "Days"
            }
          },
          "required": [
            "duration",
            "intervalId"
          ]
        }
      }
    },
    "renewable": {
      "type": "boolean",
      "description": "Is item renewable"
    },
    "renewalsPolicy": {
      "type": "object",
      "description": "Settings for renewals",
      "properties": {
        "unlimited": {
          "type": "boolean",
          "description": "Unlimited renewals"
        },
        "numberAllowed": {
          "type": "number",
          "description": "Number of renewals allowed"
        },
        "renewFromId": {
          "type": "string",
          "description": "Renew from date"
        },
        "differentPeriod": {
          "type": "boolean",
          "description": "Renewal period different from original loan"
        },
        "period": {
          "type": "object",
          "description": "Alternate loan period for renewals",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "minimum": 0,
              "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
            },
            "intervalId": {
              "type": "string",
              "description": "Interval for the period, e.g. hours, days or weeks",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ]
            }
          },
          "required": [
            "duration",
            "intervalId"
          ],
          "additionalProperties": false
        },
        "alternateFixedDueDateScheduleId": {
          "type": "string",
          "description": "Alternate fixed due date schedule (due date limit) for renewals"
        }
      }
    },
    "requestManagement": {
      "type": "object",
      "description": "Settings for various request types",
      "additionalProperties": false,
      "properties": {
        "recalls": {
          "type": "object",
          "description": "Settings for recall requests",
          "additionalProperties": false,
          "properties": {
            "alternateGracePeriod": {
              "type": "object",
              "description": "Alternate grace period for recalled items",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            },
            "minimumGuaranteedLoanPeriod": {
              "type": "object",
              "description": "Minimum guaranteed loan period",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            },
            "recallReturnInterval": {
              "type": "object",
              "description": "Recall return interval",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            },
            "allowRecallsToExtendOverdueLoans": {
              "type": "boolean",
              "description": "Whether recalls are allowed to extend overdue loans",
              "default": false
            },
            "alternateRecallReturnInterval": {
              "type": "object",
              "description": "Alternate recall return interval for overdue loans",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            }
          }
        },
        "holds": {
          "type": "object",
          "description": "Settings for hold requests",
          "additionalProperties": false,
          "properties": {
            "alternateCheckoutLoanPeriod": {
              "type": "object",
              "description": "Alternate loan period at checkout for items with active, pending hold request",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            },
            "renewItemsWithRequest": {
              "type": "boolean",
              "description": "Allow renewal of items with active, pending hold request"
            },
            "alternateRenewalLoanPeriod": {
              "type": "object",
              "description": "Alternate loan period at renewal for items with active, pending hold request",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            }
          }
        },
        "pages": {
          "type": "object",
          "description": "Settings for page requests",
          "additionalProperties": false,
          "properties": {
            "alternateCheckoutLoanPeriod": {
              "type": "object",
              "description": "Alternate loan period at checkout for items with active, pending page request",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            },
            "renewItemsWithRequest": {
              "type": "boolean",
              "description": "Allow renewal of items with active, pending page request"
            },
            "alternateRenewalLoanPeriod": {
              "type": "object",
              "description": "Alternate loan period at renewal for items with active, pending page request",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            }
          }
        }
      }
    },
    "metadata": {
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "type": "object",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "name",
    "loanable",
    "renewable"
  ]
}

Example:

{
  "id": "d9cd0bed-1b49-4b5e-a7bd-064b8d177231",
  "name": "Example Loan Policy",
  "description": "An example loan policy",
  "loanable": true,
  "loansPolicy": {
    "profileId": "Rolling",
    "period": {
      "duration": 1,
      "intervalId": "Months"
    },
    "closedLibraryDueDateManagementId": "CURRENT_DUE_DATE",
    "gracePeriod": {
      "duration": 7,
      "intervalId": "Days"
    },
    "openingTimeOffset": {
      "duration": 2,
      "intervalId": "Weeks"
    },
    "fixedDueDateScheduleId": "",
    "itemLimit": 1000
  },
  "renewable": true,
  "renewalsPolicy": {
    "unlimited": true,
    "numberAllowed": 2,
    "renewFromId": "CURRENT_DUE_DATE",
    "differentPeriod": true,
    "period": {
      "duration": 30,
      "intervalId": "Days"
    },
    "alternateFixedDueDateScheduleId": ""
  },
  "requestManagement": {
    "recalls": {
      "alternateGracePeriod": {
        "duration": 1,
        "intervalId": "Months"
      },
      "minimumGuaranteedLoanPeriod": {
        "duration": 2,
        "intervalId": "Weeks"
      },
      "recallReturnInterval": {
        "duration": 3,
        "intervalId": "Days"
      },
      "alternateRecallReturnInterval": {
        "duration": 4,
        "intervalId": "Hours"
      }
    }
  },
  "holds": {
    "recalls": {
      "alternateCheckoutLoanPeriod": {
        "duration": 1,
        "intervalId": "Months"
      },
      "renewItemsWithRequest": true,
      "alternateRenewalLoanPeriod": {
        "duration": 2,
        "intervalId": "Weeks"
      }
    }
  },
  "pages": {
    "recalls": {
      "alternateCheckoutLoanPeriod": {
        "duration": 1,
        "intervalId": "Months"
      },
      "renewItemsWithRequest": true,
      "alternateRenewalLoanPeriod": {
        "duration": 2,
        "intervalId": "Weeks"
      }
    }
  }
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"loan-policy not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

Response 501

Not implemented yet

PUT /loan-policy-storage/loan-policies/{loanPolicyId}

Update loan-policy item with given {loan-policyId}

PUT /loan-policy-storage/loan-policies/{loanPolicyId}
URI Parameters
  • loanPolicyId: required (string)
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Rules governing loans",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "description": "The name of the policy.",
      "type": "string"
    },
    "description": {
      "description": "Description of the loan policy",
      "type": "string"
    },
    "loanable": {
      "description": "Flag that indicates whether this policy allows loans",
      "type": "boolean"
    },
    "loansPolicy": {
      "type": "object",
      "description": "Settings for loans",
      "additionalProperties": false,
      "properties": {
        "profileId": {
          "type": "string",
          "description": "Loan profile"
        },
        "period": {
          "type": "object",
          "description": "Loan period",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "minimum": 0,
              "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
            },
            "intervalId": {
              "type": "string",
              "description": "Interval for the period, e.g. hours, days or weeks",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ]
            }
          },
          "required": [
            "duration",
            "intervalId"
          ],
          "additionalProperties": false
        },
        "closedLibraryDueDateManagementId": {
          "type": "string",
          "description": "Closed library due date management"
        },
        "gracePeriod": {
          "type": "object",
          "description": "Grace period",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "minimum": 0,
              "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
            },
            "intervalId": {
              "type": "string",
              "description": "Interval for the period, e.g. hours, days or weeks",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ]
            }
          },
          "required": [
            "duration",
            "intervalId"
          ],
          "additionalProperties": false
        },
        "openingTimeOffset": {
          "type": "object",
          "description": "Opening offset time period",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "minimum": 0,
              "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
            },
            "intervalId": {
              "type": "string",
              "description": "Interval for the period, e.g. hours, days or weeks",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ]
            }
          },
          "required": [
            "duration",
            "intervalId"
          ],
          "additionalProperties": false
        },
        "fixedDueDateScheduleId": {
          "type": "string",
          "description": "Fixed due date schedule (due date limit)"
        },
        "itemLimit": {
          "type": "integer",
          "description": "Number of items allowed",
          "minimum": 1,
          "maximum": 9999
        },
        "forUseAtLocation": {
          "type": "boolean",
          "description": "Indicates that loaned items must be used in the library, i.e. in a reading room"
        },
        "holdShelfExpiryPeriodForUseAtLocation": {
          "type": "object",
          "description": "Expiration period for items on the hold shelf for use at the location",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "description": "Duration interval"
            },
            "intervalId": {
              "type": "string",
              "description": "Unit of time for the duration",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ],
              "default": "Days"
            }
          },
          "required": [
            "duration",
            "intervalId"
          ]
        }
      }
    },
    "renewable": {
      "type": "boolean",
      "description": "Is item renewable"
    },
    "renewalsPolicy": {
      "type": "object",
      "description": "Settings for renewals",
      "properties": {
        "unlimited": {
          "type": "boolean",
          "description": "Unlimited renewals"
        },
        "numberAllowed": {
          "type": "number",
          "description": "Number of renewals allowed"
        },
        "renewFromId": {
          "type": "string",
          "description": "Renew from date"
        },
        "differentPeriod": {
          "type": "boolean",
          "description": "Renewal period different from original loan"
        },
        "period": {
          "type": "object",
          "description": "Alternate loan period for renewals",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "minimum": 0,
              "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
            },
            "intervalId": {
              "type": "string",
              "description": "Interval for the period, e.g. hours, days or weeks",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ]
            }
          },
          "required": [
            "duration",
            "intervalId"
          ],
          "additionalProperties": false
        },
        "alternateFixedDueDateScheduleId": {
          "type": "string",
          "description": "Alternate fixed due date schedule (due date limit) for renewals"
        }
      }
    },
    "requestManagement": {
      "type": "object",
      "description": "Settings for various request types",
      "additionalProperties": false,
      "properties": {
        "recalls": {
          "type": "object",
          "description": "Settings for recall requests",
          "additionalProperties": false,
          "properties": {
            "alternateGracePeriod": {
              "type": "object",
              "description": "Alternate grace period for recalled items",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            },
            "minimumGuaranteedLoanPeriod": {
              "type": "object",
              "description": "Minimum guaranteed loan period",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            },
            "recallReturnInterval": {
              "type": "object",
              "description": "Recall return interval",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            },
            "allowRecallsToExtendOverdueLoans": {
              "type": "boolean",
              "description": "Whether recalls are allowed to extend overdue loans",
              "default": false
            },
            "alternateRecallReturnInterval": {
              "type": "object",
              "description": "Alternate recall return interval for overdue loans",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            }
          }
        },
        "holds": {
          "type": "object",
          "description": "Settings for hold requests",
          "additionalProperties": false,
          "properties": {
            "alternateCheckoutLoanPeriod": {
              "type": "object",
              "description": "Alternate loan period at checkout for items with active, pending hold request",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            },
            "renewItemsWithRequest": {
              "type": "boolean",
              "description": "Allow renewal of items with active, pending hold request"
            },
            "alternateRenewalLoanPeriod": {
              "type": "object",
              "description": "Alternate loan period at renewal for items with active, pending hold request",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            }
          }
        },
        "pages": {
          "type": "object",
          "description": "Settings for page requests",
          "additionalProperties": false,
          "properties": {
            "alternateCheckoutLoanPeriod": {
              "type": "object",
              "description": "Alternate loan period at checkout for items with active, pending page request",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            },
            "renewItemsWithRequest": {
              "type": "boolean",
              "description": "Allow renewal of items with active, pending page request"
            },
            "alternateRenewalLoanPeriod": {
              "type": "object",
              "description": "Alternate loan period at renewal for items with active, pending page request",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "properties": {
                "duration": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                },
                "intervalId": {
                  "type": "string",
                  "description": "Interval for the period, e.g. hours, days or weeks",
                  "enum": [
                    "Minutes",
                    "Hours",
                    "Days",
                    "Weeks",
                    "Months"
                  ]
                }
              },
              "required": [
                "duration",
                "intervalId"
              ],
              "additionalProperties": false
            }
          }
        }
      }
    },
    "metadata": {
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "type": "object",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "name",
    "loanable",
    "renewable"
  ]
}

Example:

{
  "id": "d9cd0bed-1b49-4b5e-a7bd-064b8d177231",
  "name": "Example Loan Policy",
  "description": "An example loan policy",
  "loanable": true,
  "loansPolicy": {
    "profileId": "Rolling",
    "period": {
      "duration": 1,
      "intervalId": "Months"
    },
    "closedLibraryDueDateManagementId": "CURRENT_DUE_DATE",
    "gracePeriod": {
      "duration": 7,
      "intervalId": "Days"
    },
    "openingTimeOffset": {
      "duration": 2,
      "intervalId": "Weeks"
    },
    "fixedDueDateScheduleId": "",
    "itemLimit": 1000
  },
  "renewable": true,
  "renewalsPolicy": {
    "unlimited": true,
    "numberAllowed": 2,
    "renewFromId": "CURRENT_DUE_DATE",
    "differentPeriod": true,
    "period": {
      "duration": 30,
      "intervalId": "Days"
    },
    "alternateFixedDueDateScheduleId": ""
  },
  "requestManagement": {
    "recalls": {
      "alternateGracePeriod": {
        "duration": 1,
        "intervalId": "Months"
      },
      "minimumGuaranteedLoanPeriod": {
        "duration": 2,
        "intervalId": "Weeks"
      },
      "recallReturnInterval": {
        "duration": 3,
        "intervalId": "Days"
      },
      "alternateRecallReturnInterval": {
        "duration": 4,
        "intervalId": "Hours"
      }
    }
  },
  "holds": {
    "recalls": {
      "alternateCheckoutLoanPeriod": {
        "duration": 1,
        "intervalId": "Months"
      },
      "renewItemsWithRequest": true,
      "alternateRenewalLoanPeriod": {
        "duration": 2,
        "intervalId": "Weeks"
      }
    }
  },
  "pages": {
    "recalls": {
      "alternateCheckoutLoanPeriod": {
        "duration": 1,
        "intervalId": "Months"
      },
      "renewItemsWithRequest": true,
      "alternateRenewalLoanPeriod": {
        "duration": 2,
        "intervalId": "Weeks"
      }
    }
  }
}

Response 204

Item successfully updated

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to update loan-policy -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"loan-policy not found"

Response 409

Optimistic locking version conflict

Body

Media type: text/plain

Type: any

Example:

version conflict

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

Response 501

Not implemented yet

DELETE /loan-policy-storage/loan-policies/{loanPolicyId}

Delete loan-policy item with given {loan-policyId}

DELETE /loan-policy-storage/loan-policies/{loanPolicyId}
URI Parameters
  • loanPolicyId: required (string)

Response 204

Item deleted successfully

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to delete loan-policy -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"loan-policy not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

Response 501

Not implemented yet