Circulation (v7.7)

http://localhost:9130

Table of contents

Circulation Business Logic API

API for loans and requests

/circulation

POST /circulation/check-out-by-barcode

Creates a loan by checking out an item to a loanee

POST /circulation/check-out-by-barcode
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Request to check out an item to a loanee using barcodes",
  "properties": {
    "itemBarcode": {
      "description": "Barcode of the item to be lent to the patron",
      "type": "string"
    },
    "userBarcode": {
      "description": "Barcode of the user (representing the patron) the item is to be lent to",
      "type": "string"
    },
    "proxyUserBarcode": {
      "description": "Barcode of the user representing a proxy for the patron",
      "type": "string"
    },
    "loanDate": {
      "description": "When the loan is to begin, defaults to current date and time",
      "type": "string",
      "format": "date-time"
    },
    "servicePointId": {
      "description": "Service point where the item has been checked out",
      "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}$"
    }
  },
  "required": [
    "itemBarcode",
    "userBarcode",
    "servicePointId"
  ]
}

Example:

{
  "userBarcode": "466983136459401",
  "proxyUserBarcode": "693750137582350",
  "itemBarcode": "2887532577331",
  "servicePointId": "3260a6f0-0b53-4d9c-ad74-2dba3830d69f"
}

Response 201

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"
    },
    "borrower": {
      "description": "Additional information about the borrower of the item, taken from the user referred to by the userId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode used to identify the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        }
       },
      "additionalProperties": false
    },
    "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"
    },
    "loanPolicyId": {
      "description": "ID of last policy used in relation to this loan",
      "type": "string"
    },
    "loanPolicy": {
      "description": "Additional information about the loan policy of the item, taken from the loan loanPolicyId",
      "readonly": true,
      "type": "object",
      "properties": {
        "name": {
          "readonly": true,
          "description": "Name of last policy used in relation to this loan (read only, defined by the server)",
          "type": "string"
        }
      }
    },
    "item": {
      "description": "Additional information about the item",
      "type": "object",
      "properties": {
        "id": {
          "description": "ID of the item",
          "type": "string"
        },
        "title": {
          "description": "The title of the item lent to the patron",
          "type": "string"
        },
        "callNumber" : {
          "description" : "The call number from the holdings record",
          "type": "string"
        },
        "materialType": {
          "description": "The material type from the item record",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the material type",
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "contributors": {
            "description": "Contributors from the instance record",
            "type": "array",
            "items" : {
              "type": "object",
              "properties" : {
                 "name" : {
                    "description": "Name of the contributor",
                    "type" : "string"
                  }
              },
              "additionalProperties": false
          }
        },
        "holdingsRecordId": {
          "description": "The ID of the holdings for the item",
          "type": "string"
        },
        "instanceId": {
          "description": "The ID of the instance for the item",
          "type": "string"
        },
        "barcode": {
          "description": "The barcode of the item",
          "type": "string"
        },
        "location": {
          "description": "The effective location of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "The name of the location",
              "type": "string"
            }
          }
        },
        "status": {
          "description": "Overall status of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the item status",
              "type": "string"
            }
          }
        },
        "inTransitDestinationServicePointId": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "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}$"
        },
        "inTransitDestinationServicePoint": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the service point",
              "type": "string"
            }
          }
        }
      }
    },
    "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"
        }
      }
    },
    "loanDate": {
      "description": "Date and time when the loan began",
      "type": "string",
      "format": "date-time"
    },
    "dueDate": {
      "description": "Date and time when the item is due to be returned",
      "type": "string",
      "format": "date-time"
    },
    "returnDate": {
      "description": "Date and time when the item was returned",
      "type": "string",
      "format": "date-time"
    },
    "systemReturnDate": {
      "description": "Date and time when return was 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"
    },
    "renewalCount": {
      "description": "Count of how many times a loan has been renewed (incremented by the client)",
      "type": "integer"
    },
    "checkoutServicePointId": {
      "description": "ID of the Service Point where the last checkout occured",
      "type": "string"
    },
    "checkinServicePointId": {
      "description": "ID of the Service Point where the last checkin occured",
      "type": "string"
    },
    "checkoutServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "The unique name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "checkinServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes to loan, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    }
  },
  "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",
  "item": {
    "title": "The Long Way to a Small, Angry Planet",
    "barcode": "036000291452",
    "status": {
      "name": "Checked Out"
    },
    "location": {
      "name": "Main Library"
    },
    "materialType": {
      "name": "Book"
    },
    "contributors": [
      {
        "name": "Steve Jones"
      }
    ]
  },
  "loanPolicyId" : "e9af4ba4-6801-4722-be45-d7a49d13564d",
  "loanPolicy": {
    "name" : "Can Circulate Rolling"
  },
  "borrower" : {
    "firstName" : "FirstName",
    "lastName" : "LastName",
    "middleName" : "MiddleName",
    "barcode" : "102322966933815"
  },
  "loanDate": "2017-03-01T23:11:00.000Z",
  "dueDate": "2017-04-01T23:11:00.000Z",
  "checkoutServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "checkinServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "status": {
    "name": "Open"
  },
  "action": "checkedout",
  "renewalCount": 0
}

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /circulation/override-check-out-by-barcode

Creates a loan by checking out an item to a loanee

POST /circulation/override-check-out-by-barcode
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Request to check out an item to a loanee using barcodes",
  "properties": {
    "itemBarcode": {
      "description": "Barcode of the item to be lent to the patron",
      "type": "string"
    },
    "userBarcode": {
      "description": "Barcode of the user (representing the patron) the item is to be lent to",
      "type": "string"
    },
    "proxyUserBarcode": {
      "description": "Barcode of the user representing a proxy for the patron",
      "type": "string"
    },
    "loanDate": {
      "description": "When the loan is to begin, defaults to current date and time",
      "type": "string",
      "format": "date-time"
    },
    "servicePointId": {
      "description": "Service point where the item has been checked out",
      "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}$"
    },
    "dueDate": {
      "description": "Due date for a new loan",
      "type": "string",
      "format": "date-time"
    },
    "comment": {
      "description": "Comment to override action stored in loan history",
      "type": "string"
    }
  },
  "required": [
    "itemBarcode",
    "userBarcode",
    "servicePointId",
    "dueDate",
    "comment"
  ]
}

Example:

{
  "userBarcode": "466983136459401",
  "proxyUserBarcode": "693750137582350",
  "itemBarcode": "2887532577331",
  "servicePointId": "3260a6f0-0b53-4d9c-ad74-2dba3830d69f",
  "dueDate": "2018-12-21T13:30:00Z",
  "comment": "Checkout override"
}

Response 201

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"
    },
    "borrower": {
      "description": "Additional information about the borrower of the item, taken from the user referred to by the userId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode used to identify the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        }
       },
      "additionalProperties": false
    },
    "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"
    },
    "loanPolicyId": {
      "description": "ID of last policy used in relation to this loan",
      "type": "string"
    },
    "loanPolicy": {
      "description": "Additional information about the loan policy of the item, taken from the loan loanPolicyId",
      "readonly": true,
      "type": "object",
      "properties": {
        "name": {
          "readonly": true,
          "description": "Name of last policy used in relation to this loan (read only, defined by the server)",
          "type": "string"
        }
      }
    },
    "item": {
      "description": "Additional information about the item",
      "type": "object",
      "properties": {
        "id": {
          "description": "ID of the item",
          "type": "string"
        },
        "title": {
          "description": "The title of the item lent to the patron",
          "type": "string"
        },
        "callNumber" : {
          "description" : "The call number from the holdings record",
          "type": "string"
        },
        "materialType": {
          "description": "The material type from the item record",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the material type",
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "contributors": {
            "description": "Contributors from the instance record",
            "type": "array",
            "items" : {
              "type": "object",
              "properties" : {
                 "name" : {
                    "description": "Name of the contributor",
                    "type" : "string"
                  }
              },
              "additionalProperties": false
          }
        },
        "holdingsRecordId": {
          "description": "The ID of the holdings for the item",
          "type": "string"
        },
        "instanceId": {
          "description": "The ID of the instance for the item",
          "type": "string"
        },
        "barcode": {
          "description": "The barcode of the item",
          "type": "string"
        },
        "location": {
          "description": "The effective location of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "The name of the location",
              "type": "string"
            }
          }
        },
        "status": {
          "description": "Overall status of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the item status",
              "type": "string"
            }
          }
        },
        "inTransitDestinationServicePointId": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "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}$"
        },
        "inTransitDestinationServicePoint": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the service point",
              "type": "string"
            }
          }
        }
      }
    },
    "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"
        }
      }
    },
    "loanDate": {
      "description": "Date and time when the loan began",
      "type": "string",
      "format": "date-time"
    },
    "dueDate": {
      "description": "Date and time when the item is due to be returned",
      "type": "string",
      "format": "date-time"
    },
    "returnDate": {
      "description": "Date and time when the item was returned",
      "type": "string",
      "format": "date-time"
    },
    "systemReturnDate": {
      "description": "Date and time when return was 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"
    },
    "renewalCount": {
      "description": "Count of how many times a loan has been renewed (incremented by the client)",
      "type": "integer"
    },
    "checkoutServicePointId": {
      "description": "ID of the Service Point where the last checkout occured",
      "type": "string"
    },
    "checkinServicePointId": {
      "description": "ID of the Service Point where the last checkin occured",
      "type": "string"
    },
    "checkoutServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "The unique name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "checkinServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes to loan, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    }
  },
  "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",
  "item": {
    "title": "The Long Way to a Small, Angry Planet",
    "barcode": "036000291452",
    "status": {
      "name": "Checked Out"
    },
    "location": {
      "name": "Main Library"
    },
    "materialType": {
      "name": "Book"
    },
    "contributors": [
      {
        "name": "Steve Jones"
      }
    ]
  },
  "loanPolicyId" : "e9af4ba4-6801-4722-be45-d7a49d13564d",
  "loanPolicy": {
    "name" : "Can Circulate Rolling"
  },
  "borrower" : {
    "firstName" : "FirstName",
    "lastName" : "LastName",
    "middleName" : "MiddleName",
    "barcode" : "102322966933815"
  },
  "loanDate": "2017-03-01T23:11:00.000Z",
  "dueDate": "2017-04-01T23:11:00.000Z",
  "checkoutServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "checkinServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "status": {
    "name": "Open"
  },
  "action": "checkedout",
  "renewalCount": 0
}

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /circulation/renew-by-barcode

Updates the due date of an existing loan

POST /circulation/renew-by-barcode
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Request to renew an existing loan, found by barcodes of item and loanee",
  "properties": {
    "itemBarcode": {
      "description": "Barcode of the item to be renewed",
      "type": "string"
    },
    "userBarcode": {
      "description": "Barcode of the user (representing the patron) the item has been loaned to",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "itemBarcode",
    "userBarcode"
  ]
}

Example:

{
  "userBarcode": "466983136459401",
  "itemBarcode": "2887532577331"
}

Response 200

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"
    },
    "borrower": {
      "description": "Additional information about the borrower of the item, taken from the user referred to by the userId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode used to identify the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        }
       },
      "additionalProperties": false
    },
    "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"
    },
    "loanPolicyId": {
      "description": "ID of last policy used in relation to this loan",
      "type": "string"
    },
    "loanPolicy": {
      "description": "Additional information about the loan policy of the item, taken from the loan loanPolicyId",
      "readonly": true,
      "type": "object",
      "properties": {
        "name": {
          "readonly": true,
          "description": "Name of last policy used in relation to this loan (read only, defined by the server)",
          "type": "string"
        }
      }
    },
    "item": {
      "description": "Additional information about the item",
      "type": "object",
      "properties": {
        "id": {
          "description": "ID of the item",
          "type": "string"
        },
        "title": {
          "description": "The title of the item lent to the patron",
          "type": "string"
        },
        "callNumber" : {
          "description" : "The call number from the holdings record",
          "type": "string"
        },
        "materialType": {
          "description": "The material type from the item record",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the material type",
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "contributors": {
            "description": "Contributors from the instance record",
            "type": "array",
            "items" : {
              "type": "object",
              "properties" : {
                 "name" : {
                    "description": "Name of the contributor",
                    "type" : "string"
                  }
              },
              "additionalProperties": false
          }
        },
        "holdingsRecordId": {
          "description": "The ID of the holdings for the item",
          "type": "string"
        },
        "instanceId": {
          "description": "The ID of the instance for the item",
          "type": "string"
        },
        "barcode": {
          "description": "The barcode of the item",
          "type": "string"
        },
        "location": {
          "description": "The effective location of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "The name of the location",
              "type": "string"
            }
          }
        },
        "status": {
          "description": "Overall status of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the item status",
              "type": "string"
            }
          }
        },
        "inTransitDestinationServicePointId": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "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}$"
        },
        "inTransitDestinationServicePoint": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the service point",
              "type": "string"
            }
          }
        }
      }
    },
    "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"
        }
      }
    },
    "loanDate": {
      "description": "Date and time when the loan began",
      "type": "string",
      "format": "date-time"
    },
    "dueDate": {
      "description": "Date and time when the item is due to be returned",
      "type": "string",
      "format": "date-time"
    },
    "returnDate": {
      "description": "Date and time when the item was returned",
      "type": "string",
      "format": "date-time"
    },
    "systemReturnDate": {
      "description": "Date and time when return was 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"
    },
    "renewalCount": {
      "description": "Count of how many times a loan has been renewed (incremented by the client)",
      "type": "integer"
    },
    "checkoutServicePointId": {
      "description": "ID of the Service Point where the last checkout occured",
      "type": "string"
    },
    "checkinServicePointId": {
      "description": "ID of the Service Point where the last checkin occured",
      "type": "string"
    },
    "checkoutServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "The unique name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "checkinServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes to loan, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    }
  },
  "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",
  "item": {
    "title": "The Long Way to a Small, Angry Planet",
    "barcode": "036000291452",
    "status": {
      "name": "Checked Out"
    },
    "location": {
      "name": "Main Library"
    },
    "materialType": {
      "name": "Book"
    },
    "contributors": [
      {
        "name": "Steve Jones"
      }
    ]
  },
  "loanPolicyId" : "e9af4ba4-6801-4722-be45-d7a49d13564d",
  "loanPolicy": {
    "name" : "Can Circulate Rolling"
  },
  "borrower" : {
    "firstName" : "FirstName",
    "lastName" : "LastName",
    "middleName" : "MiddleName",
    "barcode" : "102322966933815"
  },
  "loanDate": "2017-03-01T23:11:00.000Z",
  "dueDate": "2017-04-01T23:11:00.000Z",
  "checkoutServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "checkinServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "status": {
    "name": "Open"
  },
  "action": "checkedout",
  "renewalCount": 0
}

Response 201

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"
    },
    "borrower": {
      "description": "Additional information about the borrower of the item, taken from the user referred to by the userId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode used to identify the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        }
       },
      "additionalProperties": false
    },
    "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"
    },
    "loanPolicyId": {
      "description": "ID of last policy used in relation to this loan",
      "type": "string"
    },
    "loanPolicy": {
      "description": "Additional information about the loan policy of the item, taken from the loan loanPolicyId",
      "readonly": true,
      "type": "object",
      "properties": {
        "name": {
          "readonly": true,
          "description": "Name of last policy used in relation to this loan (read only, defined by the server)",
          "type": "string"
        }
      }
    },
    "item": {
      "description": "Additional information about the item",
      "type": "object",
      "properties": {
        "id": {
          "description": "ID of the item",
          "type": "string"
        },
        "title": {
          "description": "The title of the item lent to the patron",
          "type": "string"
        },
        "callNumber" : {
          "description" : "The call number from the holdings record",
          "type": "string"
        },
        "materialType": {
          "description": "The material type from the item record",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the material type",
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "contributors": {
            "description": "Contributors from the instance record",
            "type": "array",
            "items" : {
              "type": "object",
              "properties" : {
                 "name" : {
                    "description": "Name of the contributor",
                    "type" : "string"
                  }
              },
              "additionalProperties": false
          }
        },
        "holdingsRecordId": {
          "description": "The ID of the holdings for the item",
          "type": "string"
        },
        "instanceId": {
          "description": "The ID of the instance for the item",
          "type": "string"
        },
        "barcode": {
          "description": "The barcode of the item",
          "type": "string"
        },
        "location": {
          "description": "The effective location of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "The name of the location",
              "type": "string"
            }
          }
        },
        "status": {
          "description": "Overall status of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the item status",
              "type": "string"
            }
          }
        },
        "inTransitDestinationServicePointId": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "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}$"
        },
        "inTransitDestinationServicePoint": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the service point",
              "type": "string"
            }
          }
        }
      }
    },
    "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"
        }
      }
    },
    "loanDate": {
      "description": "Date and time when the loan began",
      "type": "string",
      "format": "date-time"
    },
    "dueDate": {
      "description": "Date and time when the item is due to be returned",
      "type": "string",
      "format": "date-time"
    },
    "returnDate": {
      "description": "Date and time when the item was returned",
      "type": "string",
      "format": "date-time"
    },
    "systemReturnDate": {
      "description": "Date and time when return was 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"
    },
    "renewalCount": {
      "description": "Count of how many times a loan has been renewed (incremented by the client)",
      "type": "integer"
    },
    "checkoutServicePointId": {
      "description": "ID of the Service Point where the last checkout occured",
      "type": "string"
    },
    "checkinServicePointId": {
      "description": "ID of the Service Point where the last checkin occured",
      "type": "string"
    },
    "checkoutServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "The unique name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "checkinServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes to loan, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    }
  },
  "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",
  "item": {
    "title": "The Long Way to a Small, Angry Planet",
    "barcode": "036000291452",
    "status": {
      "name": "Checked Out"
    },
    "location": {
      "name": "Main Library"
    },
    "materialType": {
      "name": "Book"
    },
    "contributors": [
      {
        "name": "Steve Jones"
      }
    ]
  },
  "loanPolicyId" : "e9af4ba4-6801-4722-be45-d7a49d13564d",
  "loanPolicy": {
    "name" : "Can Circulate Rolling"
  },
  "borrower" : {
    "firstName" : "FirstName",
    "lastName" : "LastName",
    "middleName" : "MiddleName",
    "barcode" : "102322966933815"
  },
  "loanDate": "2017-03-01T23:11:00.000Z",
  "dueDate": "2017-04-01T23:11:00.000Z",
  "checkoutServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "checkinServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "status": {
    "name": "Open"
  },
  "action": "checkedout",
  "renewalCount": 0
}

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /circulation/renew-by-id

Updates the due date of an existing loan

POST /circulation/renew-by-id
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Request to renew an existing loan, found by the IDs of item and loanee",
  "properties": {
    "itemId": {
      "description": "ID of the item to be renewed",
      "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}$"
    },
    "userId": {
      "description": "ID of the user (representing the patron) the item has been loaned to",
      "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}$"
    }
  },
  "additionalProperties": false,
  "required": [
    "itemId",
    "userId"
  ]
}

Example:

{
  "userId": "6c4706ad-3a76-4251-b030-4609027a7918",
  "itemId": "51763f82-c8e6-4486-9fdc-1c1664352550"
}

Response 200

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"
    },
    "borrower": {
      "description": "Additional information about the borrower of the item, taken from the user referred to by the userId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode used to identify the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        }
       },
      "additionalProperties": false
    },
    "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"
    },
    "loanPolicyId": {
      "description": "ID of last policy used in relation to this loan",
      "type": "string"
    },
    "loanPolicy": {
      "description": "Additional information about the loan policy of the item, taken from the loan loanPolicyId",
      "readonly": true,
      "type": "object",
      "properties": {
        "name": {
          "readonly": true,
          "description": "Name of last policy used in relation to this loan (read only, defined by the server)",
          "type": "string"
        }
      }
    },
    "item": {
      "description": "Additional information about the item",
      "type": "object",
      "properties": {
        "id": {
          "description": "ID of the item",
          "type": "string"
        },
        "title": {
          "description": "The title of the item lent to the patron",
          "type": "string"
        },
        "callNumber" : {
          "description" : "The call number from the holdings record",
          "type": "string"
        },
        "materialType": {
          "description": "The material type from the item record",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the material type",
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "contributors": {
            "description": "Contributors from the instance record",
            "type": "array",
            "items" : {
              "type": "object",
              "properties" : {
                 "name" : {
                    "description": "Name of the contributor",
                    "type" : "string"
                  }
              },
              "additionalProperties": false
          }
        },
        "holdingsRecordId": {
          "description": "The ID of the holdings for the item",
          "type": "string"
        },
        "instanceId": {
          "description": "The ID of the instance for the item",
          "type": "string"
        },
        "barcode": {
          "description": "The barcode of the item",
          "type": "string"
        },
        "location": {
          "description": "The effective location of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "The name of the location",
              "type": "string"
            }
          }
        },
        "status": {
          "description": "Overall status of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the item status",
              "type": "string"
            }
          }
        },
        "inTransitDestinationServicePointId": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "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}$"
        },
        "inTransitDestinationServicePoint": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the service point",
              "type": "string"
            }
          }
        }
      }
    },
    "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"
        }
      }
    },
    "loanDate": {
      "description": "Date and time when the loan began",
      "type": "string",
      "format": "date-time"
    },
    "dueDate": {
      "description": "Date and time when the item is due to be returned",
      "type": "string",
      "format": "date-time"
    },
    "returnDate": {
      "description": "Date and time when the item was returned",
      "type": "string",
      "format": "date-time"
    },
    "systemReturnDate": {
      "description": "Date and time when return was 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"
    },
    "renewalCount": {
      "description": "Count of how many times a loan has been renewed (incremented by the client)",
      "type": "integer"
    },
    "checkoutServicePointId": {
      "description": "ID of the Service Point where the last checkout occured",
      "type": "string"
    },
    "checkinServicePointId": {
      "description": "ID of the Service Point where the last checkin occured",
      "type": "string"
    },
    "checkoutServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "The unique name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "checkinServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes to loan, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    }
  },
  "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",
  "item": {
    "title": "The Long Way to a Small, Angry Planet",
    "barcode": "036000291452",
    "status": {
      "name": "Checked Out"
    },
    "location": {
      "name": "Main Library"
    },
    "materialType": {
      "name": "Book"
    },
    "contributors": [
      {
        "name": "Steve Jones"
      }
    ]
  },
  "loanPolicyId" : "e9af4ba4-6801-4722-be45-d7a49d13564d",
  "loanPolicy": {
    "name" : "Can Circulate Rolling"
  },
  "borrower" : {
    "firstName" : "FirstName",
    "lastName" : "LastName",
    "middleName" : "MiddleName",
    "barcode" : "102322966933815"
  },
  "loanDate": "2017-03-01T23:11:00.000Z",
  "dueDate": "2017-04-01T23:11:00.000Z",
  "checkoutServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "checkinServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "status": {
    "name": "Open"
  },
  "action": "checkedout",
  "renewalCount": 0
}

