Loan Policy Storage (v2.3)

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
  • 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

    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"
    
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

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#",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "loanable": {
            "type": "boolean"
          },
          "loansPolicy": {
            "type": "object",
            "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": 1,
                    "description": "Duration of the period, number of times the interval repeats"
                  },
                  "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": 1,
                    "description": "Duration of the period, number of times the interval repeats"
                  },
                  "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": 1,
                    "description": "Duration of the period, number of times the interval repeats"
                  },
                  "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
              }
            }
          },
          "renewable": {
            "type": "boolean",
            "description": "Is item renewable"
          },
          "renewalsPolicy": {
            "type": "object",
            "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": 1,
                    "description": "Duration of the period, number of times the interval repeats"
                  },
                  "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",
            "additionalProperties": false,
            "properties": {
              "recalls": {
                "type": "object",
                "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": 1,
                        "description": "Duration of the period, number of times the interval repeats"
                      },
                      "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": 1,
                        "description": "Duration of the period, number of times the interval repeats"
                      },
                      "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": 1,
                        "description": "Duration of the period, number of times the interval repeats"
                      },
                      "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": 1,
                        "description": "Duration of the period, number of times the interval repeats"
                      },
                      "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",
                "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": 1,
                        "description": "Duration of the period, number of times the interval repeats"
                      },
                      "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": 1,
                        "description": "Duration of the period, number of times the interval repeats"
                      },
                      "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",
                "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": 1,
                        "description": "Duration of the period, number of times the interval repeats"
                      },
                      "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": 1,
                        "description": "Duration of the period, number of times the interval repeats"
                      },
                      "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
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "loanable": {
      "type": "boolean"
    },
    "loansPolicy": {
      "type": "object",
      "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": 1,
              "description": "Duration of the period, number of times the interval repeats"
            },
            "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": 1,
              "description": "Duration of the period, number of times the interval repeats"
            },
            "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": 1,
              "description": "Duration of the period, number of times the interval repeats"
            },
            "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
        }
      }
    },
    "renewable": {
      "type": "boolean",
      "description": "Is item renewable"
    },
    "renewalsPolicy": {
      "type": "object",
      "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": 1,
              "description": "Duration of the period, number of times the interval repeats"
            },
            "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",
      "additionalProperties": false,
      "properties": {
        "recalls": {
          "type": "object",
          "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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",
          "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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",
          "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

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)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "loanable": {
      "type": "boolean"
    },
    "loansPolicy": {
      "type": "object",
      "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": 1,
              "description": "Duration of the period, number of times the interval repeats"
            },
            "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": 1,
              "description": "Duration of the period, number of times the interval repeats"
            },
            "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": 1,
              "description": "Duration of the period, number of times the interval repeats"
            },
            "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
        }
      }
    },
    "renewable": {
      "type": "boolean",
      "description": "Is item renewable"
    },
    "renewalsPolicy": {
      "type": "object",
      "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": 1,
              "description": "Duration of the period, number of times the interval repeats"
            },
            "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",
      "additionalProperties": false,
      "properties": {
        "recalls": {
          "type": "object",
          "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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",
          "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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",
          "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "loanable": {
      "type": "boolean"
    },
    "loansPolicy": {
      "type": "object",
      "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": 1,
              "description": "Duration of the period, number of times the interval repeats"
            },
            "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": 1,
              "description": "Duration of the period, number of times the interval repeats"
            },
            "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": 1,
              "description": "Duration of the period, number of times the interval repeats"
            },
            "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
        }
      }
    },
    "renewable": {
      "type": "boolean",
      "description": "Is item renewable"
    },
    "renewalsPolicy": {
      "type": "object",
      "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": 1,
              "description": "Duration of the period, number of times the interval repeats"
            },
            "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",
      "additionalProperties": false,
      "properties": {
        "recalls": {
          "type": "object",
          "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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",
          "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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",
          "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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": 1,
                  "description": "Duration of the period, number of times the interval repeats"
                },
                "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)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

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