RERO ILS Data Model

Added on Oct. 19, 2026 • Managed by admin

loans

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Schema for loan",
  "description": "Describes the status of a circulation operation, i.e. an interaction between a patron and an item. For example, when a patron requests an item, a loan resource is created. It links the patron to the item and changes status according to the operations performed: PENDING, ITEM_ON_LOAN, etc.",
  "type": "object",
  "required": [
    "pid",
    "$schema",
    "state"
  ],
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "type": "string",
      "title": "Schema"
    },
    "item": {
      "title": "Item",
      "type": "object",
      "properties": {
        "$ref": {
          "title": "Item URI",
          "type": "string",
          "pattern": "^https://bib.rero.ch/api/items/.+?$",
          "default": "https://bib.rero.ch/api/items/"
        }
      }
    },
    "patron": {
      "title": "Patron",
      "type": "object",
      "properties": {
        "$ref": {
          "title": "Patron URI",
          "type": "string",
          "pattern": "^https://bib.rero.ch/api/patrons/.+?$",
          "default": "https://bib.rero.ch/api/patrons/"
        }
      }
    },
    "document": {
      "title": "Document",
      "type": "object",
      "properties": {
        "$ref": {
          "title": "Document URI",
          "type": "string",
          "pattern": "^https://bib.rero.ch/api/documents/.+?$",
          "default": "https://bib.rero.ch/api/documents/"
        }
      }
    },
    "auto_extend": {
      "type": "boolean",
      "title": "Defines if the latest renewal was automatic or manual."
    },
    "extension_count": {
      "type": "integer",
      "title": "Loan extension count"
    },
    "pid": {
      "type": "string",
      "title": "Loan PID"
    },
    "transaction_date": {
      "type": "string",
      "format": "date-time",
      "title": "Loan date"
    },
    "patron_pid": {
      "type": "string",
      "title": "Patron PID"
    },
    "document_pid": {
      "type": "string",
      "title": "Document PID"
    },
    "item_pid": {
      "properties": {
        "type": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      },
      "title": "Item ID",
      "type": "object"
    },
    "transaction_user_pid": {
      "type": "string",
      "title": "Transaction user PID"
    },
    "transaction_location_pid": {
      "type": "string",
      "title": "Transaction location PID"
    },
    "checkout_location_pid": {
      "type": "string",
      "title": "Checkout location PID"
    },
    "pickup_location_pid": {
      "type": "string",
      "title": "Request pickup location PID"
    },
    "selfcheck_terminal_id": {
      "type": "string",
      "title": "Selfcheck terminal id"
    },
    "start_date": {
      "type": "string",
      "format": "date-time",
      "title": "Transaction start datetime"
    },
    "end_date": {
      "type": "string",
      "format": "date-time",
      "title": "Transaction end datetime"
    },
    "last_end_date": {
      "type": "string",
      "format": "date-time",
      "title": "Last end date of loan"
    },
    "due_soon_date": {
      "type": "string",
      "format": "date-time",
      "title": "Due Soon Date"
    },
    "request_expire_date": {
      "format": "date-time",
      "title": "Request expire datetime",
      "type": "string"
    },
    "request_start_date": {
      "format": "date-time",
      "title": "Request start datetime",
      "type": "string"
    },
    "organisation": {
      "title": "Organisation",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "$ref"
      ],
      "properties": {
        "$ref": {
          "title": "Organisation URI",
          "type": "string",
          "pattern": "^https://bib.rero.ch/api/organisations/.*?$"
        }
      }
    },
    "to_anonymize": {
      "title": "Set loan to be anonymized",
      "type": "boolean",
      "default": false
    },
    "state": {
      "type": "string",
      "title": "State name",
      "enum": [
        "CREATED",
        "PENDING",
        "ITEM_ON_LOAN",
        "ITEM_RETURNED",
        "ITEM_IN_TRANSIT_FOR_PICKUP",
        "ITEM_IN_TRANSIT_TO_HOUSE",
        "ITEM_AT_DESK",
        "CANCELLED"
      ],
      "widget": {
        "formlyConfig": {
          "type": "select",
          "props": {
            "sort": true,
            "options": [
              {
                "label": "CREATED",
                "value": "CREATED"
              },
              {
                "label": "PENDING",
                "value": "PENDING"
              },
              {
                "label": "ITEM_ON_LOAN",
                "value": "ITEM_ON_LOAN"
              },
              {
                "label": "ITEM_RETURNED",
                "value": "ITEM_RETURNED"
              },
              {
                "label": "ITEM_IN_TRANSIT_FOR_PICKUP",
                "value": "ITEM_IN_TRANSIT_FOR_PICKUP"
              },
              {
                "label": "ITEM_IN_TRANSIT_TO_HOUSE",
                "value": "ITEM_IN_TRANSIT_TO_HOUSE"
              },
              {
                "label": "ITEM_AT_DESK",
                "value": "ITEM_AT_DESK"
              },
              {
                "label": "CANCELLED",
                "value": "CANCELLED"
              }
            ]
          }
        }
      }
    },
    "trigger": {
      "type": "string",
      "title": "The name of the explicit action that triggered the transition to current state"
    }
  }
}

View source