Response 201

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"
    },
    "borrower": {
      "description": "Additional information about the borrower of the item, taken from the user referred to by the userId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode used to identify the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        }
       },
      "additionalProperties": false
    },
    "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"
    },
    "loanPolicyId": {
      "description": "ID of last policy used in relation to this loan",
      "type": "string"
    },
    "loanPolicy": {
      "description": "Additional information about the loan policy of the item, taken from the loan loanPolicyId",
      "readonly": true,
      "type": "object",
      "properties": {
        "name": {
          "readonly": true,
          "description": "Name of last policy used in relation to this loan (read only, defined by the server)",
          "type": "string"
        }
      }
    },
    "item": {
      "description": "Additional information about the item",
      "type": "object",
      "properties": {
        "id": {
          "description": "ID of the item",
          "type": "string"
        },
        "title": {
          "description": "The title of the item lent to the patron",
          "type": "string"
        },
        "callNumber" : {
          "description" : "The call number from the holdings record",
          "type": "string"
        },
        "materialType": {
          "description": "The material type from the item record",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the material type",
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "contributors": {
            "description": "Contributors from the instance record",
            "type": "array",
            "items" : {
              "type": "object",
              "properties" : {
                 "name" : {
                    "description": "Name of the contributor",
                    "type" : "string"
                  }
              },
              "additionalProperties": false
          }
        },
        "holdingsRecordId": {
          "description": "The ID of the holdings for the item",
          "type": "string"
        },
        "instanceId": {
          "description": "The ID of the instance for the item",
          "type": "string"
        },
        "barcode": {
          "description": "The barcode of the item",
          "type": "string"
        },
        "location": {
          "description": "The effective location of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "The name of the location",
              "type": "string"
            }
          }
        },
        "status": {
          "description": "Overall status of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the item status",
              "type": "string"
            }
          }
        },
        "inTransitDestinationServicePointId": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "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}$"
        },
        "inTransitDestinationServicePoint": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the service point",
              "type": "string"
            }
          }
        }
      }
    },
    "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"
        }
      }
    },
    "loanDate": {
      "description": "Date and time when the loan began",
      "type": "string",
      "format": "date-time"
    },
    "dueDate": {
      "description": "Date and time when the item is due to be returned",
      "type": "string",
      "format": "date-time"
    },
    "returnDate": {
      "description": "Date and time when the item was returned",
      "type": "string",
      "format": "date-time"
    },
    "systemReturnDate": {
      "description": "Date and time when return was 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"
    },
    "renewalCount": {
      "description": "Count of how many times a loan has been renewed (incremented by the client)",
      "type": "integer"
    },
    "checkoutServicePointId": {
      "description": "ID of the Service Point where the last checkout occured",
      "type": "string"
    },
    "checkinServicePointId": {
      "description": "ID of the Service Point where the last checkin occured",
      "type": "string"
    },
    "checkoutServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "The unique name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "checkinServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes to loan, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    }
  },
  "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",
  "item": {
    "title": "The Long Way to a Small, Angry Planet",
    "barcode": "036000291452",
    "status": {
      "name": "Checked Out"
    },
    "location": {
      "name": "Main Library"
    },
    "materialType": {
      "name": "Book"
    },
    "contributors": [
      {
        "name": "Steve Jones"
      }
    ]
  },
  "loanPolicyId" : "e9af4ba4-6801-4722-be45-d7a49d13564d",
  "loanPolicy": {
    "name" : "Can Circulate Rolling"
  },
  "borrower" : {
    "firstName" : "FirstName",
    "lastName" : "LastName",
    "middleName" : "MiddleName",
    "barcode" : "102322966933815"
  },
  "loanDate": "2017-03-01T23:11:00.000Z",
  "dueDate": "2017-04-01T23:11:00.000Z",
  "checkoutServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "checkinServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "status": {
    "name": "Open"
  },
  "action": "checkedout",
  "renewalCount": 0
}

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /circulation/override-renewal-by-barcode

Updates the due date of an existing loan

POST /circulation/override-renewal-by-barcode
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Request to override renewal of an existing loan, found by barcodes of item and loanee",
  "properties": {
    "itemBarcode": {
      "description": "Barcode of the item to be renewed",
      "type": "string"
    },
    "userBarcode": {
      "description": "Barcode of the user (representing the patron) the item has been loaned to",
      "type": "string"
    },
    "dueDate": {
      "description": "New due date for renewed loan",
      "type": "string",
      "format": "date-time"
    },
    "comment": {
      "description": "Comment to override action stored in loan history",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "itemBarcode",
    "userBarcode",
    "comment"
  ]
}

Example:

{
  "userBarcode": "466983136459401",
  "itemBarcode": "2887532577331",
  "comment": "Renewal override",
  "dueDate": "2018-12-21T13:30:00Z"
}

Response 200

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"
    },
    "borrower": {
      "description": "Additional information about the borrower of the item, taken from the user referred to by the userId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode used to identify the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        }
       },
      "additionalProperties": false
    },
    "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"
    },
    "loanPolicyId": {
      "description": "ID of last policy used in relation to this loan",
      "type": "string"
    },
    "loanPolicy": {
      "description": "Additional information about the loan policy of the item, taken from the loan loanPolicyId",
      "readonly": true,
      "type": "object",
      "properties": {
        "name": {
          "readonly": true,
          "description": "Name of last policy used in relation to this loan (read only, defined by the server)",
          "type": "string"
        }
      }
    },
    "item": {
      "description": "Additional information about the item",
      "type": "object",
      "properties": {
        "id": {
          "description": "ID of the item",
          "type": "string"
        },
        "title": {
          "description": "The title of the item lent to the patron",
          "type": "string"
        },
        "callNumber" : {
          "description" : "The call number from the holdings record",
          "type": "string"
        },
        "materialType": {
          "description": "The material type from the item record",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the material type",
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "contributors": {
            "description": "Contributors from the instance record",
            "type": "array",
            "items" : {
              "type": "object",
              "properties" : {
                 "name" : {
                    "description": "Name of the contributor",
                    "type" : "string"
                  }
              },
              "additionalProperties": false
          }
        },
        "holdingsRecordId": {
          "description": "The ID of the holdings for the item",
          "type": "string"
        },
        "instanceId": {
          "description": "The ID of the instance for the item",
          "type": "string"
        },
        "barcode": {
          "description": "The barcode of the item",
          "type": "string"
        },
        "location": {
          "description": "The effective location of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "The name of the location",
              "type": "string"
            }
          }
        },
        "status": {
          "description": "Overall status of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the item status",
              "type": "string"
            }
          }
        },
        "inTransitDestinationServicePointId": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "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}$"
        },
        "inTransitDestinationServicePoint": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the service point",
              "type": "string"
            }
          }
        }
      }
    },
    "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"
        }
      }
    },
    "loanDate": {
      "description": "Date and time when the loan began",
      "type": "string",
      "format": "date-time"
    },
    "dueDate": {
      "description": "Date and time when the item is due to be returned",
      "type": "string",
      "format": "date-time"
    },
    "returnDate": {
      "description": "Date and time when the item was returned",
      "type": "string",
      "format": "date-time"
    },
    "systemReturnDate": {
      "description": "Date and time when return was 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"
    },
    "renewalCount": {
      "description": "Count of how many times a loan has been renewed (incremented by the client)",
      "type": "integer"
    },
    "checkoutServicePointId": {
      "description": "ID of the Service Point where the last checkout occured",
      "type": "string"
    },
    "checkinServicePointId": {
      "description": "ID of the Service Point where the last checkin occured",
      "type": "string"
    },
    "checkoutServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "The unique name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "checkinServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes to loan, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    }
  },
  "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",
  "item": {
    "title": "The Long Way to a Small, Angry Planet",
    "barcode": "036000291452",
    "status": {
      "name": "Checked Out"
    },
    "location": {
      "name": "Main Library"
    },
    "materialType": {
      "name": "Book"
    },
    "contributors": [
      {
        "name": "Steve Jones"
      }
    ]
  },
  "loanPolicyId" : "e9af4ba4-6801-4722-be45-d7a49d13564d",
  "loanPolicy": {
    "name" : "Can Circulate Rolling"
  },
  "borrower" : {
    "firstName" : "FirstName",
    "lastName" : "LastName",
    "middleName" : "MiddleName",
    "barcode" : "102322966933815"
  },
  "loanDate": "2017-03-01T23:11:00.000Z",
  "dueDate": "2017-04-01T23:11:00.000Z",
  "checkoutServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "checkinServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "status": {
    "name": "Open"
  },
  "action": "checkedout",
  "renewalCount": 0
}

Response 201

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"
    },
    "borrower": {
      "description": "Additional information about the borrower of the item, taken from the user referred to by the userId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode used to identify the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        }
       },
      "additionalProperties": false
    },
    "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"
    },
    "loanPolicyId": {
      "description": "ID of last policy used in relation to this loan",
      "type": "string"
    },
    "loanPolicy": {
      "description": "Additional information about the loan policy of the item, taken from the loan loanPolicyId",
      "readonly": true,
      "type": "object",
      "properties": {
        "name": {
          "readonly": true,
          "description": "Name of last policy used in relation to this loan (read only, defined by the server)",
          "type": "string"
        }
      }
    },
    "item": {
      "description": "Additional information about the item",
      "type": "object",
      "properties": {
        "id": {
          "description": "ID of the item",
          "type": "string"
        },
        "title": {
          "description": "The title of the item lent to the patron",
          "type": "string"
        },
        "callNumber" : {
          "description" : "The call number from the holdings record",
          "type": "string"
        },
        "materialType": {
          "description": "The material type from the item record",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the material type",
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "contributors": {
            "description": "Contributors from the instance record",
            "type": "array",
            "items" : {
              "type": "object",
              "properties" : {
                 "name" : {
                    "description": "Name of the contributor",
                    "type" : "string"
                  }
              },
              "additionalProperties": false
          }
        },
        "holdingsRecordId": {
          "description": "The ID of the holdings for the item",
          "type": "string"
        },
        "instanceId": {
          "description": "The ID of the instance for the item",
          "type": "string"
        },
        "barcode": {
          "description": "The barcode of the item",
          "type": "string"
        },
        "location": {
          "description": "The effective location of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "The name of the location",
              "type": "string"
            }
          }
        },
        "status": {
          "description": "Overall status of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the item status",
              "type": "string"
            }
          }
        },
        "inTransitDestinationServicePointId": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "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}$"
        },
        "inTransitDestinationServicePoint": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the service point",
              "type": "string"
            }
          }
        }
      }
    },
    "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"
        }
      }
    },
    "loanDate": {
      "description": "Date and time when the loan began",
      "type": "string",
      "format": "date-time"
    },
    "dueDate": {
      "description": "Date and time when the item is due to be returned",
      "type": "string",
      "format": "date-time"
    },
    "returnDate": {
      "description": "Date and time when the item was returned",
      "type": "string",
      "format": "date-time"
    },
    "systemReturnDate": {
      "description": "Date and time when return was 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"
    },
    "renewalCount": {
      "description": "Count of how many times a loan has been renewed (incremented by the client)",
      "type": "integer"
    },
    "checkoutServicePointId": {
      "description": "ID of the Service Point where the last checkout occured",
      "type": "string"
    },
    "checkinServicePointId": {
      "description": "ID of the Service Point where the last checkin occured",
      "type": "string"
    },
    "checkoutServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "The unique name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "checkinServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes to loan, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    }
  },
  "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",
  "item": {
    "title": "The Long Way to a Small, Angry Planet",
    "barcode": "036000291452",
    "status": {
      "name": "Checked Out"
    },
    "location": {
      "name": "Main Library"
    },
    "materialType": {
      "name": "Book"
    },
    "contributors": [
      {
        "name": "Steve Jones"
      }
    ]
  },
  "loanPolicyId" : "e9af4ba4-6801-4722-be45-d7a49d13564d",
  "loanPolicy": {
    "name" : "Can Circulate Rolling"
  },
  "borrower" : {
    "firstName" : "FirstName",
    "lastName" : "LastName",
    "middleName" : "MiddleName",
    "barcode" : "102322966933815"
  },
  "loanDate": "2017-03-01T23:11:00.000Z",
  "dueDate": "2017-04-01T23:11:00.000Z",
  "checkoutServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "checkinServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "status": {
    "name": "Open"
  },
  "action": "checkedout",
  "renewalCount": 0
}

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /circulation/check-in-by-barcode

Updates the status of an existing loan

