Loan Storage (v7.1)

http://localhost:9130

Table of contents

Loan Storage API

Storage for loans

/loan-storage

GET /loan-storage/loans

Retrieve a list of loan items.

GET /loan-storage/loans
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
    
    requesterId="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 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
          },
          "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"
          },
          "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"
              }
            }
          }
        },
        "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
}

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 loans -- 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 loans -- 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-storage/loans

Create a new loan item.

POST /loan-storage/loans
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",
  "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
    },
    "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"
    },
    "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"
        }
      }
    }
  },
  "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"
}

Response 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"
}

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 -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create loans -- 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

DELETE /loan-storage/loans

DELETE /loan-storage/loans
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

POST /loan-storage/loans/anonymize/{userId}

POST /loan-storage/loans/anonymize/{userId}
URI Parameters
  • userId: required (string)

Response 204

Closed loans for this user have been anonymized

Response 400

Bad request, e.g. malformed request body or query parameter.

Body

Media type: text/plain

Type: any

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

GET /loan-storage/loans/{loanId}

Retrieve loan item with given {loanId}

GET /loan-storage/loans/{loanId}
URI Parameters
  • loanId: 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",
  "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
    },
    "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"
    },
    "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"
        }
      }
    }
  },
  "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"
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"loan 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-storage/loans/{loanId}

Update loan item with given {loanId}

PUT /loan-storage/loans/{loanId}
URI Parameters
  • loanId: 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",
  "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
    },
    "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"
    },
    "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"
        }
      }
    }
  },
  "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"
}

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 -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"loan not found"

Response 409

Optimistic locking version conflict

Body

Media type: text/plain

Type: any

Example:

version conflict

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-storage/loans/{loanId}

Delete loan item with given {loanId}

DELETE /loan-storage/loans/{loanId}
URI Parameters
  • loanId: 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 -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"loan 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

GET /loan-storage/loan-history

Retrieve a list of loan-history items.

GET /loan-storage/loan-history
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.

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

    Requested language. Optional. [lang=en]

Response 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
              },
              "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"
              },
              "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"
                  }
                }
              }
            },
            "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
}

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-history -- malformed parameter 'query', syntax error at column 6

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator