Pieces (v1)

https://github.com/folio-org/mod-orders

Table of contents

Orders Business Logic API

API for managing pieces

Pieces

Create piece record

GET /orders/pieces

Retrieve a list of piece items.

GET /orders/pieces
Query Parameters
  • offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)

    Skip over a number of elements by specifying an offset value for the query

    Example:

    0
  • limit: (integer - default: 10 - minimum: 0 - maximum: 2147483647)

    Limit the number of elements returned in the response

    Example:

    10
  • query: (string)

    A query expressed as a CQL string (see dev.folio.org/reference/glossary#cql) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.

    using CQL (indexes for piece records)

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    format=="Physical"
    
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns a list of piece items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "collection of piece records",
  "type": "object",
  "properties": {
    "pieces": {
      "description": "collection of piece records",
      "type": "array",
      "id": "pieces",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Piece details",
        "properties": {
          "id": {
            "description": "UUID of this piece record",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "caption": {
            "description": "Volume/enumeration information",
            "type": "string"
          },
          "comment": {
            "description": "Free form commentary",
            "type": "string"
          },
          "format": {
            "description": "The format of the piece",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "enum": [
              "Physical",
              "Electronic",
              "Other"
            ]
          },
          "itemId": {
            "description": "UUID of the associated item record",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "locationId": {
            "description": "UUID of the (inventory) location record",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "poLineId": {
            "description": "UUID of the purchase order line this record is associated with",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "titleId": {
            "description": "UUID of the title record",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "holdingId": {
            "description": "UUID of the holding record",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "displayOnHolding": {
            "description": "Whether or not receiving history should be displayed in holding record view",
            "type": "boolean",
            "default": "false"
          },
          "enumeration": {
            "type": "string",
            "description": "Enumeration is the descriptive information for the numbering scheme of a serial. Synchronized with inventory item."
          },
          "chronology": {
            "type": "string",
            "description": "Chronology is the descriptive information for the dating scheme of a serial. Synchronized with inventory item."
          },
          "discoverySuppress": {
            "type": "boolean",
            "description": "Records the fact that the record should not be displayed in a discovery system"
          },
          "copyNumber": {
            "type": "string",
            "description": "Copy number of the piece"
          },
          "receivingStatus": {
            "description": "the status of this piece",
            "type": "string",
            "enum": [
              "Received",
              "Expected"
            ],
            "default": "Expected"
          },
          "supplement": {
            "description": "Whether or not this is supplementary material",
            "type": "boolean"
          },
          "receiptDate": {
            "description": "Date that associated item is expected to arrive",
            "type": "string",
            "format": "date-time"
          },
          "receivedDate": {
            "description": "The date associated item is actually received",
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "required": [
          "format",
          "poLineId",
          "titleId",
          "receivingStatus"
        ]
      }
    },
    "totalRecords": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false
}

Example:

{
  "pieces":
    [
     {
        "id": "5e317dc2-deeb-4429-b2a1-91e5cd0fd5f7",
        "caption": "Tutorial Volume 1",
        "comment": "Special Edition",
        "format": "Electronic",
        "itemId": "522a501a-56b5-48d9-b28a-3a8f02482d97",
        "locationId": "53cf956f-c1df-410b-8bea-27f712cca7c0",
        "poLineId": "d471d766-8dbb-4609-999a-02681dea6c22",
        "titleId": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
        "displayOnHolding": "false",
        "enumeration": "Volume 1",
        "chronology": "2021",
        "discoverySuppress": "false",
        "copyNumber": "175143",
        "receiptDate": "2020-01-10T00:00:00.000Z",
        "receivingStatus": "Expected",
        "supplement": true
     },
     {
        "id": "9ff85e44-a7e2-44b8-86e4-1ab8e9862f22",
        "caption": "Tutorial Volume 2",
        "comment": "Limited edition",
        "format": "Physical",
        "itemId": "fefa55b1-a4b3-4f2f-b7a0-39efd7cab54c",
        "locationId": "26241f60-5b96-4c10-9873-dcf4343691db",
        "poLineId": "3622bc51-d579-48e4-a1c7-1bcdea42be97",
        "titleId": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
        "displayOnHolding": "false",
        "enumeration": "Volume 2",
        "chronology": "2021",
        "discoverySuppress": "false",
        "copyNumber": "186323",
        "receiptDate": "2018-10-11T00:00:00.000Z",
        "receivingStatus": "Received",
        "supplement": true,
        "receivedDate": "2018-10-10T00:00:00.000Z"
      },
      {
        "id": "fabc8ce7-e168-43e6-a079-b214231b8001",
        "caption": "Tutorial Volume 3",
        "comment": "Deluxe Edition",
        "format": "Other",
        "poLineId": "d471d766-8dbb-4609-999a-02681dea6c22",
        "titleId": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
        "holdingId": "df798357-0bda-4ad4-b0a3-86f5edec3703",
        "displayOnHolding": "true",
        "enumeration": "Volume 3",
        "chronology": "2022",
        "discoverySuppress": "true",
        "copyNumber": "108572",
        "receivingStatus": "Received",
        "supplement": true,
        "receiptDate": "2018-10-11T00:00:00.000Z",
        "receivedDate": "2018-10-10T00:00:00.000Z"
      }
    ],
  "totalRecords": 3
}

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: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

unable to list pieces -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

unable to list pieces -- unauthorized

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.schema",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "id": "error.schema",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /orders/pieces

Create piece record

POST /orders/pieces
Query Parameters
  • createItem: (boolean - default: false)

    Should item will be created for piece

    Example:

    true
  • 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#",
  "description": "Piece details",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this piece record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "caption": {
      "description": "Volume/enumeration information",
      "type": "string"
    },
    "comment": {
      "description": "Free form commentary",
      "type": "string"
    },
    "format": {
      "description": "The format of the piece",
      "type": "string",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "enum": [
        "Physical",
        "Electronic",
        "Other"
      ]
    },
    "itemId": {
      "description": "UUID of the associated item record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "locationId": {
      "description": "UUID of the (inventory) location record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "poLineId": {
      "description": "UUID of the purchase order line this record is associated with",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "titleId": {
      "description": "UUID of the title record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "holdingId": {
      "description": "UUID of the holding record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "displayOnHolding": {
      "description": "Whether or not receiving history should be displayed in holding record view",
      "type": "boolean",
      "default": "false"
    },
    "enumeration": {
      "type": "string",
      "description": "Enumeration is the descriptive information for the numbering scheme of a serial. Synchronized with inventory item."
    },
    "chronology": {
      "type": "string",
      "description": "Chronology is the descriptive information for the dating scheme of a serial. Synchronized with inventory item."
    },
    "discoverySuppress": {
      "type": "boolean",
      "description": "Records the fact that the record should not be displayed in a discovery system"
    },
    "copyNumber": {
      "type": "string",
      "description": "Copy number of the piece"
    },
    "receivingStatus": {
      "description": "the status of this piece",
      "type": "string",
      "enum": [
        "Received",
        "Expected"
      ],
      "default": "Expected"
    },
    "supplement": {
      "description": "Whether or not this is supplementary material",
      "type": "boolean"
    },
    "receiptDate": {
      "description": "Date that associated item is expected to arrive",
      "type": "string",
      "format": "date-time"
    },
    "receivedDate": {
      "description": "The date associated item is actually received",
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": false,
  "required": [
    "format",
    "poLineId",
    "titleId",
    "receivingStatus"
  ]
}

Example:

{
  "id": "5e317dc2-deeb-4429-b2a1-91e5cd0fd5f7",
  "caption": "Tutorial Volume 5",
  "comment": "Special Edition",
  "format": "Electronic",
  "itemId": "522a501a-56b5-48d9-b28a-3a8f02482d97",
  "locationId": "53cf956f-c1df-410b-8bea-27f712cca7c0",
  "poLineId": "d471d766-8dbb-4609-999a-02681dea6c22",
  "titleId": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
  "displayOnHolding": "false",
  "enumeration": "Volume 1",
  "chronology": "2021",
  "discoverySuppress": "false",
  "copyNumber": "94753",
  "receivingStatus": "Expected",
  "supplement": true,
  "receiptDate": "2018-10-11T00:00:00.000Z"
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created piece item

Body

Media type: application/json

Type: any

Example:

{
  "id": "5e317dc2-deeb-4429-b2a1-91e5cd0fd5f7",
  "caption": "Tutorial Volume 5",
  "comment": "Special Edition",
  "format": "Electronic",
  "itemId": "522a501a-56b5-48d9-b28a-3a8f02482d97",
  "locationId": "53cf956f-c1df-410b-8bea-27f712cca7c0",
  "poLineId": "d471d766-8dbb-4609-999a-02681dea6c22",
  "titleId": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
  "displayOnHolding": "false",
  "enumeration": "Volume 1",
  "chronology": "2021",
  "discoverySuppress": "false",
  "copyNumber": "94753",
  "receivingStatus": "Expected",
  "supplement": true,
  "receiptDate": "2018-10-11T00:00:00.000Z"
}

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: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"unable to add piece -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

unable to create pieces -- unauthorized

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.schema",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "id": "error.schema",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /orders/pieces/{id}

Return a piece record with given {id}

GET /orders/pieces/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a piece record

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#",
  "description": "Piece details",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this piece record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "caption": {
      "description": "Volume/enumeration information",
      "type": "string"
    },
    "comment": {
      "description": "Free form commentary",
      "type": "string"
    },
    "format": {
      "description": "The format of the piece",
      "type": "string",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "enum": [
        "Physical",
        "Electronic",
        "Other"
      ]
    },
    "itemId": {
      "description": "UUID of the associated item record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "locationId": {
      "description": "UUID of the (inventory) location record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "poLineId": {
      "description": "UUID of the purchase order line this record is associated with",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "titleId": {
      "description": "UUID of the title record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "holdingId": {
      "description": "UUID of the holding record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "displayOnHolding": {
      "description": "Whether or not receiving history should be displayed in holding record view",
      "type": "boolean",
      "default": "false"
    },
    "enumeration": {
      "type": "string",
      "description": "Enumeration is the descriptive information for the numbering scheme of a serial. Synchronized with inventory item."
    },
    "chronology": {
      "type": "string",
      "description": "Chronology is the descriptive information for the dating scheme of a serial. Synchronized with inventory item."
    },
    "discoverySuppress": {
      "type": "boolean",
      "description": "Records the fact that the record should not be displayed in a discovery system"
    },
    "copyNumber": {
      "type": "string",
      "description": "Copy number of the piece"
    },
    "receivingStatus": {
      "description": "the status of this piece",
      "type": "string",
      "enum": [
        "Received",
        "Expected"
      ],
      "default": "Expected"
    },
    "supplement": {
      "description": "Whether or not this is supplementary material",
      "type": "boolean"
    },
    "receiptDate": {
      "description": "Date that associated item is expected to arrive",
      "type": "string",
      "format": "date-time"
    },
    "receivedDate": {
      "description": "The date associated item is actually received",
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": false,
  "required": [
    "format",
    "poLineId",
    "titleId",
    "receivingStatus"
  ]
}

Example:

{
  "id": "5e317dc2-deeb-4429-b2a1-91e5cd0fd5f7",
  "caption": "Tutorial Volume 5",
  "comment": "Special Edition",
  "format": "Electronic",
  "itemId": "522a501a-56b5-48d9-b28a-3a8f02482d97",
  "locationId": "53cf956f-c1df-410b-8bea-27f712cca7c0",
  "poLineId": "d471d766-8dbb-4609-999a-02681dea6c22",
  "titleId": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
  "displayOnHolding": "false",
  "enumeration": "Volume 1",
  "chronology": "2021",
  "discoverySuppress": "false",
  "copyNumber": "94753",
  "receivingStatus": "Expected",
  "supplement": true,
  "receiptDate": "2018-10-11T00:00:00.000Z"
}

Response 404

Item with a given ID not found

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"piece not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.schema",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "id": "error.schema",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

PUT /orders/pieces/{id}

Update a piece record with given {id}

PUT /orders/pieces/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a piece record

Query Parameters
  • createItem: (boolean - default: false)

    Should item will be created for piece

    Example:

    true
  • 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#",
  "description": "Piece details",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this piece record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "caption": {
      "description": "Volume/enumeration information",
      "type": "string"
    },
    "comment": {
      "description": "Free form commentary",
      "type": "string"
    },
    "format": {
      "description": "The format of the piece",
      "type": "string",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "enum": [
        "Physical",
        "Electronic",
        "Other"
      ]
    },
    "itemId": {
      "description": "UUID of the associated item record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "locationId": {
      "description": "UUID of the (inventory) location record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "poLineId": {
      "description": "UUID of the purchase order line this record is associated with",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "titleId": {
      "description": "UUID of the title record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "holdingId": {
      "description": "UUID of the holding record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "displayOnHolding": {
      "description": "Whether or not receiving history should be displayed in holding record view",
      "type": "boolean",
      "default": "false"
    },
    "enumeration": {
      "type": "string",
      "description": "Enumeration is the descriptive information for the numbering scheme of a serial. Synchronized with inventory item."
    },
    "chronology": {
      "type": "string",
      "description": "Chronology is the descriptive information for the dating scheme of a serial. Synchronized with inventory item."
    },
    "discoverySuppress": {
      "type": "boolean",
      "description": "Records the fact that the record should not be displayed in a discovery system"
    },
    "copyNumber": {
      "type": "string",
      "description": "Copy number of the piece"
    },
    "receivingStatus": {
      "description": "the status of this piece",
      "type": "string",
      "enum": [
        "Received",
        "Expected"
      ],
      "default": "Expected"
    },
    "supplement": {
      "description": "Whether or not this is supplementary material",
      "type": "boolean"
    },
    "receiptDate": {
      "description": "Date that associated item is expected to arrive",
      "type": "string",
      "format": "date-time"
    },
    "receivedDate": {
      "description": "The date associated item is actually received",
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": false,
  "required": [
    "format",
    "poLineId",
    "titleId",
    "receivingStatus"
  ]
}

Example:

{
  "id": "5e317dc2-deeb-4429-b2a1-91e5cd0fd5f7",
  "caption": "Tutorial Volume 5",
  "comment": "Special Edition",
  "format": "Electronic",
  "itemId": "522a501a-56b5-48d9-b28a-3a8f02482d97",
  "locationId": "53cf956f-c1df-410b-8bea-27f712cca7c0",
  "poLineId": "d471d766-8dbb-4609-999a-02681dea6c22",
  "titleId": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
  "displayOnHolding": "false",
  "enumeration": "Volume 1",
  "chronology": "2021",
  "discoverySuppress": "false",
  "copyNumber": "94753",
  "receivingStatus": "Expected",
  "supplement": true,
  "receiptDate": "2018-10-11T00:00:00.000Z"
}

Response 204

Piece record successfully updated

Response 400

Bad request

Body

Media type: application/json

Type: any

Example:

{
  "errors": [
    {
      "message": "Bad URL request",
      "code": "pieceNotFound"
    }
  ]
}

Media type: text/plain

Type: any

Example:

unable to create Piece -- Bad request

Response 404

Request id does not exists

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"piece not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.schema",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "id": "error.schema",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

{
  "errors": [
    {
      "message": "Internal server error, contact administrator",
      "code": "genericError"
    }
  ]
}

Media type: text/plain

Type: any

Example:

unable to create Piece -- Internal server error, e.g. due to misconfiguration

DELETE /orders/pieces/{id}

Delete a piece with given {id}

DELETE /orders/pieces/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a piece record

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

    Requested language. Optional. [lang=en]

Response 204

Piece record successfully deleted

Response 400

Bad request

Body

Media type: application/json

Type: any

Example:

{
  "errors": [
    {
      "message": "Bad URL request",
      "code": "pieceNotFound"
    }
  ]
}

Media type: text/plain

Type: any

Example:

unable to delete Piece -- Bad request

Response 404

Request id does not exists

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"piece not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.schema",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "id": "error.schema",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

{
  "errors": [
    {
      "message": "Internal server error, contact administrator",
      "code": "genericError"
    }
  ]
}

Media type: text/plain

Type: any

Example:

unable to delete Piece -- Internal server error, e.g. due to misconfiguration