POST /circulation/check-in-by-barcode
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Request to check in an item at a service point (including when a loan is returned)",
  "properties": {
    "itemBarcode": {
      "description": "Barcode of the item to be checked in",
      "type": "string"
    },
    "servicePointId": {
      "description": "Service point where the item is being processed",
      "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}$"
    },
    "checkInDate": {
      "description": "When the item was checked in",
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": false,
  "required": [
    "itemBarcode",
    "checkInDate",
    "servicePointId"
  ]
}

Example:

{
  "itemBarcode": "2887532577331",
  "servicePointId": "8359f2bc-b83e-48e1-8a5b-ca1a74e840de",
  "checkInDate": "2018-03-05T14:23:41.000Z"
}

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Success response for checking in an item at a service point",
  "properties": {
    "loan": {
      "description": "Loan affected by the check in (may be none, if a receiving check in)",
      "$ref": "loan.json"
    },
    "item": {
      "description": "Additional information about the item",
      "type": "object",
      "properties": {
        "id": {
          "description": "ID of the item",
          "type": "string"
        },
        "title": {
          "description": "The title of the item lent to the patron",
          "type": "string"
        },
        "callNumber" : {
          "description" : "The call number from the holdings record",
          "type": "string"
        },
        "materialType": {
          "description": "The material type from the item record",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the material type",
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "contributors": {
          "description": "Contributors from the instance record",
          "type": "array",
          "items" : {
            "type": "object",
            "properties" : {
              "name" : {
                "description": "Name of the contributor",
                "type" : "string"
              }
            },
            "additionalProperties": false
          }
        },
        "holdingsRecordId": {
          "description": "The ID of the holdings for the item",
          "type": "string"
        },
        "instanceId": {
          "description": "The ID of the instance for the item",
          "type": "string"
        },
        "barcode": {
          "description": "The barcode of the item",
          "type": "string"
        },
        "location": {
          "description": "The effective location of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "The name of the location",
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "status": {
          "description": "Overall status of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the item status",
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "inTransitDestinationServicePointId": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "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}$"
        },
        "inTransitDestinationServicePoint": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the service point",
              "type": "string"
            }
          }
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}

Example:

{
  "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",
    "item": {
      "title": "The Long Way to a Small, Angry Planet",
      "barcode": "036000291452",
      "status": {
        "name": "Checked Out"
      },
      "location": {
        "name": "Main Library"
      },
      "materialType": {
        "name": "Book"
      },
      "contributors": [
        {
          "name": "Steve Jones"
        }
      ]
    },
    "loanDate": "2017-03-01T23:11:00.000Z",
    "dueDate": "2017-04-01T23:11:00.000Z",
    "checkoutServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
    "checkinServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
    "status": {
      "name": "Open"
    },
    "action": "checkedout",
    "renewalCount": 0
  }
}

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /circulation/loans

Retrieve a list of loan items.

GET /circulation/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.

    by title (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"
    
  • 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#",
  "title": "Collection of loans",
  "description": "Collection of loans",
  "type": "object",
  "properties": {
    "loans": {
      "description": "Paged collection of loans",
      "id": "loans",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "loan.json"
      }
    },
    "totalRecords": {
      "description": "Total number of loan records",
      "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",
      "item": {
        "title": "The Long Way to a Small, Angry Planet",
        "barcode": "036000291452",
        "status": {
          "name": "Checked Out"
        }
      },
      "loanDate": "2017-03-01T22:34:11Z",
      "dueDate": "2017-04-01T22:34:11.000Z",
      "status": {
        "name": "Open"
      },
      "location": {
        "name": "Main Library"
      },
      "action": "checkedout",
      "renewalCount": 1,
      "loanPolicyId" : "e2af3ba4-6801-4722-be45-d7a49d13564d",
      "loanPolicy": {
        "name" : "Can Circulate Rolling"
      },
      "borrower" : {
        "firstName" : "FirstName",
        "lastName" : "LastName",
        "middleName" : "MiddleName",
        "barcode" : "109322966913845"
      }
    },
    {
      "id": "1d09af65-aeaa-499c-80cb-d52847b75a60",
      "userId": "15054e48-03e8-4ed5-810b-7192b86accab",
      "itemId": "94838fa2-288a-45c2-ad19-9102f5645127",
      "item": {
        "title": "Nod",
        "barcode": "565578437802",
        "status": {
          "name": "Available"
        },
        "location": {
          "name": "Annex"
        }
      },
      "loanDate": "2017-01-14T19:14:36Z",
      "returnDate": "2017-01-16T09:15:23Z",
      "status": {
        "name": "Closed"
      },
      "action": "checkedin",
      "loanPolicyId" : "e2af3ba4-6801-4722-be45-d7a49d13564d",
      "loanPolicy": {
        "name" : "Can Circulate Rolling"
      },
      "borrower" : {
        "firstName" : "FirstName",
        "lastName" : "LastName",
        "middleName" : "MiddleName",
        "barcode" : "102322966933845"
      }
    }
  ],
  "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 /circulation/loans

Create a new loan item.

POST /circulation/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"
    },
    "borrower": {
      "description": "Additional information about the borrower of the item, taken from the user referred to by the userId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode used to identify the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        }
       },
      "additionalProperties": false
    },
    "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"
    },
    "loanPolicyId": {
      "description": "ID of last policy used in relation to this loan",
      "type": "string"
    },
    "loanPolicy": {
      "description": "Additional information about the loan policy of the item, taken from the loan loanPolicyId",
      "readonly": true,
      "type": "object",
      "properties": {
        "name": {
          "readonly": true,
          "description": "Name of last policy used in relation to this loan (read only, defined by the server)",
          "type": "string"
        }
      }
    },
    "item": {
      "description": "Additional information about the item",
      "type": "object",
      "properties": {
        "id": {
          "description": "ID of the item",
          "type": "string"
        },
        "title": {
          "description": "The title of the item lent to the patron",
          "type": "string"
        },
        "callNumber" : {
          "description" : "The call number from the holdings record",
          "type": "string"
        },
        "materialType": {
          "description": "The material type from the item record",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the material type",
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "contributors": {
            "description": "Contributors from the instance record",
            "type": "array",
            "items" : {
              "type": "object",
              "properties" : {
                 "name" : {
                    "description": "Name of the contributor",
                    "type" : "string"
                  }
              },
              "additionalProperties": false
          }
        },
        "holdingsRecordId": {
          "description": "The ID of the holdings for the item",
          "type": "string"
        },
        "instanceId": {
          "description": "The ID of the instance for the item",
          "type": "string"
        },
        "barcode": {
          "description": "The barcode of the item",
          "type": "string"
        },
        "location": {
          "description": "The effective location of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "The name of the location",
              "type": "string"
            }
          }
        },
        "status": {
          "description": "Overall status of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the item status",
              "type": "string"
            }
          }
        },
        "inTransitDestinationServicePointId": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "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}$"
        },
        "inTransitDestinationServicePoint": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the service point",
              "type": "string"
            }
          }
        }
      }
    },
    "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"
        }
      }
    },
    "loanDate": {
      "description": "Date and time when the loan began",
      "type": "string",
      "format": "date-time"
    },
    "dueDate": {
      "description": "Date and time when the item is due to be returned",
      "type": "string",
      "format": "date-time"
    },
    "returnDate": {
      "description": "Date and time when the item was returned",
      "type": "string",
      "format": "date-time"
    },
    "systemReturnDate": {
      "description": "Date and time when return was 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"
    },
    "renewalCount": {
      "description": "Count of how many times a loan has been renewed (incremented by the client)",
      "type": "integer"
    },
    "checkoutServicePointId": {
      "description": "ID of the Service Point where the last checkout occured",
      "type": "string"
    },
    "checkinServicePointId": {
      "description": "ID of the Service Point where the last checkin occured",
      "type": "string"
    },
    "checkoutServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "The unique name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "checkinServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes to loan, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    }
  },
  "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",
  "item": {
    "title": "The Long Way to a Small, Angry Planet",
    "barcode": "036000291452",
    "status": {
      "name": "Checked Out"
    },
    "location": {
      "name": "Main Library"
    },
    "materialType": {
      "name": "Book"
    },
    "contributors": [
      {
        "name": "Steve Jones"
      }
    ]
  },
  "loanPolicyId" : "e9af4ba4-6801-4722-be45-d7a49d13564d",
  "loanPolicy": {
    "name" : "Can Circulate Rolling"
  },
  "borrower" : {
    "firstName" : "FirstName",
    "lastName" : "LastName",
    "middleName" : "MiddleName",
    "barcode" : "102322966933815"
  },
  "loanDate": "2017-03-01T23:11:00.000Z",
  "dueDate": "2017-04-01T23:11:00.000Z",
  "checkoutServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "checkinServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "status": {
    "name": "Open"
  },
  "action": "checkedout",
  "renewalCount": 0
}

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",
  "item": {
    "title": "The Long Way to a Small, Angry Planet",
    "barcode": "036000291452",
    "status": {
      "name": "Checked Out"
    },
    "location": {
      "name": "Main Library"
    },
    "materialType": {
      "name": "Book"
    },
    "contributors": [
      {
        "name": "Steve Jones"
      }
    ]
  },
  "loanPolicyId" : "e9af4ba4-6801-4722-be45-d7a49d13564d",
  "loanPolicy": {
    "name" : "Can Circulate Rolling"
  },
  "borrower" : {
    "firstName" : "FirstName",
    "lastName" : "LastName",
    "middleName" : "MiddleName",
    "barcode" : "102322966933815"
  },
  "loanDate": "2017-03-01T23:11:00.000Z",
  "dueDate": "2017-04-01T23:11:00.000Z",
  "checkoutServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "checkinServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "status": {
    "name": "Open"
  },
  "action": "checkedout",
  "renewalCount": 0
}

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 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

DELETE /circulation/loans

DELETE /circulation/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

GET /circulation/loans/{loanId}

Retrieve loan item with given {loanId}

GET /circulation/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"
    },
    "borrower": {
      "description": "Additional information about the borrower of the item, taken from the user referred to by the userId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode used to identify the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        }
       },
      "additionalProperties": false
    },
    "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"
    },
    "loanPolicyId": {
      "description": "ID of last policy used in relation to this loan",
      "type": "string"
    },
    "loanPolicy": {
      "description": "Additional information about the loan policy of the item, taken from the loan loanPolicyId",
      "readonly": true,
      "type": "object",
      "properties": {
        "name": {
          "readonly": true,
          "description": "Name of last policy used in relation to this loan (read only, defined by the server)",
          "type": "string"
        }
      }
    },
    "item": {
      "description": "Additional information about the item",
      "type": "object",
      "properties": {
        "id": {
          "description": "ID of the item",
          "type": "string"
        },
        "title": {
          "description": "The title of the item lent to the patron",
          "type": "string"
        },
        "callNumber" : {
          "description" : "The call number from the holdings record",
          "type": "string"
        },
        "materialType": {
          "description": "The material type from the item record",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the material type",
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "contributors": {
            "description": "Contributors from the instance record",
            "type": "array",
            "items" : {
              "type": "object",
              "properties" : {
                 "name" : {
                    "description": "Name of the contributor",
                    "type" : "string"
                  }
              },
              "additionalProperties": false
          }
        },
        "holdingsRecordId": {
          "description": "The ID of the holdings for the item",
          "type": "string"
        },
        "instanceId": {
          "description": "The ID of the instance for the item",
          "type": "string"
        },
        "barcode": {
          "description": "The barcode of the item",
          "type": "string"
        },
        "location": {
          "description": "The effective location of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "The name of the location",
              "type": "string"
            }
          }
        },
        "status": {
          "description": "Overall status of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the item status",
              "type": "string"
            }
          }
        },
        "inTransitDestinationServicePointId": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "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}$"
        },
        "inTransitDestinationServicePoint": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the service point",
              "type": "string"
            }
          }
        }
      }
    },
    "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"
        }
      }
    },
    "loanDate": {
      "description": "Date and time when the loan began",
      "type": "string",
      "format": "date-time"
    },
    "dueDate": {
      "description": "Date and time when the item is due to be returned",
      "type": "string",
      "format": "date-time"
    },
    "returnDate": {
      "description": "Date and time when the item was returned",
      "type": "string",
      "format": "date-time"
    },
    "systemReturnDate": {
      "description": "Date and time when return was 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"
    },
    "renewalCount": {
      "description": "Count of how many times a loan has been renewed (incremented by the client)",
      "type": "integer"
    },
    "checkoutServicePointId": {
      "description": "ID of the Service Point where the last checkout occured",
      "type": "string"
    },
    "checkinServicePointId": {
      "description": "ID of the Service Point where the last checkin occured",
      "type": "string"
    },
    "checkoutServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "The unique name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "checkinServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes to loan, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    }
  },
  "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",
  "item": {
    "title": "The Long Way to a Small, Angry Planet",
    "barcode": "036000291452",
    "status": {
      "name": "Checked Out"
    },
    "location": {
      "name": "Main Library"
    },
    "materialType": {
      "name": "Book"
    },
    "contributors": [
      {
        "name": "Steve Jones"
      }
    ]
  },
  "loanPolicyId" : "e9af4ba4-6801-4722-be45-d7a49d13564d",
  "loanPolicy": {
    "name" : "Can Circulate Rolling"
  },
  "borrower" : {
    "firstName" : "FirstName",
    "lastName" : "LastName",
    "middleName" : "MiddleName",
    "barcode" : "102322966933815"
  },
  "loanDate": "2017-03-01T23:11:00.000Z",
  "dueDate": "2017-04-01T23:11:00.000Z",
  "checkoutServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "checkinServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "status": {
    "name": "Open"
  },
  "action": "checkedout",
  "renewalCount": 0
}

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

Update loan item with given {loanId}

