/loan-storage
Collection of loan items.
Retrieve a list of loan items.
Create a new loan item.
get /loan-storage/loans
Retrieve a list of loan items.
Query Parameters
- totalRecords: (string - default: auto - pattern: exact|estimated|none|auto)
How to calculate the totalRecords property. "exact" for the correct number, "estimated" for an estimation, "auto" to automatically select "exact" or "estimated", "none" for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords
Example:
none
- offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)
Skip over a number of elements by specifying an offset value for the query
Example:
0
- limit: (integer - default: 10 - minimum: 0 - maximum: 2147483647)
Limit the number of elements returned in the response. Using limit=0 will return totalRecords with the exact value. For details about totalRecords see https://github.com/folio-org/raml-module-builder#estimated-totalrecords
Example:
10
- query: (string)
A query expressed as a CQL string (see dev.folio.org/reference/glossary#cql) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.
searchable using CQL
Example:
(username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode userId=="cf23adf0-61ba-4887-bf82-956c4aae2260"
HTTP status code 200
Returns a list of loan items
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Collection of loans",
"type": "object",
"properties": {
"loans": {
"description": "List of loan items",
"id": "loans",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Loan",
"description": "Links the item with the patron and applies certain conditions based on policies",
"properties": {
"id": {
"description": "Unique ID (generated UUID) of the loan",
"type": "string"
},
"userId": {
"description": "ID of the patron the item was lent to. Required for open loans, not required for closed loans (for anonymization).",
"type": "string"
},
"proxyUserId": {
"description": "ID of the user representing a proxy for the patron",
"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}$"
},
"itemId": {
"description": "ID of the item lent to the patron",
"type": "string"
},
"itemEffectiveLocationIdAtCheckOut": {
"description": "The effective location, at the time of checkout, of the item loaned to the patron.",
"type": "string",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"status": {
"description": "Overall status of the loan",
"type": "object",
"properties": {
"name": {
"description": "Name of the status (currently can be any value, values commonly used are Open and Closed)",
"type": "string"
}
},
"additionalProperties": false
},
"forUseAtLocation": {
"description": "Status of loan/item that is to be used in the library, i.e. in a reading room",
"type": "object",
"properties": {
"status": {
"description": "Indicates if the item is currently used by or being held for the patron",
"type": "string",
"enum": [
"In use",
"Held",
"Returned"
]
},
"statusDate": {
"description": "Date and time the status was registered",
"type": "string",
"format": "date-time"
},
"holdShelfExpirationDate": {
"description": "Date when a held item expires",
"type": "string",
"format": "date-time"
}
}
},
"loanDate": {
"description": "Date time when the loan began (typically represented according to rfc3339 section-5.6. Has not had the date-time format validation applied as was not supported at point of introduction and would now be a breaking change)",
"type": "string"
},
"dueDate": {
"description": "Date time when the item is due to be returned",
"type": "string",
"format": "date-time"
},
"returnDate": {
"description": "Date time when the item is returned and the loan ends (typically represented according to rfc3339 section-5.6. Has not had the date-time format validation applied as was not supported at point of introduction and would now be a breaking change)",
"type": "string"
},
"systemReturnDate": {
"description": "Date time when the returned item is actually processed",
"type": "string",
"format": "date-time"
},
"action": {
"description": "Last action performed on a loan (currently can be any value, values commonly used are checkedout and checkedin)",
"type": "string"
},
"actionComment": {
"description": "Comment to last action performed on a loan",
"type": "string"
},
"itemStatus": {
"description": "Last item status used in relation to this loan (currently can be any value, values commonly used are Checked out and Available)",
"type": "string"
},
"renewalCount": {
"description": "Count of how many times a loan has been renewed (incremented by the client)",
"type": "integer"
},
"loanPolicyId": {
"description": "ID of last policy used in relation to this loan",
"type": "string"
},
"checkoutServicePointId": {
"description": "ID of the Service Point where the last checkout occured",
"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}$",
"type": "string"
},
"checkinServicePointId": {
"description": "ID of the Service Point where the last checkin occured",
"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}$",
"type": "string"
},
"patronGroupIdAtCheckout": {
"description": "Patron Group Id at checkout",
"type": "string"
},
"dueDateChangedByRecall": {
"description": "Indicates whether or not this loan had its due date modified by a recall on the loaned item",
"type": "boolean"
},
"isDcb": {
"description": "Indicates whether or not this loan is associated for DCB use case",
"type": "boolean"
},
"declaredLostDate": {
"description": "Date and time the item was declared lost during this loan",
"type": "string",
"format": "date-time"
},
"claimedReturnedDate": {
"description": "Date and time the item was claimed returned for this loan",
"type": "string",
"format": "date-time"
},
"overdueFinePolicyId": {
"description": "ID of overdue fines policy at the time the item is check-in or renewed",
"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}$",
"type": "string"
},
"lostItemPolicyId": {
"description": "ID of lost item policy which determines when the item ages to lost and the associated fees or the associated fees if the patron declares the item lost.",
"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}$",
"type": "string"
},
"metadata": {
"description": "Metadata about creation and changes to loan, provided by the server (client should not provide)",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"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"
]
},
"agedToLostDelayedBilling": {
"description": "Aged to Lost Delayed Billing processing",
"type": "object",
"properties": {
"lostItemHasBeenBilled": {
"description": "Indicates if the aged to lost fee has been billed (for use where delayed billing is set up)",
"type": "boolean"
},
"dateLostItemShouldBeBilled": {
"description": "Indicates when the aged to lost fee should be billed (for use where delayed billing is set up)",
"type": "string",
"format": "date-time"
},
"agedToLostDate": {
"description": "Date and time the item was aged to lost for this loan",
"type": "string",
"format": "date-time"
}
}
},
"reminders": {
"description": "Information about reminders for overdue loan",
"type": "object",
"properties": {
"lastFeeBilled": {
"description": "Information about the most recent reminder fee billing",
"type": "object",
"properties": {
"number": {
"description": "Last reminder fee billed, sequence number",
"type": "integer"
},
"date": {
"description": "Last reminder fee billed, date",
"type": "string",
"format": "date-time"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false,
"required": [
"itemId",
"loanDate",
"action"
]
}
},
"totalRecords": {
"type": "integer"
}
},
"required": [
"loans",
"totalRecords"
]
}
Example:
{
"loans": [
{
"id": "cf23adf0-61ba-4887-bf82-956c4aae2260",
"userId": "df7f4993-8c14-4a0f-ab63-93975ab01c76",
"proxyUserId": "346ad017-dac1-417d-9ed8-0ac7eeb886aa",
"itemId": "cb20f34f-b773-462f-a091-b233cc96b9e6",
"loanDate": "2017-03-01T22:34:11-04:00",
"dueDate": "2017-04-15T22:34:11-04:00",
"status": {
"name": "Open"
},
"action": "renewed",
"itemStatus": "Checked out",
"renewalCount": 1
},
{
"id": "1d09af65-aeaa-499c-80cb-d52847b75a60",
"userId": "15054e48-03e8-4ed5-810b-7192b86accab",
"itemId": "94838fa2-288a-45c2-ad19-9102f5645127",
"loanDate": "2017-01-14T19:14:36-01:00",
"dueDate": "2017-01-29T19:14:36+00:00",
"returnDate": "2017-01-16T09:15:23-01:00",
"status": {
"name": "Closed"
},
"action": "checkedin",
"itemStatus": "Available"
}
],
"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 loans -- 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 loans -- 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-storage/loans
Create a new loan item.
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"title": "Loan",
"description": "Links the item with the patron and applies certain conditions based on policies",
"properties": {
"id": {
"description": "Unique ID (generated UUID) of the loan",
"type": "string"
},
"userId": {
"description": "ID of the patron the item was lent to. Required for open loans, not required for closed loans (for anonymization).",
"type": "string"
},
"proxyUserId": {
"description": "ID of the user representing a proxy for the patron",
"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}$"
},
"itemId": {
"description": "ID of the item lent to the patron",
"type": "string"
},
"itemEffectiveLocationIdAtCheckOut": {
"description": "The effective location, at the time of checkout, of the item loaned to the patron.",
"type": "string",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"status": {
"description": "Overall status of the loan",
"type": "object",
"properties": {
"name": {
"description": "Name of the status (currently can be any value, values commonly used are Open and Closed)",
"type": "string"
}
},
"additionalProperties": false
},
"forUseAtLocation": {
"description": "Status of loan/item that is to be used in the library, i.e. in a reading room",
"type": "object",
"properties": {
"status": {
"description": "Indicates if the item is currently used by or being held for the patron",
"type": "string",
"enum": [
"In use",
"Held",
"Returned"
]
},
"statusDate": {
"description": "Date and time the status was registered",
"type": "string",
"format": "date-time"
},
"holdShelfExpirationDate": {
"description": "Date when a held item expires",
"type": "string",
"format": "date-time"
}
}
},
"loanDate": {
"description": "Date time when the loan began (typically represented according to rfc3339 section-5.6. Has not had the date-time format validation applied as was not supported at point of introduction and would now be a breaking change)",
"type": "string"
},
"dueDate": {
"description": "Date time when the item is due to be returned",
"type": "string",
"format": "date-time"
},
"returnDate": {
"description": "Date time when the item is returned and the loan ends (typically represented according to rfc3339 section-5.6. Has not had the date-time format validation applied as was not supported at point of introduction and would now be a breaking change)",
"type": "string"
},
"systemReturnDate": {
"description": "Date time when the returned item is actually processed",
"type": "string",
"format": "date-time"
},
"action": {
"description": "Last action performed on a loan (currently can be any value, values commonly used are checkedout and checkedin)",
"type": "string"
},
"actionComment": {
"description": "Comment to last action performed on a loan",
"type": "string"
},
"itemStatus": {
"description": "Last item status used in relation to this loan (currently can be any value, values commonly used are Checked out and Available)",
"type": "string"
},
"renewalCount": {
"description": "Count of how many times a loan has been renewed (incremented by the client)",
"type": "integer"
},
"loanPolicyId": {
"description": "ID of last policy used in relation to this loan",
"type": "string"
},
"checkoutServicePointId": {
"description": "ID of the Service Point where the last checkout occured",
"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}$",
"type": "string"
},
"checkinServicePointId": {
"description": "ID of the Service Point where the last checkin occured",
"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}$",
"type": "string"
},
"patronGroupIdAtCheckout": {
"description": "Patron Group Id at checkout",
"type": "string"
},
"dueDateChangedByRecall": {
"description": "Indicates whether or not this loan had its due date modified by a recall on the loaned item",
"type": "boolean"
},
"isDcb": {
"description": "Indicates whether or not this loan is associated for DCB use case",
"type": "boolean"
},
"declaredLostDate": {
"description": "Date and time the item was declared lost during this loan",
"type": "string",
"format": "date-time"
},
"claimedReturnedDate": {
"description": "Date and time the item was claimed returned for this loan",
"type": "string",
"format": "date-time"
},
"overdueFinePolicyId": {
"description": "ID of overdue fines policy at the time the item is check-in or renewed",
"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}$",
"type": "string"
},
"lostItemPolicyId": {
"description": "ID of lost item policy which determines when the item ages to lost and the associated fees or the associated fees if the patron declares the item lost.",
"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}$",
"type": "string"
},
"metadata": {
"description": "Metadata about creation and changes to loan, provided by the server (client should not provide)",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"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"
]
},
"agedToLostDelayedBilling": {
"description": "Aged to Lost Delayed Billing processing",
"type": "object",
"properties": {
"lostItemHasBeenBilled": {
"description": "Indicates if the aged to lost fee has been billed (for use where delayed billing is set up)",
"type": "boolean"
},
"dateLostItemShouldBeBilled": {
"description": "Indicates when the aged to lost fee should be billed (for use where delayed billing is set up)",
"type": "string",
"format": "date-time"
},
"agedToLostDate": {
"description": "Date and time the item was aged to lost for this loan",
"type": "string",
"format": "date-time"
}
}
},
"reminders": {
"description": "Information about reminders for overdue loan",
"type": "object",
"properties": {
"lastFeeBilled": {
"description": "Information about the most recent reminder fee billing",
"type": "object",
"properties": {
"number": {
"description": "Last reminder fee billed, sequence number",
"type": "integer"
},
"date": {
"description": "Last reminder fee billed, date",
"type": "string",
"format": "date-time"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false,
"required": [
"itemId",
"loanDate",
"action"
]
}
Example:
{
"id": "cf23adf0-61ba-4887-bf82-956c4aae2260",
"userId": "df7f4993-8c14-4a0f-ab63-93975ab01c76",
"proxyUserId": "346ad017-dac1-417d-9ed8-0ac7eeb886aa",
"itemId": "cb20f34f-b773-462f-a091-b233cc96b9e6",
"loanDate": "2017-03-01T23:11:00-01:00",
"dueDate": "2017-03-15T23:11:00-01:00",
"itemEffectiveLocationIdAtCheckOut": "07f83048-6737-4c6a-a3bc-c49cd9beaa38",
"checkoutServicePointId": "8bb53832-c9fb-47ef-986d-5b1a498a8b30",
"checkinServicePointId": "8bb53832-c9fb-47ef-986d-5b1a498a8b30",
"status": {
"name": "Open"
},
"action": "checkedout",
"itemStatus": "Checked out",
"renewalCount": 0,
"overdueFinePolicyId": "27b56832-c9fb-47ef-986d-5b1a498a8b89",
"lostItemPolicyId": "82b53832-c9fb-47ef-986j-5b1a498a8b61"
}
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 item
Body
Media type: application/json
Type: any
Example:
{
"id": "cf23adf0-61ba-4887-bf82-956c4aae2260",
"userId": "df7f4993-8c14-4a0f-ab63-93975ab01c76",
"proxyUserId": "346ad017-dac1-417d-9ed8-0ac7eeb886aa",
"itemId": "cb20f34f-b773-462f-a091-b233cc96b9e6",
"loanDate": "2017-03-01T23:11:00-01:00",
"dueDate": "2017-03-15T23:11:00-01:00",
"itemEffectiveLocationIdAtCheckOut": "07f83048-6737-4c6a-a3bc-c49cd9beaa38",
"checkoutServicePointId": "8bb53832-c9fb-47ef-986d-5b1a498a8b30",
"checkinServicePointId": "8bb53832-c9fb-47ef-986d-5b1a498a8b30",
"status": {
"name": "Open"
},
"action": "checkedout",
"itemStatus": "Checked out",
"renewalCount": 0,
"overdueFinePolicyId": "27b56832-c9fb-47ef-986d-5b1a498a8b89",
"lostItemPolicyId": "82b53832-c9fb-47ef-986j-5b1a498a8b61"
}
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 -- 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 loans -- unauthorized
HTTP status code 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"
}
]
}
]
}
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
delete /loan-storage/loans
Query Parameters
- 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.
CQL to select loans to delete, use cql.allRecords=1 to delete all
Example:
(username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode itemEffectiveLocationIdAtCheckOut=="fcd64ce1-6995-48f0-840e-89ffa2288371"
HTTP status code 204
Loans deleted
HTTP status code 400
Bad request, e.g. malformed query parameter
Body
Media type: text/plain
Type: any
Example:
query parameter is empty
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
post /loan-storage/loans/anonymize/{userId}
URI Parameters
- userId: required(string)
HTTP status code 204
Closed loans for this user have been anonymized
HTTP status code 400
Bad request, e.g. malformed request body or query parameter.
Body
Media type: text/plain
Type: any
HTTP status code 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"
}
]
}
]
}
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
Entity representing a loan
Retrieve loan item with given {loanId}
Update loan item with given {loanId}
Delete loan item with given {loanId}
get /loan-storage/loans/{loanId}
Retrieve loan item with given {loanId}
URI Parameters
- loanId: required(string)
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",
"title": "Loan",
"description": "Links the item with the patron and applies certain conditions based on policies",
"properties": {
"id": {
"description": "Unique ID (generated UUID) of the loan",
"type": "string"
},
"userId": {
"description": "ID of the patron the item was lent to. Required for open loans, not required for closed loans (for anonymization).",
"type": "string"
},
"proxyUserId": {
"description": "ID of the user representing a proxy for the patron",
"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}$"
},
"itemId": {
"description": "ID of the item lent to the patron",
"type": "string"
},
"itemEffectiveLocationIdAtCheckOut": {
"description": "The effective location, at the time of checkout, of the item loaned to the patron.",
"type": "string",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"status": {
"description": "Overall status of the loan",
"type": "object",
"properties": {
"name": {
"description": "Name of the status (currently can be any value, values commonly used are Open and Closed)",
"type": "string"
}
},
"additionalProperties": false
},
"forUseAtLocation": {
"description": "Status of loan/item that is to be used in the library, i.e. in a reading room",
"type": "object",
"properties": {
"status": {
"description": "Indicates if the item is currently used by or being held for the patron",
"type": "string",
"enum": [
"In use",
"Held",
"Returned"
]
},
"statusDate": {
"description": "Date and time the status was registered",
"type": "string",
"format": "date-time"
},
"holdShelfExpirationDate": {
"description": "Date when a held item expires",
"type": "string",
"format": "date-time"
}
}
},
"loanDate": {
"description": "Date time when the loan began (typically represented according to rfc3339 section-5.6. Has not had the date-time format validation applied as was not supported at point of introduction and would now be a breaking change)",
"type": "string"
},
"dueDate": {
"description": "Date time when the item is due to be returned",
"type": "string",
"format": "date-time"
},
"returnDate": {
"description": "Date time when the item is returned and the loan ends (typically represented according to rfc3339 section-5.6. Has not had the date-time format validation applied as was not supported at point of introduction and would now be a breaking change)",
"type": "string"
},
"systemReturnDate": {
"description": "Date time when the returned item is actually processed",
"type": "string",
"format": "date-time"
},
"action": {
"description": "Last action performed on a loan (currently can be any value, values commonly used are checkedout and checkedin)",
"type": "string"
},
"actionComment": {
"description": "Comment to last action performed on a loan",
"type": "string"
},
"itemStatus": {
"description": "Last item status used in relation to this loan (currently can be any value, values commonly used are Checked out and Available)",
"type": "string"
},
"renewalCount": {
"description": "Count of how many times a loan has been renewed (incremented by the client)",
"type": "integer"
},
"loanPolicyId": {
"description": "ID of last policy used in relation to this loan",
"type": "string"
},
"checkoutServicePointId": {
"description": "ID of the Service Point where the last checkout occured",
"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}$",
"type": "string"
},
"checkinServicePointId": {
"description": "ID of the Service Point where the last checkin occured",
"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}$",
"type": "string"
},
"patronGroupIdAtCheckout": {
"description": "Patron Group Id at checkout",
"type": "string"
},
"dueDateChangedByRecall": {
"description": "Indicates whether or not this loan had its due date modified by a recall on the loaned item",
"type": "boolean"
},
"isDcb": {
"description": "Indicates whether or not this loan is associated for DCB use case",
"type": "boolean"
},
"declaredLostDate": {
"description": "Date and time the item was declared lost during this loan",
"type": "string",
"format": "date-time"
},
"claimedReturnedDate": {
"description": "Date and time the item was claimed returned for this loan",
"type": "string",
"format": "date-time"
},
"overdueFinePolicyId": {
"description": "ID of overdue fines policy at the time the item is check-in or renewed",
"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}$",
"type": "string"
},
"lostItemPolicyId": {
"description": "ID of lost item policy which determines when the item ages to lost and the associated fees or the associated fees if the patron declares the item lost.",
"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}$",
"type": "string"
},
"metadata": {
"description": "Metadata about creation and changes to loan, provided by the server (client should not provide)",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"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"
]
},
"agedToLostDelayedBilling": {
"description": "Aged to Lost Delayed Billing processing",
"type": "object",
"properties": {
"lostItemHasBeenBilled": {
"description": "Indicates if the aged to lost fee has been billed (for use where delayed billing is set up)",
"type": "boolean"
},
"dateLostItemShouldBeBilled": {
"description": "Indicates when the aged to lost fee should be billed (for use where delayed billing is set up)",
"type": "string",
"format": "date-time"
},
"agedToLostDate": {
"description": "Date and time the item was aged to lost for this loan",
"type": "string",
"format": "date-time"
}
}
},
"reminders": {
"description": "Information about reminders for overdue loan",
"type": "object",
"properties": {
"lastFeeBilled": {
"description": "Information about the most recent reminder fee billing",
"type": "object",
"properties": {
"number": {
"description": "Last reminder fee billed, sequence number",
"type": "integer"
},
"date": {
"description": "Last reminder fee billed, date",
"type": "string",
"format": "date-time"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false,
"required": [
"itemId",
"loanDate",
"action"
]
}
Example:
{
"id": "cf23adf0-61ba-4887-bf82-956c4aae2260",
"userId": "df7f4993-8c14-4a0f-ab63-93975ab01c76",
"proxyUserId": "346ad017-dac1-417d-9ed8-0ac7eeb886aa",
"itemId": "cb20f34f-b773-462f-a091-b233cc96b9e6",
"loanDate": "2017-03-01T23:11:00-01:00",
"dueDate": "2017-03-15T23:11:00-01:00",
"itemEffectiveLocationIdAtCheckOut": "07f83048-6737-4c6a-a3bc-c49cd9beaa38",
"checkoutServicePointId": "8bb53832-c9fb-47ef-986d-5b1a498a8b30",
"checkinServicePointId": "8bb53832-c9fb-47ef-986d-5b1a498a8b30",
"status": {
"name": "Open"
},
"action": "checkedout",
"itemStatus": "Checked out",
"renewalCount": 0,
"overdueFinePolicyId": "27b56832-c9fb-47ef-986d-5b1a498a8b89",
"lostItemPolicyId": "82b53832-c9fb-47ef-986j-5b1a498a8b61"
}
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"loan 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-storage/loans/{loanId}
Update loan item with given {loanId}
URI Parameters
- loanId: required(string)
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"title": "Loan",
"description": "Links the item with the patron and applies certain conditions based on policies",
"properties": {
"id": {
"description": "Unique ID (generated UUID) of the loan",
"type": "string"
},
"userId": {
"description": "ID of the patron the item was lent to. Required for open loans, not required for closed loans (for anonymization).",
"type": "string"
},
"proxyUserId": {
"description": "ID of the user representing a proxy for the patron",
"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}$"
},
"itemId": {
"description": "ID of the item lent to the patron",
"type": "string"
},
"itemEffectiveLocationIdAtCheckOut": {
"description": "The effective location, at the time of checkout, of the item loaned to the patron.",
"type": "string",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"status": {
"description": "Overall status of the loan",
"type": "object",
"properties": {
"name": {
"description": "Name of the status (currently can be any value, values commonly used are Open and Closed)",
"type": "string"
}
},
"additionalProperties": false
},
"forUseAtLocation": {
"description": "Status of loan/item that is to be used in the library, i.e. in a reading room",
"type": "object",
"properties": {
"status": {
"description": "Indicates if the item is currently used by or being held for the patron",
"type": "string",
"enum": [
"In use",
"Held",
"Returned"
]
},
"statusDate": {
"description": "Date and time the status was registered",
"type": "string",
"format": "date-time"
},
"holdShelfExpirationDate": {
"description": "Date when a held item expires",
"type": "string",
"format": "date-time"
}
}
},
"loanDate": {
"description": "Date time when the loan began (typically represented according to rfc3339 section-5.6. Has not had the date-time format validation applied as was not supported at point of introduction and would now be a breaking change)",
"type": "string"
},
"dueDate": {
"description": "Date time when the item is due to be returned",
"type": "string",
"format": "date-time"
},
"returnDate": {
"description": "Date time when the item is returned and the loan ends (typically represented according to rfc3339 section-5.6. Has not had the date-time format validation applied as was not supported at point of introduction and would now be a breaking change)",
"type": "string"
},
"systemReturnDate": {
"description": "Date time when the returned item is actually processed",
"type": "string",
"format": "date-time"
},
"action": {
"description": "Last action performed on a loan (currently can be any value, values commonly used are checkedout and checkedin)",
"type": "string"
},
"actionComment": {
"description": "Comment to last action performed on a loan",
"type": "string"
},
"itemStatus": {
"description": "Last item status used in relation to this loan (currently can be any value, values commonly used are Checked out and Available)",
"type": "string"
},
"renewalCount": {
"description": "Count of how many times a loan has been renewed (incremented by the client)",
"type": "integer"
},
"loanPolicyId": {
"description": "ID of last policy used in relation to this loan",
"type": "string"
},
"checkoutServicePointId": {
"description": "ID of the Service Point where the last checkout occured",
"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}$",
"type": "string"
},
"checkinServicePointId": {
"description": "ID of the Service Point where the last checkin occured",
"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}$",
"type": "string"
},
"patronGroupIdAtCheckout": {
"description": "Patron Group Id at checkout",
"type": "string"
},
"dueDateChangedByRecall": {
"description": "Indicates whether or not this loan had its due date modified by a recall on the loaned item",
"type": "boolean"
},
"isDcb": {
"description": "Indicates whether or not this loan is associated for DCB use case",
"type": "boolean"
},
"declaredLostDate": {
"description": "Date and time the item was declared lost during this loan",
"type": "string",
"format": "date-time"
},
"claimedReturnedDate": {
"description": "Date and time the item was claimed returned for this loan",
"type": "string",
"format": "date-time"
},
"overdueFinePolicyId": {
"description": "ID of overdue fines policy at the time the item is check-in or renewed",
"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}$",
"type": "string"
},
"lostItemPolicyId": {
"description": "ID of lost item policy which determines when the item ages to lost and the associated fees or the associated fees if the patron declares the item lost.",
"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}$",
"type": "string"
},
"metadata": {
"description": "Metadata about creation and changes to loan, provided by the server (client should not provide)",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"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"
]
},
"agedToLostDelayedBilling": {
"description": "Aged to Lost Delayed Billing processing",
"type": "object",
"properties": {
"lostItemHasBeenBilled": {
"description": "Indicates if the aged to lost fee has been billed (for use where delayed billing is set up)",
"type": "boolean"
},
"dateLostItemShouldBeBilled": {
"description": "Indicates when the aged to lost fee should be billed (for use where delayed billing is set up)",
"type": "string",
"format": "date-time"
},
"agedToLostDate": {
"description": "Date and time the item was aged to lost for this loan",
"type": "string",
"format": "date-time"
}
}
},
"reminders": {
"description": "Information about reminders for overdue loan",
"type": "object",
"properties": {
"lastFeeBilled": {
"description": "Information about the most recent reminder fee billing",
"type": "object",
"properties": {
"number": {
"description": "Last reminder fee billed, sequence number",
"type": "integer"
},
"date": {
"description": "Last reminder fee billed, date",
"type": "string",
"format": "date-time"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false,
"required": [
"itemId",
"loanDate",
"action"
]
}
Example:
{
"id": "cf23adf0-61ba-4887-bf82-956c4aae2260",
"userId": "df7f4993-8c14-4a0f-ab63-93975ab01c76",
"proxyUserId": "346ad017-dac1-417d-9ed8-0ac7eeb886aa",
"itemId": "cb20f34f-b773-462f-a091-b233cc96b9e6",
"loanDate": "2017-03-01T23:11:00-01:00",
"dueDate": "2017-03-15T23:11:00-01:00",
"itemEffectiveLocationIdAtCheckOut": "07f83048-6737-4c6a-a3bc-c49cd9beaa38",
"checkoutServicePointId": "8bb53832-c9fb-47ef-986d-5b1a498a8b30",
"checkinServicePointId": "8bb53832-c9fb-47ef-986d-5b1a498a8b30",
"status": {
"name": "Open"
},
"action": "checkedout",
"itemStatus": "Checked out",
"renewalCount": 0,
"overdueFinePolicyId": "27b56832-c9fb-47ef-986d-5b1a498a8b89",
"lostItemPolicyId": "82b53832-c9fb-47ef-986j-5b1a498a8b61"
}
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 -- 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 not found"
HTTP status code 409
Optimistic locking version conflict
Body
Media type: text/plain
Type: any
Example:
version conflict
HTTP status code 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"
}
]
}
]
}
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-storage/loans/{loanId}
Delete loan item with given {loanId}
URI Parameters
- loanId: required(string)
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 -- constraint violation"
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"loan 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
Collection of loan-history items.
Retrieve a list of loan-history items.
get /loan-storage/loan-history
Retrieve a list of loan-history items.
Query Parameters
- totalRecords: (string - default: auto - pattern: exact|estimated|none|auto)
How to calculate the totalRecords property. "exact" for the correct number, "estimated" for an estimation, "auto" to automatically select "exact" or "estimated", "none" for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords
Example:
none
- offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)
Skip over a number of elements by specifying an offset value for the query
Example:
0
- limit: (integer - default: 10 - minimum: 0 - maximum: 2147483647)
Limit the number of elements returned in the response. Using limit=0 will return totalRecords with the exact value. For details about totalRecords see https://github.com/folio-org/raml-module-builder#estimated-totalrecords
Example:
10
- query: (string)
A query expressed as a CQL string (see dev.folio.org/reference/glossary#cql) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.
using CQL
Example:
(username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode loan.status.name==Closed
HTTP status code 200
Returns a list of loan-history items
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Collection of loan history items",
"type": "object",
"properties": {
"loansHistory": {
"description": "List of loan history items",
"id": "loansHistory",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A snapshot of a loan record",
"properties": {
"id": {
"description": "Unique ID (generated UUID) of the snapshot of the loan record",
"type": "string"
},
"operation": {
"description": "Type of change that triggered this loan record snapshot: I for insert, U for update, D for delete",
"type": "string"
},
"creationDate": {
"description": "When this snapshot was created",
"type": "string"
},
"loan": {
"description": "The snapshot of the loan record",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Loan",
"properties": {
"id": {
"description": "Unique ID (generated UUID) of the loan",
"type": "string"
},
"userId": {
"description": "ID of the patron the item was lent to. Required for open loans, not required for closed loans (for anonymization).",
"type": "string"
},
"proxyUserId": {
"description": "ID of the user representing a proxy for the patron",
"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}$"
},
"itemId": {
"description": "ID of the item lent to the patron",
"type": "string"
},
"itemEffectiveLocationIdAtCheckOut": {
"description": "The effective location, at the time of checkout, of the item loaned to the patron.",
"type": "string",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"status": {
"description": "Overall status of the loan",
"type": "object",
"properties": {
"name": {
"description": "Name of the status (currently can be any value, values commonly used are Open and Closed)",
"type": "string"
}
},
"additionalProperties": false
},
"forUseAtLocation": {
"description": "Status of loan/item that is to be used in the library, i.e. in a reading room",
"type": "object",
"properties": {
"status": {
"description": "Indicates if the item is currently used by or being held for the patron",
"type": "string",
"enum": [
"In use",
"Held",
"Returned"
]
},
"statusDate": {
"description": "Date and time the status was registered",
"type": "string",
"format": "date-time"
},
"holdShelfExpirationDate": {
"description": "Date when a held item expires",
"type": "string",
"format": "date-time"
}
}
},
"loanDate": {
"description": "Date time when the loan began (typically represented according to rfc3339 section-5.6. Has not had the date-time format validation applied as was not supported at point of introduction and would now be a breaking change)",
"type": "string"
},
"dueDate": {
"description": "Date time when the item is due to be returned",
"type": "string",
"format": "date-time"
},
"returnDate": {
"description": "Date time when the item is returned and the loan ends (typically represented according to rfc3339 section-5.6. Has not had the date-time format validation applied as was not supported at point of introduction and would now be a breaking change)",
"type": "string"
},
"systemReturnDate": {
"description": "Date time when the returned item is actually processed",
"type": "string",
"format": "date-time"
},
"action": {
"description": "Last action performed on a loan (currently can be any value, values commonly used are checkedout and checkedin)",
"type": "string"
},
"actionComment": {
"description": "Comment to last action performed on a loan",
"type": "string"
},
"itemStatus": {
"description": "Last item status used in relation to this loan (currently can be any value, values commonly used are Checked out and Available)",
"type": "string"
},
"renewalCount": {
"description": "Count of how many times a loan has been renewed (incremented by the client)",
"type": "integer"
},
"loanPolicyId": {
"description": "ID of last policy used in relation to this loan",
"type": "string"
},
"checkoutServicePointId": {
"description": "ID of the Service Point where the last checkout occured",
"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}$",
"type": "string"
},
"checkinServicePointId": {
"description": "ID of the Service Point where the last checkin occured",
"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}$",
"type": "string"
},
"patronGroupIdAtCheckout": {
"description": "Patron Group Id at checkout",
"type": "string"
},
"dueDateChangedByRecall": {
"description": "Indicates whether or not this loan had its due date modified by a recall on the loaned item",
"type": "boolean"
},
"isDcb": {
"description": "Indicates whether or not this loan is associated for DCB use case",
"type": "boolean"
},
"declaredLostDate": {
"description": "Date and time the item was declared lost during this loan",
"type": "string",
"format": "date-time"
},
"claimedReturnedDate": {
"description": "Date and time the item was claimed returned for this loan",
"type": "string",
"format": "date-time"
},
"overdueFinePolicyId": {
"description": "ID of overdue fines policy at the time the item is check-in or renewed",
"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}$",
"type": "string"
},
"lostItemPolicyId": {
"description": "ID of lost item policy which determines when the item ages to lost and the associated fees or the associated fees if the patron declares the item lost.",
"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}$",
"type": "string"
},
"metadata": {
"description": "Metadata about creation and changes to loan, provided by the server (client should not provide)",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"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"
]
},
"agedToLostDelayedBilling": {
"description": "Aged to Lost Delayed Billing processing",
"type": "object",
"properties": {
"lostItemHasBeenBilled": {
"description": "Indicates if the aged to lost fee has been billed (for use where delayed billing is set up)",
"type": "boolean"
},
"dateLostItemShouldBeBilled": {
"description": "Indicates when the aged to lost fee should be billed (for use where delayed billing is set up)",
"type": "string",
"format": "date-time"
},
"agedToLostDate": {
"description": "Date and time the item was aged to lost for this loan",
"type": "string",
"format": "date-time"
}
}
},
"reminders": {
"description": "Information about reminders for overdue loan",
"type": "object",
"properties": {
"lastFeeBilled": {
"description": "Information about the most recent reminder fee billing",
"type": "object",
"properties": {
"number": {
"description": "Last reminder fee billed, sequence number",
"type": "integer"
},
"date": {
"description": "Last reminder fee billed, date",
"type": "string",
"format": "date-time"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false,
"required": [
"itemId",
"loanDate",
"action"
]
}
},
"required": [
"id",
"operation",
"creationDate",
"loan"
]
}
},
"totalRecords": {
"type": "integer"
}
},
"required": [
"loansHistory",
"totalRecords"
]
}
Example:
{
"loansHistory": [
{
"id": "29abc628-3712-48ba-b01f-f8b00c15dd61",
"operation": "I",
"createdDate": "2017-03-01T22:34:11+00",
"loan": {
"id": "cf23adf0-61ba-4887-bf82-956c4aae2260",
"userId": "df7f4993-8c14-4a0f-ab63-93975ab01c76",
"proxyUserId": "346ad017-dac1-417d-9ed8-0ac7eeb886aa",
"itemId": "cb20f34f-b773-462f-a091-b233cc96b9e6",
"loanDate": "2017-03-01T22:34:11+00:00",
"dueDate": "2017-04-15T22:34:11+00:00",
"status": {
"name": "Open"
},
"action": "renewed",
"itemStatus": "Checked out",
"renewalCount": 1
}
},
{
"id": "30f18231-3712-48ba-b01f-f8b00c15d333",
"operation": "I",
"createdDate": "2017-01-16T09:15:23+00",
"loan": {
"id": "1d09af65-aeaa-499c-80cb-d52847b75a60",
"userId": "15054e48-03e8-4ed5-810b-7192b86accab",
"itemId": "94838fa2-288a-45c2-ad19-9102f5645127",
"loanDate": "2017-01-14T19:14:36+00:00",
"dueDate": "2017-01-29T19:14:36+00:00",
"returnDate": "2017-01-16T09:15:23+00:00",
"status": {
"name": "Closed"
},
"action": "checkedin",
"itemStatus": "Available"
}
}
],
"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-history -- malformed parameter 'query', syntax error at column 6
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