Loan Policy Storage API documentation version v2.0
http://localhost:9130
Loan Policy Storage API
Storage for loan policies
/loan-policy-storage
Collection of loan-policy items.
Retrieve a list of loan-policy items.
Create a new loan-policy item.
get /loan-policy-storage/loan-policies
Retrieve a list of loan-policy items.
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]
HTTP status code 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",
"$ref": "loan-policy.json"
}
},
"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": "KEEP_CURRENT_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
}
HTTP status code 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
HTTP status code 401
Not authorized to perform requested action
Body
Media type: text/plain
Type: any
Example:
unable to list loan-policies -- unauthorized
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
HTTP status code 501
Not implemented yet
post /loan-policy-storage/loan-policies
Create a new loan-policy item.
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",
"$ref": "period.json",
"description": "Loan period"
},
"closedLibraryDueDateManagementId": {
"type": "string",
"description": "Closed library due date management"
},
"gracePeriod": {
"type": "object",
"$ref": "period.json",
"description": "Grace period"
},
"openingTimeOffset": {
"type": "object",
"$ref": "period.json",
"description": "Opening offset time period"
},
"fixedDueDateScheduleId": {
"type": "string",
"description": "Fixed due date schedule (due date limit)"
}
}
},
"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",
"$ref": "period.json",
"description": "Alternate loan period for renewals"
},
"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",
"$ref": "period.json",
"description": "Alternate grace period for recalled items"
},
"minimumGuaranteedLoanPeriod": {
"type": "object",
"$ref": "period.json",
"description": "Minimum guaranteed loan period"
},
"recallReturnInterval": {
"type": "object",
"$ref": "period.json",
"description": "Recall return interval"
}
}
},
"holds": {
"type": "object",
"additionalProperties": false,
"properties": {
"alternateCheckoutLoanPeriod": {
"type": "object",
"$ref": "period.json",
"description": "Alternate loan period at checkout for items with active, pending hold request"
},
"renewItemsWithRequest": {
"type": "boolean",
"description": "Allow renewal of items with active, pending hold request"
},
"alternateRenewalLoanPeriod": {
"type": "object",
"$ref": "period.json",
"description": "Alternate loan period at renewal for items with active, pending hold request"
}
}
},
"pages": {
"type": "object",
"additionalProperties": false,
"properties": {
"alternateCheckoutLoanPeriod": {
"type": "object",
"$ref": "period.json",
"description": "Alternate loan period at checkout for items with active, pending page request"
},
"renewItemsWithRequest": {
"type": "boolean",
"description": "Allow renewal of items with active, pending page request"
},
"alternateRenewalLoanPeriod": {
"type": "object",
"$ref": "period.json",
"description": "Alternate loan period at renewal for items with active, pending page request"
}
}
}
}
},
"metadata": {
"$ref": "raml-util/schemas/metadata.schema",
"readonly": true
}
},
"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": "KEEP_CURRENT_DATE",
"gracePeriod": {
"duration": 7,
"intervalId": "Days"
}
},
"renewable": true,
"renewalsPolicy": {
"unlimited": true,
"renewFromId": "CURRENT_DUE_DATE",
"differentPeriod": true,
"period": {
"duration": 30,
"intervalId": "Days"
}
}
}
HTTP status code 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": "KEEP_CURRENT_DATE",
"gracePeriod": {
"duration": 7,
"intervalId": "Days"
}
},
"renewable": true,
"renewalsPolicy": {
"unlimited": true,
"renewFromId": "CURRENT_DUE_DATE",
"differentPeriod": true,
"period": {
"duration": 30,
"intervalId": "Days"
}
}
}
HTTP status code 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"
HTTP status code 401
Not authorized to perform requested action
Body
Media type: text/plain
Type: any
Example:
unable to create loan-policies -- unauthorized
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
HTTP status code 501
Not implemented yet
delete /loan-policy-storage/loan-policies
Query Parameters
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
Entity representing a loan-policy
Retrieve loan-policy item with given {loan-policyId}
Update loan-policy item with given {loan-policyId}
Delete loan-policy item with given {loan-policyId}
get /loan-policy-storage/loan-policies/{loanPolicyId}
Retrieve loan-policy item with given {loan-policyId}
URI Parameters
- loanPolicyId: required (string)
Query Parameters
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
HTTP status code 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",
"$ref": "period.json",
"description": "Loan period"
},
"closedLibraryDueDateManagementId": {
"type": "string",
"description": "Closed library due date management"
},
"gracePeriod": {
"type": "object",
"$ref": "period.json",
"description": "Grace period"
},
"openingTimeOffset": {
"type": "object",
"$ref": "period.json",
"description": "Opening offset time period"
},
"fixedDueDateScheduleId": {
"type": "string",
"description": "Fixed due date schedule (due date limit)"
}
}
},
"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",
"$ref": "period.json",
"description": "Alternate loan period for renewals"
},
"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",
"$ref": "period.json",
"description": "Alternate grace period for recalled items"
},
"minimumGuaranteedLoanPeriod": {
"type": "object",
"$ref": "period.json",
"description": "Minimum guaranteed loan period"
},
"recallReturnInterval": {
"type": "object",
"$ref": "period.json",
"description": "Recall return interval"
}
}
},
"holds": {
"type": "object",
"additionalProperties": false,
"properties": {
"alternateCheckoutLoanPeriod": {
"type": "object",
"$ref": "period.json",
"description": "Alternate loan period at checkout for items with active, pending hold request"
},
"renewItemsWithRequest": {
"type": "boolean",
"description": "Allow renewal of items with active, pending hold request"
},
"alternateRenewalLoanPeriod": {
"type": "object",
"$ref": "period.json",
"description": "Alternate loan period at renewal for items with active, pending hold request"
}
}
},
"pages": {
"type": "object",
"additionalProperties": false,
"properties": {
"alternateCheckoutLoanPeriod": {
"type": "object",
"$ref": "period.json",
"description": "Alternate loan period at checkout for items with active, pending page request"
},
"renewItemsWithRequest": {
"type": "boolean",
"description": "Allow renewal of items with active, pending page request"
},
"alternateRenewalLoanPeriod": {
"type": "object",
"$ref": "period.json",
"description": "Alternate loan period at renewal for items with active, pending page request"
}
}
}
}
},
"metadata": {
"$ref": "raml-util/schemas/metadata.schema",
"readonly": true
}
},
"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": "KEEP_CURRENT_DATE",
"gracePeriod": {
"duration": 7,
"intervalId": "Days"
}
},
"renewable": true,
"renewalsPolicy": {
"unlimited": true,
"renewFromId": "CURRENT_DUE_DATE",
"differentPeriod": true,
"period": {
"duration": 30,
"intervalId": "Days"
}
}
}
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"loan-policy not found"
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
HTTP status code 501
Not implemented yet
put /loan-policy-storage/loan-policies/{loanPolicyId}
Update loan-policy item with given {loan-policyId}
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",
"$ref": "period.json",
"description": "Loan period"
},
"closedLibraryDueDateManagementId": {
"type": "string",
"description": "Closed library due date management"
},
"gracePeriod": {
"type": "object",
"$ref": "period.json",
"description": "Grace period"
},
"openingTimeOffset": {
"type": "object",
"$ref": "period.json",
"description": "Opening offset time period"
},
"fixedDueDateScheduleId": {
"type": "string",
"description": "Fixed due date schedule (due date limit)"
}
}
},
"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",
"$ref": "period.json",
"description": "Alternate loan period for renewals"
},
"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",
"$ref": "period.json",
"description": "Alternate grace period for recalled items"
},
"minimumGuaranteedLoanPeriod": {
"type": "object",
"$ref": "period.json",
"description": "Minimum guaranteed loan period"
},
"recallReturnInterval": {
"type": "object",
"$ref": "period.json",
"description": "Recall return interval"
}
}
},
"holds": {
"type": "object",
"additionalProperties": false,
"properties": {
"alternateCheckoutLoanPeriod": {
"type": "object",
"$ref": "period.json",
"description": "Alternate loan period at checkout for items with active, pending hold request"
},
"renewItemsWithRequest": {
"type": "boolean",
"description": "Allow renewal of items with active, pending hold request"
},
"alternateRenewalLoanPeriod": {
"type": "object",
"$ref": "period.json",
"description": "Alternate loan period at renewal for items with active, pending hold request"
}
}
},
"pages": {
"type": "object",
"additionalProperties": false,
"properties": {
"alternateCheckoutLoanPeriod": {
"type": "object",
"$ref": "period.json",
"description": "Alternate loan period at checkout for items with active, pending page request"
},
"renewItemsWithRequest": {
"type": "boolean",
"description": "Allow renewal of items with active, pending page request"
},
"alternateRenewalLoanPeriod": {
"type": "object",
"$ref": "period.json",
"description": "Alternate loan period at renewal for items with active, pending page request"
}
}
}
}
},
"metadata": {
"$ref": "raml-util/schemas/metadata.schema",
"readonly": true
}
},
"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": "KEEP_CURRENT_DATE",
"gracePeriod": {
"duration": 7,
"intervalId": "Days"
}
},
"renewable": true,
"renewalsPolicy": {
"unlimited": true,
"renewFromId": "CURRENT_DUE_DATE",
"differentPeriod": true,
"period": {
"duration": 30,
"intervalId": "Days"
}
}
}
HTTP status code 204
Item successfully updated
HTTP status code 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"
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"loan-policy not found"
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
HTTP status code 501
Not implemented yet
delete /loan-policy-storage/loan-policies/{loanPolicyId}
Delete loan-policy item with given {loan-policyId}
URI Parameters
- loanPolicyId: required (string)
Query Parameters
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
HTTP status code 204
Item deleted successfully
HTTP status code 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"
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"loan-policy not found"
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
HTTP status code 501
Not implemented yet