PUT /circulation/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"
    },
    "borrower": {
      "description": "Additional information about the borrower of the item, taken from the user referred to by the userId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode used to identify the borrower (read only, defined by the server)",
          "type": "string",
          "readonly": true
        }
       },
      "additionalProperties": false
    },
    "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"
    },
    "loanPolicyId": {
      "description": "ID of last policy used in relation to this loan",
      "type": "string"
    },
    "loanPolicy": {
      "description": "Additional information about the loan policy of the item, taken from the loan loanPolicyId",
      "readonly": true,
      "type": "object",
      "properties": {
        "name": {
          "readonly": true,
          "description": "Name of last policy used in relation to this loan (read only, defined by the server)",
          "type": "string"
        }
      }
    },
    "item": {
      "description": "Additional information about the item",
      "type": "object",
      "properties": {
        "id": {
          "description": "ID of the item",
          "type": "string"
        },
        "title": {
          "description": "The title of the item lent to the patron",
          "type": "string"
        },
        "callNumber" : {
          "description" : "The call number from the holdings record",
          "type": "string"
        },
        "materialType": {
          "description": "The material type from the item record",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the material type",
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "contributors": {
            "description": "Contributors from the instance record",
            "type": "array",
            "items" : {
              "type": "object",
              "properties" : {
                 "name" : {
                    "description": "Name of the contributor",
                    "type" : "string"
                  }
              },
              "additionalProperties": false
          }
        },
        "holdingsRecordId": {
          "description": "The ID of the holdings for the item",
          "type": "string"
        },
        "instanceId": {
          "description": "The ID of the instance for the item",
          "type": "string"
        },
        "barcode": {
          "description": "The barcode of the item",
          "type": "string"
        },
        "location": {
          "description": "The effective location of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "The name of the location",
              "type": "string"
            }
          }
        },
        "status": {
          "description": "Overall status of the item",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the item status",
              "type": "string"
            }
          }
        },
        "inTransitDestinationServicePointId": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "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}$"
        },
        "inTransitDestinationServicePoint": {
          "description": "Service point an item is intended to be transited to (should only be present when in transit)",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the service point",
              "type": "string"
            }
          }
        }
      }
    },
    "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"
        }
      }
    },
    "loanDate": {
      "description": "Date and time when the loan began",
      "type": "string",
      "format": "date-time"
    },
    "dueDate": {
      "description": "Date and time when the item is due to be returned",
      "type": "string",
      "format": "date-time"
    },
    "returnDate": {
      "description": "Date and time when the item was returned",
      "type": "string",
      "format": "date-time"
    },
    "systemReturnDate": {
      "description": "Date and time when return was 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"
    },
    "renewalCount": {
      "description": "Count of how many times a loan has been renewed (incremented by the client)",
      "type": "integer"
    },
    "checkoutServicePointId": {
      "description": "ID of the Service Point where the last checkout occured",
      "type": "string"
    },
    "checkinServicePointId": {
      "description": "ID of the Service Point where the last checkin occured",
      "type": "string"
    },
    "checkoutServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "The unique name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "checkinServicePoint": {
      "description": "The Service Point where the last checkout occurred",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the service point",
          "type": "string"
        },
        "code": {
          "description": "The short code for the service point",
          "type": "string"
        },
        "discoveryDisplayName":{
          "description": "The human readable name",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "The time to shelving",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this a pickup location",
          "type": "boolean"
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes to loan, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    }
  },
  "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",
  "item": {
    "title": "The Long Way to a Small, Angry Planet",
    "barcode": "036000291452",
    "status": {
      "name": "Checked Out"
    },
    "location": {
      "name": "Main Library"
    },
    "materialType": {
      "name": "Book"
    },
    "contributors": [
      {
        "name": "Steve Jones"
      }
    ]
  },
  "loanPolicyId" : "e9af4ba4-6801-4722-be45-d7a49d13564d",
  "loanPolicy": {
    "name" : "Can Circulate Rolling"
  },
  "borrower" : {
    "firstName" : "FirstName",
    "lastName" : "LastName",
    "middleName" : "MiddleName",
    "barcode" : "102322966933815"
  },
  "loanDate": "2017-03-01T23:11:00.000Z",
  "dueDate": "2017-04-01T23:11:00.000Z",
  "checkoutServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "checkinServicePointId": "e9af4ba4-6801-4722-bf45-d7a49d54564d",
  "status": {
    "name": "Open"
  },
  "action": "checkedout",
  "renewalCount": 0
}

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

Delete loan item with given {loanId}

DELETE /circulation/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 /circulation/rules

Get the circulation rules

GET /circulation/rules

Response 200

Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Circulation Rules",
  "description": "Circulation rules record",
  "type": "object",
  "properties": {
    "id": {
      "description": "ID of the circulation rules (should only ever be a single record)",
      "type": "string"
    },
    "rulesAsText": {
      "description": "Circulation rules represented in text using the bespoke format",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "rulesAsText"
  ]
}

Example:

{
  "rulesAsText": "priority: t, s, c, b, a, m, g\\nfallback-policy: l ffffffff-2222-4b5e-a7bd-064b8d177231 r ffffffff-3333-4ccf-b0f0-13db36bc1668 n ffffffff-4444-4da6-beae-73cb39e27cf1\\nm aaaaaaaa-1111-4b5e-a7bd-064b8d177231: l ffffffff-5555-4b5e-a7bd-064b8d177231 r ffffffff-6666-4c7a-a2cb-289d0aad2539 n ffffffff-7777-48ca-bd3a-90a0520068d7\\n    g cccccccc-1111-4b5e-a7bd-064b8d177231: l ffffffff-8888-4b5e-a7bd-064b8d177231 r ffffffff-9999-4f5a-b338-3a7e8d49b802 n ffffffff-0000-4cb8-a010-e589f8958eb5"
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

PUT /circulation/rules

Set the circulation rules using a text file

PUT /circulation/rules
Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Circulation Rules",
  "description": "Circulation rules record",
  "type": "object",
  "properties": {
    "id": {
      "description": "ID of the circulation rules (should only ever be a single record)",
      "type": "string"
    },
    "rulesAsText": {
      "description": "Circulation rules represented in text using the bespoke format",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "rulesAsText"
  ]
}

Example:

{
  "rulesAsText": "priority: t, s, c, b, a, m, g\\nfallback-policy: l ffffffff-2222-4b5e-a7bd-064b8d177231 r ffffffff-3333-4ccf-b0f0-13db36bc1668 n ffffffff-4444-4da6-beae-73cb39e27cf1\\nm aaaaaaaa-1111-4b5e-a7bd-064b8d177231: l ffffffff-5555-4b5e-a7bd-064b8d177231 r ffffffff-6666-4c7a-a2cb-289d0aad2539 n ffffffff-7777-48ca-bd3a-90a0520068d7\\n    g cccccccc-1111-4b5e-a7bd-064b8d177231: l ffffffff-8888-4b5e-a7bd-064b8d177231 r ffffffff-9999-4f5a-b338-3a7e8d49b802 n ffffffff-0000-4cb8-a010-e589f8958eb5"
}

Response 204

Circulation rules have been saved.

Response 422

Validation error in the text file.

Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Circulation Rules Error Schema",
  "description": "Describes an error within the circulation rules",
  "type": "object",
  "properties": {
    "message": {
      "description": "Description of the error",
      "type": "string"
    },
    "line": {
      "description": "Line where the error occurred",
      "type": "integer"
    },
    "column": {
      "description": "Column where the error occurred",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "message",
    "line",
    "column"
  ]
}

Example:

{
  "message": "One of the keywords t, a, b, c, s, m, g, fallback-policy, priority or the character # expected, but found: foobar",
  "line": 1,
  "column": 1
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /circulation/rules/loan-policy

Execute circulation rules and return the loan policy that will be applied, either the matching loan policy with the highest priority or the fallback loan policy

GET /circulation/rules/loan-policy
Query Parameters
  • item_type_id: required (string - 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}$)

    Item type id

  • loan_type_id: required (string - 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}$)

    Loan type id

  • patron_type_id: required (string - 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}$)

    Patron type id

  • shelving_location_id: required (string - 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}$)

    Shelving location id

Response 200

Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Result of applying circulation rules to determine a loan policy",
  "description": "Describes the outcome of applying loan rules to determine a loan policy",
  "type": "object",
  "properties": {
    "loanPolicyId": {
      "description": "ID of the loan policy determined by the circulation rules",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "loanPolicyId"
  ]
}

Example:

{
  "loanPolicyId": "d9cd0bed-1b49-4b5e-a7bd-064b8d177231"
}

Response 400

Invalid query parameters

Body

Media type: text/plain

Type: any

Example:

required query parameter missing: item_type_id

Response 422

Invalid id error.

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "An error",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "parameters": {
      "type": "object",
      "$ref": "parameters.schema"
    }
  },
  "required": [
    "message"
  ]
}

Example:

{
  "message": "Patron type id does not exist: 99"
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /circulation/rules/loan-policy-all

Execute circulation rules and return all matching loan policies in decreasing priority and the fallback loan policy

GET /circulation/rules/loan-policy-all
Query Parameters
  • item_type_id: required (string - 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}$)

    Item type id

  • loan_type_id: required (string - 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}$)

    Loan type id

  • patron_type_id: required (string - 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}$)

    Patron type id

  • shelving_location_id: required (string - 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}$)

    Shelving location id

  • rules: (string)

    Circulation rules if provided, otherwise use stored circulation rules

Response 200

Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Circulation policy ids schema",
  "description": "All rule matches from an application of the rules",
  "type": "object",
  "properties": {
    "ruleMatches": {
      "id": "ruleMatches",
      "description": "Set of all rule matches",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "circulation-rule-loan-policy-match.json"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "ruleMatches"
  ]
}

Example:

{
  "ruleMatches": [
    {
      "ruleLine": 7,
      "loanPolicyId": "d9cd0bed-1b49-4b5e-a7bd-064b8d177231"
    },
    {
      "ruleLine": 4,
      "loanPolicyId": "5e3bf628-cf74-48c2-ae8e-fe1bdc8d6220"
    },
    {
      "ruleLine": 1,
      "loanPolicyId": "7df77ebc-6dd3-425c-a00a-82c1ae930f72"
    }
  ]
}

Response 422

Invalid id error.

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "An error",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "parameters": {
      "type": "object",
      "$ref": "parameters.schema"
    }
  },
  "required": [
    "message"
  ]
}

Example:

{
  "message": "Patron type id does not exist: 99"
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /circulation/rules/request-policy

Execute circulation rules and return the request policy that will be applied, either the matching request policy with the highest priority or the fallback request policy

GET /circulation/rules/request-policy
Query Parameters
  • item_type_id: required (string - 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}$)

    Item type id

  • loan_type_id: required (string - 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}$)

    Loan type id

  • patron_type_id: required (string - 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}$)

    Patron type id

  • shelving_location_id: required (string - 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}$)

    Shelving location id

Response 200

Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Result of applying circulation rules to determine a request policy",
  "description": "Describes the outcome of applying circulation rules to determine a request policy",
  "type": "object",
  "properties": {
    "requestPolicyId": {
      "description": "ID of the request policy determined by the circulation rules",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "requestPolicyId"
  ]
}

Example:

{
  "requestPolicyId": "4c6e1fb0-2ef1-4666-bd15-f9190ff89060"
}

Response 400

Invalid query parameters

Body

Media type: text/plain

Type: any

Example:

required query parameter missing: item_type_id

Response 422

Invalid id error.

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "An error",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "parameters": {
      "type": "object",
      "$ref": "parameters.schema"
    }
  },
  "required": [
    "message"
  ]
}

Example:

{
  "message": "Patron type id does not exist: 99"
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /circulation/rules/request-policy-all

Execute circulation rules and return all matching request policies policies in decreasing priority and the fallback request policy

GET /circulation/rules/request-policy-all
Query Parameters
  • item_type_id: required (string - 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}$)

    Item type id

  • loan_type_id: required (string - 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}$)

    Loan type id

  • patron_type_id: required (string - 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}$)

    Patron type id

  • shelving_location_id: required (string - 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}$)

    Shelving location id

  • rules: (string)

    Circulation rules if provided, otherwise use stored circulation rules

Response 200

Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Circulation policy ids schema",
  "description": "All rule matches from an application of the rules",
  "type": "object",
  "properties": {
    "ruleMatches": {
      "id": "ruleMatches",
      "description": "Set of all rule matches",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "circulation-rule-request-policy-match.json"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "ruleMatches"
  ]
}

Example:

{
  "ruleMatches": [
    {
      "ruleLine": 4,
      "requestPolicyId": "334e5a9e-94f9-4673-8d1d-ab552863886b"
    },
    {
      "ruleLine": 1,
      "requestPolicyId": "4c6e1fb0-2ef1-4666-bd15-f9190ff89060"
    }
  ]
}

Response 422

Invalid id error.

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "An error",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "parameters": {
      "type": "object",
      "$ref": "parameters.schema"
    }
  },
  "required": [
    "message"
  ]
}

Example:

{
  "message": "Patron type id does not exist: 99"
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /circulation/rules/notice-policy

Get the notice policy when applying circulation rules

GET /circulation/rules/notice-policy
Query Parameters
  • item_type_id: required (string - 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}$)

    Item type id

  • loan_type_id: required (string - 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}$)

    Loan type id

  • patron_type_id: required (string - 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}$)

    Patron type id

  • shelving_location_id: required (string - 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}$)

    Shelving location id

Response 200

Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Result of applying circulation rules to determine a notice policy",
  "description": "Describes the outcome of applying circulation rules to determine a notice policy",
  "type": "object",
  "properties": {
    "noticePolicyId": {
      "description": "ID of the notice policy determined by the circulation rules",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "noticePolicyId"
  ]
}

Example:

{
  "noticePolicyId": "122b3d2b-4788-4f1e-9117-56daa91cb75c"
}

Response 400

Invalid query parameters

Body

Media type: text/plain

Type: any

Example:

required query parameter missing: item_type_id

Response 422

Invalid id error.

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "An error",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "parameters": {
      "type": "object",
      "$ref": "parameters.schema"
    }
  },
  "required": [
    "message"
  ]
}

Example:

{
  "message": "Patron type id does not exist: 99"
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /circulation/rules/notice-policy-all

Get notice policy for each match when applying circulation rules

GET /circulation/rules/notice-policy-all
Query Parameters
  • item_type_id: required (string - 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}$)

    Item type id

  • loan_type_id: required (string - 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}$)

    Loan type id

  • patron_type_id: required (string - 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}$)

    Patron type id

  • shelving_location_id: required (string - 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}$)

    Shelving location id

  • rules: (string)

    Circulation rules if provided, otherwise use stored circulation rules

Response 200

Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Circulation policy ids schema",
  "description": "All rule matches from an application of the rules",
  "type": "object",
  "properties": {
    "ruleMatches": {
      "id": "ruleMatches",
      "description": "Set of all rule matches",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "circulation-rule-notice-policy-match.json"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "ruleMatches"
  ]
}

Example:

{
  "ruleMatches": [
    {
      "ruleLine": 4,
      "noticePolicyId": "16b88363-0d93-464a-967a-ad5ad0f9187c"
    },
    {
      "ruleLine": 1,
      "noticePolicyId": "122b3d2b-4788-4f1e-9117-56daa91cb75c"
    }
  ]
}

Response 422

Invalid id error.

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "An error",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "parameters": {
      "type": "object",
      "$ref": "parameters.schema"
    }
  },
  "required": [
    "message"
  ]
}

Example:

{
  "message": "Patron type id does not exist: 99"
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /circulation/requests

Retrieve a list of request items.

GET /circulation/requests
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.

    by 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 request items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Collection of item requests",
  "description": "Collection of item requests",
  "type": "object",
  "properties": {
    "requests": {
      "description": "Paged collection of item requests",
      "id": "requests",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "request.json"
      }
    },
    "totalRecords": {
      "description": "Total number of item requests",
      "type": "integer"
    }
  },
  "required": [
    "requests",
    "totalRecords"
  ]
}

Example:

{
  "requests": [
    {
      "id": "89105c06-dbdb-4aa0-9695-d4d19c733270",
      "requestType": "Recall",
      "requestDate": "2017-07-29T22:25:37Z",
      "requesterId": "21932a85-bd00-446b-9565-46e0c1a5490b",
      "itemId": "195efae1-588f-47bd-a181-13a2eb437701",
      "fulfilmentPreference": "Hold Shelf",
      "position": 1
    },
    {
      "id": "f5cec279-0da6-4b44-a3df-f49b0903f325",
      "requestType": "Hold",
      "requestDate": "2017-08-05T11:43:23Z",
      "requesterId": "61d939e4-f2ae-4c53-95d2-224a802fa2a6",
      "itemId": "3e5d5433-a271-499c-94f4-5f3e4652e537",
      "fulfilmentPreference": "Delivery",
      "requestExpirationDate": "2017-08-31T22:25:37Z",
      "holdShelfExpirationDate": "2017-09-01T22:25:37Z",
      "position": 1,
      "item": {
        "title": "Children of Time",
        "barcode": "760932543816",
        "copyNumbers": [
          "1",
          "2"
        ]
      },
      "requester": {
        "firstName": "Stephen",
        "lastName": "Jones",
        "middleName": "Anthony",
        "barcode": "567023127436"
      },
      "tags": {
        "tagList": [
          "new",
          "important"
        ]
      }
    }
  ],
  "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 requests -- 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 requests -- 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 /circulation/requests

Create a new request item.

POST /circulation/requests
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#",
  "title": "A request for an item",
  "description": "Request for an item that might be at a different location or already checked out to another patron",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of the request",
      "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}$"
    },
    "requestType": {
      "description": "Whether the item should be held upon return, recalled or paged for",
      "type": "string",
      "enum": ["Hold", "Recall", "Page"]
    },
    "requestDate": {
      "description": "Date the request was made",
      "type": "string",
      "format": "date-time"
    },
    "requesterId": {
      "description": "ID of the user who made the request",
      "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}$"
    },
    "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 being requested",
      "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}$"
    },
    "status": {
      "description": "Status of the request",
      "type": "string",
      "enum": [
        "Open - Not yet filled",
        "Open - Awaiting pickup",
        "Open - In transit",
        "Closed - Filled",
        "Closed - Cancelled"
      ]
    },
    "cancellationReasonId": {
      "description": "The id of the request reason",
      "type": "string"
    },
    "cancelledByUserId": {
      "description": "The id of the user that cancelled the request",
      "type": "string"
    },
    "cancellationAdditionalInformation": {
      "description": "Additional information about a cancellation",
      "type": "string"
    },
    "cancelledDate": {
      "description": "Date the request was cancelled",
      "type": "string",
      "format": "date-time"
    },
    "position": {
      "description": "position of the request in a per-item request queue",
      "type": "integer"
    },
    "item": {
      "description": "Information about the requested item (some of which is stored and used for searching and sorting)",
      "readOnly": true,
      "type": "object",
      "properties": {
        "title": {
          "description": "title of the item (stored)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode of the item (stored)",
          "type": "string",
          "readonly": true
        },
        "holdingsRecordId": {
          "description": "The ID of the holdings for the item",
          "type": "string",
          "readonly": true
        },
        "instanceId": {
          "description": "The ID of the instance for the item",
          "type": "string",
          "readonly": true
        },
        "location": {
          "description": "The effective location of the item",
          "type": "object",
          "readonly": true,
          "additionalProperties": false,
          "properties": {
            "name": {
              "type": "string",
              "description": "The name of the location",
              "readonly": true
            }
          }
        },
        "contributorNames": {
          "description": "A list of contributor names",
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "description": "The contributor name",
                "type": "string"
              }
            }
          }
        },
        "copyNumbers": {
          "type": "array",
          "description": "Copy numbers for the item",
          "items": {
            "type": "string"
          }
        },
        "enumeration": {
          "description": "The volume and/or issue number for the item",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "requester": {
      "description": "Copy of some requesting patron metadata (used for searching and sorting), will be taken from the user referred to by the requesterId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode of the patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "patronGroupId": {
          "description": "UUID for the patron group that this user belongs to",
          "type": "string"
        },
        "patronGroup": {
          "description": "record for the user's patron group",
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "description": "ID of the patron group",
              "type": "string"
            },
            "group": {
              "description": "The unique name of the patron group",
              "type": "string"
            },
            "desc": {
              "description": "A description of the patron group",
              "type": "string"
            }
          }
        }
      },
      "additionalProperties": false
    },
    "proxy": {
      "description": "Copy of some proxy patron metadata (used for searching and sorting), will be taken from the user referred to by the proxyUserId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the proxy patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the proxy patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the proxy patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode of the proxy patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "patronGroupId": {
          "description": "UUID for the patrongroup that this user belongs to",
          "type": "string"
        },
        "patronGroup": {
          "description": "record for the user's patrongroup",
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "description": "ID of the patrongroup",
              "type": "string"
            },
            "group": {
              "description": "The unique name of the patrongroup",
              "type": "string"
            },
            "desc": {
              "description": "A description of the patrongroup",
              "type": "string"
            }
          }
        }
      },
      "additionalProperties": false
    },
    "fulfilmentPreference": {
      "description": "How should the request be fulfilled (whether the item should be kept on the hold shelf for collection or delivered to the requester)",
      "type": "string",
      "enum": ["Hold Shelf", "Delivery"]
    },
    "deliveryAddressTypeId": {
      "description": "Deliver to the address of this type, for the requesting 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}$"
    },
    "deliveryAddress": {
      "description": "Address the item is to be delivered to (derived from requester information)",
      "type": "object",
      "properties": {
        "addressLine1": {
          "description": "Address line 1",
          "type": "string"
        },
        "addressLine2": {
          "description": "Address line 2",
          "type": "string"
        },
        "city": {
          "description": "City name",
          "type": "string"
        },
        "region": {
          "description": "Region",
          "type": "string"
        },
        "postalCode": {
          "description": "Postal code",
          "type": "string"
        },
        "countryId": {
          "description": "Country code",
          "type": "string"
        },
        "addressTypeId": {
          "description": "Type of address (refers to address types)",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "requestExpirationDate": {
      "description": "Date when the request expires",
      "type": "string",
      "format": "date-time"
    },
    "holdShelfExpirationDate": {
      "description": "Date when an item returned to the hold shelf expires",
      "type": "string",
      "format": "date-time"
    },
    "pickupServicePointId": {
      "description": "The ID of the Service Point where this request can be picked up",
      "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}$"
    },
    "pickupServicePoint": {
      "description": "The full object of the Service Point record from pickupServicePointId",
      "additionalProperties": false,
      "properties": {
        "name": {
          "description": "Unique name for the service point",
          "type": "string"
        },
        "code": {
          "description": "Unique code for the service point",
          "type": "string"
        },
        "discoveryDisplayName": {
          "description": "Human-readable name for the service point",
          "type": "string"
        },
        "description": {
          "description": "Description of the service point",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "Shelving lag time",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this service point a pickup location?",
          "type": "boolean"
        }
      }
    },
    "tags": {
      "type": "object",
      "description": "Tags",
      "$ref": "raml-util/schemas/tags.schema"
    },
    "metadata": {
      "description": "Metadata about creation and changes to requests, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "itemId",
    "requesterId",
    "requestType",
    "requestDate",
    "fulfilmentPreference"
  ]
}

Example:

{
  "id": "89105c06-dbdb-4aa0-9695-d4d19c733270",
  "requestType": "Recall",
  "requestDate": "2017-07-29T22:25:37Z",
  "requesterId": "21932a85-bd00-446b-9565-46e0c1a5490b",
  "itemId": "195efae1-588f-47bd-a181-13a2eb437701",
  "fulfilmentPreference": "Hold Shelf",
  "requestExpirationDate": "2017-07-25T22:25:37Z",
  "position": 1,
  "item": {
    "title": "Children of Time",
    "barcode": "760932543816",
    "location": {
      "name": "Main Library"
    },
    "copyNumbers": [
      "1",
      "2"
    ]
  },
  "tags": {
    "tagList": [
      "new",
      "important"
    ]
  }
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created request item

Body

Media type: application/json

Type: any

Example:

{
  "id": "89105c06-dbdb-4aa0-9695-d4d19c733270",
  "requestType": "Recall",
  "requestDate": "2017-07-29T22:25:37Z",
  "requesterId": "21932a85-bd00-446b-9565-46e0c1a5490b",
  "itemId": "195efae1-588f-47bd-a181-13a2eb437701",
  "fulfilmentPreference": "Hold Shelf",
  "requestExpirationDate": "2017-07-25T22:25:37Z",
  "position": 1,
  "item": {
    "title": "Children of Time",
    "barcode": "760932543816",
    "location": {
      "name": "Main Library"
    },
    "copyNumbers": [
      "1",
      "2"
    ]
  },
  "tags": {
    "tagList": [
      "new",
      "important"
    ]
  }
}

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

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

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

DELETE /circulation/requests

DELETE /circulation/requests
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

All requests deleted

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

Response 501

Not implemented yet

GET /circulation/requests/{requestId}

Retrieve request item with given {requestId}

GET /circulation/requests/{requestId}
URI Parameters
  • requestId: 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#",
  "title": "A request for an item",
  "description": "Request for an item that might be at a different location or already checked out to another patron",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of the request",
      "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}$"
    },
    "requestType": {
      "description": "Whether the item should be held upon return, recalled or paged for",
      "type": "string",
      "enum": ["Hold", "Recall", "Page"]
    },
    "requestDate": {
      "description": "Date the request was made",
      "type": "string",
      "format": "date-time"
    },
    "requesterId": {
      "description": "ID of the user who made the request",
      "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}$"
    },
    "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 being requested",
      "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}$"
    },
    "status": {
      "description": "Status of the request",
      "type": "string",
      "enum": [
        "Open - Not yet filled",
        "Open - Awaiting pickup",
        "Open - In transit",
        "Closed - Filled",
        "Closed - Cancelled"
      ]
    },
    "cancellationReasonId": {
      "description": "The id of the request reason",
      "type": "string"
    },
    "cancelledByUserId": {
      "description": "The id of the user that cancelled the request",
      "type": "string"
    },
    "cancellationAdditionalInformation": {
      "description": "Additional information about a cancellation",
      "type": "string"
    },
    "cancelledDate": {
      "description": "Date the request was cancelled",
      "type": "string",
      "format": "date-time"
    },
    "position": {
      "description": "position of the request in a per-item request queue",
      "type": "integer"
    },
    "item": {
      "description": "Information about the requested item (some of which is stored and used for searching and sorting)",
      "readOnly": true,
      "type": "object",
      "properties": {
        "title": {
          "description": "title of the item (stored)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode of the item (stored)",
          "type": "string",
          "readonly": true
        },
        "holdingsRecordId": {
          "description": "The ID of the holdings for the item",
          "type": "string",
          "readonly": true
        },
        "instanceId": {
          "description": "The ID of the instance for the item",
          "type": "string",
          "readonly": true
        },
        "location": {
          "description": "The effective location of the item",
          "type": "object",
          "readonly": true,
          "additionalProperties": false,
          "properties": {
            "name": {
              "type": "string",
              "description": "The name of the location",
              "readonly": true
            }
          }
        },
        "contributorNames": {
          "description": "A list of contributor names",
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "description": "The contributor name",
                "type": "string"
              }
            }
          }
        },
        "copyNumbers": {
          "type": "array",
          "description": "Copy numbers for the item",
          "items": {
            "type": "string"
          }
        },
        "enumeration": {
          "description": "The volume and/or issue number for the item",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "requester": {
      "description": "Copy of some requesting patron metadata (used for searching and sorting), will be taken from the user referred to by the requesterId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode of the patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "patronGroupId": {
          "description": "UUID for the patron group that this user belongs to",
          "type": "string"
        },
        "patronGroup": {
          "description": "record for the user's patron group",
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "description": "ID of the patron group",
              "type": "string"
            },
            "group": {
              "description": "The unique name of the patron group",
              "type": "string"
            },
            "desc": {
              "description": "A description of the patron group",
              "type": "string"
            }
          }
        }
      },
      "additionalProperties": false
    },
    "proxy": {
      "description": "Copy of some proxy patron metadata (used for searching and sorting), will be taken from the user referred to by the proxyUserId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the proxy patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the proxy patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the proxy patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode of the proxy patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "patronGroupId": {
          "description": "UUID for the patrongroup that this user belongs to",
          "type": "string"
        },
        "patronGroup": {
          "description": "record for the user's patrongroup",
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "description": "ID of the patrongroup",
              "type": "string"
            },
            "group": {
              "description": "The unique name of the patrongroup",
              "type": "string"
            },
            "desc": {
              "description": "A description of the patrongroup",
              "type": "string"
            }
          }
        }
      },
      "additionalProperties": false
    },
    "fulfilmentPreference": {
      "description": "How should the request be fulfilled (whether the item should be kept on the hold shelf for collection or delivered to the requester)",
      "type": "string",
      "enum": ["Hold Shelf", "Delivery"]
    },
    "deliveryAddressTypeId": {
      "description": "Deliver to the address of this type, for the requesting 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}$"
    },
    "deliveryAddress": {
      "description": "Address the item is to be delivered to (derived from requester information)",
      "type": "object",
      "properties": {
        "addressLine1": {
          "description": "Address line 1",
          "type": "string"
        },
        "addressLine2": {
          "description": "Address line 2",
          "type": "string"
        },
        "city": {
          "description": "City name",
          "type": "string"
        },
        "region": {
          "description": "Region",
          "type": "string"
        },
        "postalCode": {
          "description": "Postal code",
          "type": "string"
        },
        "countryId": {
          "description": "Country code",
          "type": "string"
        },
        "addressTypeId": {
          "description": "Type of address (refers to address types)",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "requestExpirationDate": {
      "description": "Date when the request expires",
      "type": "string",
      "format": "date-time"
    },
    "holdShelfExpirationDate": {
      "description": "Date when an item returned to the hold shelf expires",
      "type": "string",
      "format": "date-time"
    },
    "pickupServicePointId": {
      "description": "The ID of the Service Point where this request can be picked up",
      "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}$"
    },
    "pickupServicePoint": {
      "description": "The full object of the Service Point record from pickupServicePointId",
      "additionalProperties": false,
      "properties": {
        "name": {
          "description": "Unique name for the service point",
          "type": "string"
        },
        "code": {
          "description": "Unique code for the service point",
          "type": "string"
        },
        "discoveryDisplayName": {
          "description": "Human-readable name for the service point",
          "type": "string"
        },
        "description": {
          "description": "Description of the service point",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "Shelving lag time",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this service point a pickup location?",
          "type": "boolean"
        }
      }
    },
    "tags": {
      "type": "object",
      "description": "Tags",
      "$ref": "raml-util/schemas/tags.schema"
    },
    "metadata": {
      "description": "Metadata about creation and changes to requests, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "itemId",
    "requesterId",
    "requestType",
    "requestDate",
    "fulfilmentPreference"
  ]
}

Example:

{
  "id": "89105c06-dbdb-4aa0-9695-d4d19c733270",
  "requestType": "Recall",
  "requestDate": "2017-07-29T22:25:37Z",
  "requesterId": "21932a85-bd00-446b-9565-46e0c1a5490b",
  "itemId": "195efae1-588f-47bd-a181-13a2eb437701",
  "fulfilmentPreference": "Hold Shelf",
  "requestExpirationDate": "2017-07-25T22:25:37Z",
  "position": 1,
  "item": {
    "title": "Children of Time",
    "barcode": "760932543816",
    "location": {
      "name": "Main Library"
    },
    "copyNumbers": [
      "1",
      "2"
    ]
  },
  "tags": {
    "tagList": [
      "new",
      "important"
    ]
  }
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"request 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 /circulation/requests/{requestId}

Update request item with given {requestId}

PUT /circulation/requests/{requestId}
URI Parameters
  • requestId: 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#",
  "title": "A request for an item",
  "description": "Request for an item that might be at a different location or already checked out to another patron",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of the request",
      "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}$"
    },
    "requestType": {
      "description": "Whether the item should be held upon return, recalled or paged for",
      "type": "string",
      "enum": ["Hold", "Recall", "Page"]
    },
    "requestDate": {
      "description": "Date the request was made",
      "type": "string",
      "format": "date-time"
    },
    "requesterId": {
      "description": "ID of the user who made the request",
      "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}$"
    },
    "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 being requested",
      "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}$"
    },
    "status": {
      "description": "Status of the request",
      "type": "string",
      "enum": [
        "Open - Not yet filled",
        "Open - Awaiting pickup",
        "Open - In transit",
        "Closed - Filled",
        "Closed - Cancelled"
      ]
    },
    "cancellationReasonId": {
      "description": "The id of the request reason",
      "type": "string"
    },
    "cancelledByUserId": {
      "description": "The id of the user that cancelled the request",
      "type": "string"
    },
    "cancellationAdditionalInformation": {
      "description": "Additional information about a cancellation",
      "type": "string"
    },
    "cancelledDate": {
      "description": "Date the request was cancelled",
      "type": "string",
      "format": "date-time"
    },
    "position": {
      "description": "position of the request in a per-item request queue",
      "type": "integer"
    },
    "item": {
      "description": "Information about the requested item (some of which is stored and used for searching and sorting)",
      "readOnly": true,
      "type": "object",
      "properties": {
        "title": {
          "description": "title of the item (stored)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode of the item (stored)",
          "type": "string",
          "readonly": true
        },
        "holdingsRecordId": {
          "description": "The ID of the holdings for the item",
          "type": "string",
          "readonly": true
        },
        "instanceId": {
          "description": "The ID of the instance for the item",
          "type": "string",
          "readonly": true
        },
        "location": {
          "description": "The effective location of the item",
          "type": "object",
          "readonly": true,
          "additionalProperties": false,
          "properties": {
            "name": {
              "type": "string",
              "description": "The name of the location",
              "readonly": true
            }
          }
        },
        "contributorNames": {
          "description": "A list of contributor names",
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "description": "The contributor name",
                "type": "string"
              }
            }
          }
        },
        "copyNumbers": {
          "type": "array",
          "description": "Copy numbers for the item",
          "items": {
            "type": "string"
          }
        },
        "enumeration": {
          "description": "The volume and/or issue number for the item",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "requester": {
      "description": "Copy of some requesting patron metadata (used for searching and sorting), will be taken from the user referred to by the requesterId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode of the patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "patronGroupId": {
          "description": "UUID for the patron group that this user belongs to",
          "type": "string"
        },
        "patronGroup": {
          "description": "record for the user's patron group",
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "description": "ID of the patron group",
              "type": "string"
            },
            "group": {
              "description": "The unique name of the patron group",
              "type": "string"
            },
            "desc": {
              "description": "A description of the patron group",
              "type": "string"
            }
          }
        }
      },
      "additionalProperties": false
    },
    "proxy": {
      "description": "Copy of some proxy patron metadata (used for searching and sorting), will be taken from the user referred to by the proxyUserId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the proxy patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the proxy patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the proxy patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode of the proxy patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "patronGroupId": {
          "description": "UUID for the patrongroup that this user belongs to",
          "type": "string"
        },
        "patronGroup": {
          "description": "record for the user's patrongroup",
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "description": "ID of the patrongroup",
              "type": "string"
            },
            "group": {
              "description": "The unique name of the patrongroup",
              "type": "string"
            },
            "desc": {
              "description": "A description of the patrongroup",
              "type": "string"
            }
          }
        }
      },
      "additionalProperties": false
    },
    "fulfilmentPreference": {
      "description": "How should the request be fulfilled (whether the item should be kept on the hold shelf for collection or delivered to the requester)",
      "type": "string",
      "enum": ["Hold Shelf", "Delivery"]
    },
    "deliveryAddressTypeId": {
      "description": "Deliver to the address of this type, for the requesting 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}$"
    },
    "deliveryAddress": {
      "description": "Address the item is to be delivered to (derived from requester information)",
      "type": "object",
      "properties": {
        "addressLine1": {
          "description": "Address line 1",
          "type": "string"
        },
        "addressLine2": {
          "description": "Address line 2",
          "type": "string"
        },
        "city": {
          "description": "City name",
          "type": "string"
        },
        "region": {
          "description": "Region",
          "type": "string"
        },
        "postalCode": {
          "description": "Postal code",
          "type": "string"
        },
        "countryId": {
          "description": "Country code",
          "type": "string"
        },
        "addressTypeId": {
          "description": "Type of address (refers to address types)",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "requestExpirationDate": {
      "description": "Date when the request expires",
      "type": "string",
      "format": "date-time"
    },
    "holdShelfExpirationDate": {
      "description": "Date when an item returned to the hold shelf expires",
      "type": "string",
      "format": "date-time"
    },
    "pickupServicePointId": {
      "description": "The ID of the Service Point where this request can be picked up",
      "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}$"
    },
    "pickupServicePoint": {
      "description": "The full object of the Service Point record from pickupServicePointId",
      "additionalProperties": false,
      "properties": {
        "name": {
          "description": "Unique name for the service point",
          "type": "string"
        },
        "code": {
          "description": "Unique code for the service point",
          "type": "string"
        },
        "discoveryDisplayName": {
          "description": "Human-readable name for the service point",
          "type": "string"
        },
        "description": {
          "description": "Description of the service point",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "Shelving lag time",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this service point a pickup location?",
          "type": "boolean"
        }
      }
    },
    "tags": {
      "type": "object",
      "description": "Tags",
      "$ref": "raml-util/schemas/tags.schema"
    },
    "metadata": {
      "description": "Metadata about creation and changes to requests, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "itemId",
    "requesterId",
    "requestType",
    "requestDate",
    "fulfilmentPreference"
  ]
}

Example:

{
  "id": "89105c06-dbdb-4aa0-9695-d4d19c733270",
  "requestType": "Recall",
  "requestDate": "2017-07-29T22:25:37Z",
  "requesterId": "21932a85-bd00-446b-9565-46e0c1a5490b",
  "itemId": "195efae1-588f-47bd-a181-13a2eb437701",
  "fulfilmentPreference": "Hold Shelf",
  "requestExpirationDate": "2017-07-25T22:25:37Z",
  "position": 1,
  "item": {
    "title": "Children of Time",
    "barcode": "760932543816",
    "location": {
      "name": "Main Library"
    },
    "copyNumbers": [
      "1",
      "2"
    ]
  },
  "tags": {
    "tagList": [
      "new",
      "important"
    ]
  }
}

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

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

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

DELETE /circulation/requests/{requestId}

Delete request item with given {requestId}

DELETE /circulation/requests/{requestId}
URI Parameters
  • requestId: 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 request -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"request 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 /circulation/requests/queue/{itemId}

Retrieve queue item with given {queueId}

GET /circulation/requests/queue/{itemId}
URI Parameters
  • itemId: 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#",
  "title": "Collection of item requests",
  "description": "Collection of item requests",
  "type": "object",
  "properties": {
    "requests": {
      "description": "Paged collection of item requests",
      "id": "requests",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "request.json"
      }
    },
    "totalRecords": {
      "description": "Total number of item requests",
      "type": "integer"
    }
  },
  "required": [
    "requests",
    "totalRecords"
  ]
}

Example:

{
  "requests": [
    {
      "id": "89105c06-dbdb-4aa0-9695-d4d19c733270",
      "requestType": "Recall",
      "requestDate": "2017-07-29T22:25:37Z",
      "requesterId": "21932a85-bd00-446b-9565-46e0c1a5490b",
      "itemId": "195efae1-588f-47bd-a181-13a2eb437701",
      "fulfilmentPreference": "Hold Shelf",
      "position": 1
    },
    {
      "id": "f5cec279-0da6-4b44-a3df-f49b0903f325",
      "requestType": "Hold",
      "requestDate": "2017-08-05T11:43:23Z",
      "requesterId": "61d939e4-f2ae-4c53-95d2-224a802fa2a6",
      "itemId": "195efae1-588f-47bd-a181-13a2eb437701",
      "fulfilmentPreference": "Delivery",
      "position": 2
    },
    {
      "id": "666e788f-1d9c-4846-b347-c40e711153fb",
      "requestType": "Hold",
      "requestDate": "2018-01-02T16:35:27Z",
      "requesterId": "08876b22-8572-4b35-b25e-afc45c8e6e61",
      "itemId": "195efae1-588f-47bd-a181-13a2eb437701",
      "fulfilmentPreference": "Hold Shelf",
      "position": 3
    }
  ],
  "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 queue -- 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 queue -- unauthorized"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

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

POST /circulation/requests/instances

Creates a request for a specific item from the given instance ID

POST /circulation/requests/instances
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "A request for an item based on the specified instance ID",
  "description": "Request for an item selected from the that might be at a different location or already checked out to another patron",
  "type": "object",
  "properties": {
    "requestDate": {
      "description": "Date the request was made",
      "type": "string",
      "format": "date-time"
    },
    "requesterId": {
      "description": "ID of the user who made the request",
      "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}$"
    },
    "instanceId": {
      "description": "ID of the instance being requested",
      "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}$"
    },
    "requestExpirationDate": {
      "description": "Date when the request expires",
      "type": "string",
      "format": "date-time"
    },
    "pickupServicePointId": {
      "description": "The ID of the Service Point where this request can be picked up",
      "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}$"
    }
  },
  "additionalProperties": false,
  "required": [
    "instanceId",
    "requesterId",
    "requestDate",
    "pickupServicePointId"
  ]
}

Example:

{
  "requestDate": "2017-07-29T22:25:37Z",
  "requesterId": "21932a85-bd00-446b-9565-46e0c1a5490b",
  "instanceId": "195efae1-588f-47bd-a181-13a2eb437701",
  "requestExpirationDate": "2017-07-25T22:25:37Z",
  "pickupServicePointId": "8359f2bc-b83e-48e1-8a5b-ca1a74e840de"
}

Response 201

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "A request for an item",
  "description": "Request for an item that might be at a different location or already checked out to another patron",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of the request",
      "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}$"
    },
    "requestType": {
      "description": "Whether the item should be held upon return, recalled or paged for",
      "type": "string",
      "enum": ["Hold", "Recall", "Page"]
    },
    "requestDate": {
      "description": "Date the request was made",
      "type": "string",
      "format": "date-time"
    },
    "requesterId": {
      "description": "ID of the user who made the request",
      "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}$"
    },
    "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 being requested",
      "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}$"
    },
    "status": {
      "description": "Status of the request",
      "type": "string",
      "enum": [
        "Open - Not yet filled",
        "Open - Awaiting pickup",
        "Open - In transit",
        "Closed - Filled",
        "Closed - Cancelled"
      ]
    },
    "cancellationReasonId": {
      "description": "The id of the request reason",
      "type": "string"
    },
    "cancelledByUserId": {
      "description": "The id of the user that cancelled the request",
      "type": "string"
    },
    "cancellationAdditionalInformation": {
      "description": "Additional information about a cancellation",
      "type": "string"
    },
    "cancelledDate": {
      "description": "Date the request was cancelled",
      "type": "string",
      "format": "date-time"
    },
    "position": {
      "description": "position of the request in a per-item request queue",
      "type": "integer"
    },
    "item": {
      "description": "Information about the requested item (some of which is stored and used for searching and sorting)",
      "readOnly": true,
      "type": "object",
      "properties": {
        "title": {
          "description": "title of the item (stored)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode of the item (stored)",
          "type": "string",
          "readonly": true
        },
        "holdingsRecordId": {
          "description": "The ID of the holdings for the item",
          "type": "string",
          "readonly": true
        },
        "instanceId": {
          "description": "The ID of the instance for the item",
          "type": "string",
          "readonly": true
        },
        "location": {
          "description": "The effective location of the item",
          "type": "object",
          "readonly": true,
          "additionalProperties": false,
          "properties": {
            "name": {
              "type": "string",
              "description": "The name of the location",
              "readonly": true
            }
          }
        },
        "contributorNames": {
          "description": "A list of contributor names",
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "description": "The contributor name",
                "type": "string"
              }
            }
          }
        },
        "copyNumbers": {
          "type": "array",
          "description": "Copy numbers for the item",
          "items": {
            "type": "string"
          }
        },
        "enumeration": {
          "description": "The volume and/or issue number for the item",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "requester": {
      "description": "Copy of some requesting patron metadata (used for searching and sorting), will be taken from the user referred to by the requesterId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode of the patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "patronGroupId": {
          "description": "UUID for the patron group that this user belongs to",
          "type": "string"
        },
        "patronGroup": {
          "description": "record for the user's patron group",
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "description": "ID of the patron group",
              "type": "string"
            },
            "group": {
              "description": "The unique name of the patron group",
              "type": "string"
            },
            "desc": {
              "description": "A description of the patron group",
              "type": "string"
            }
          }
        }
      },
      "additionalProperties": false
    },
    "proxy": {
      "description": "Copy of some proxy patron metadata (used for searching and sorting), will be taken from the user referred to by the proxyUserId",
      "readonly": true,
      "type": "object",
      "properties": {
        "firstName": {
          "description": "first name of the proxy patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "lastName": {
          "description": "last name of the proxy patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "middleName": {
          "description": "middle name of the proxy patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "barcode": {
          "description": "barcode of the proxy patron (read only, defined by the server)",
          "type": "string",
          "readonly": true
        },
        "patronGroupId": {
          "description": "UUID for the patrongroup that this user belongs to",
          "type": "string"
        },
        "patronGroup": {
          "description": "record for the user's patrongroup",
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "description": "ID of the patrongroup",
              "type": "string"
            },
            "group": {
              "description": "The unique name of the patrongroup",
              "type": "string"
            },
            "desc": {
              "description": "A description of the patrongroup",
              "type": "string"
            }
          }
        }
      },
      "additionalProperties": false
    },
    "fulfilmentPreference": {
      "description": "How should the request be fulfilled (whether the item should be kept on the hold shelf for collection or delivered to the requester)",
      "type": "string",
      "enum": ["Hold Shelf", "Delivery"]
    },
    "deliveryAddressTypeId": {
      "description": "Deliver to the address of this type, for the requesting 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}$"
    },
    "deliveryAddress": {
      "description": "Address the item is to be delivered to (derived from requester information)",
      "type": "object",
      "properties": {
        "addressLine1": {
          "description": "Address line 1",
          "type": "string"
        },
        "addressLine2": {
          "description": "Address line 2",
          "type": "string"
        },
        "city": {
          "description": "City name",
          "type": "string"
        },
        "region": {
          "description": "Region",
          "type": "string"
        },
        "postalCode": {
          "description": "Postal code",
          "type": "string"
        },
        "countryId": {
          "description": "Country code",
          "type": "string"
        },
        "addressTypeId": {
          "description": "Type of address (refers to address types)",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "requestExpirationDate": {
      "description": "Date when the request expires",
      "type": "string",
      "format": "date-time"
    },
    "holdShelfExpirationDate": {
      "description": "Date when an item returned to the hold shelf expires",
      "type": "string",
      "format": "date-time"
    },
    "pickupServicePointId": {
      "description": "The ID of the Service Point where this request can be picked up",
      "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}$"
    },
    "pickupServicePoint": {
      "description": "The full object of the Service Point record from pickupServicePointId",
      "additionalProperties": false,
      "properties": {
        "name": {
          "description": "Unique name for the service point",
          "type": "string"
        },
        "code": {
          "description": "Unique code for the service point",
          "type": "string"
        },
        "discoveryDisplayName": {
          "description": "Human-readable name for the service point",
          "type": "string"
        },
        "description": {
          "description": "Description of the service point",
          "type": "string"
        },
        "shelvingLagTime": {
          "description": "Shelving lag time",
          "type": "integer"
        },
        "pickupLocation": {
          "description": "Is this service point a pickup location?",
          "type": "boolean"
        }
      }
    },
    "tags": {
      "type": "object",
      "description": "Tags",
      "$ref": "raml-util/schemas/tags.schema"
    },
    "metadata": {
      "description": "Metadata about creation and changes to requests, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "itemId",
    "requesterId",
    "requestType",
    "requestDate",
    "fulfilmentPreference"
  ]
}

Example:

{
  "id": "89105c06-dbdb-4aa0-9695-d4d19c733270",
  "requestType": "Recall",
  "requestDate": "2017-07-29T22:25:37Z",
  "requesterId": "21932a85-bd00-446b-9565-46e0c1a5490b",
  "itemId": "195efae1-588f-47bd-a181-13a2eb437701",
  "fulfilmentPreference": "Hold Shelf",
  "requestExpirationDate": "2017-07-25T22:25:37Z",
  "position": 1,
  "item": {
    "title": "Children of Time",
    "barcode": "760932543816",
    "location": {
      "name": "Main Library"
    },
    "copyNumbers": [
      "1",
      "2"
    ]
  },
  "tags": {
    "tagList": [
      "new",
      "important"
    ]
  }
}

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error