Orders Storage (v3.1)

http://github.com/org/folio/mod-orders-storage

Table of contents

Pieces

CRUD API to manage Pieces. This API is intended for internal use only. Please use the /orders/pieces, /orders/receiving, /orders/check-in, and /orders/receiving-history APIs provided by mod-orders instead.

/orders-storage/pieces

Collection of piece items.

GET /orders-storage/pieces

Get list of pieces

GET /orders-storage/pieces
Query Parameters
  • query: (string)

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

    with valid searchable fields: for example code

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    ["code", "MEDGRANT", "="]
    
  • 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
  • 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",
        "$ref": "piece.json"
      }
    },
    "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",
        "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",
        "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",
        "receivingStatus": "Received",
        "supplement": true,
        "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: 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: text/plain

Type: any

Example:

unable to list pieces -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /orders-storage/pieces

Create a new piece item.

POST /orders-storage/pieces
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#",
  "description": "Piece details",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this piece record",
      "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",
      "$ref": "piece_format.json"
    },
    "itemId": {
      "description": "UUID of the associated item record",
      "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",
      "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",
      "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}$"
    },
     "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"
    },
    "receivedDate": {
      "description": "date received",
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": false,
  "required": [
    "poLineId",
    "receivingStatus",
    "format"
  ]
}

Example:

{
  "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",
  "receivingStatus": "Expected",
  "supplement": true,
  "receivedDate": "2018-10-10T00: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:

{
  "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",
  "receivingStatus": "Expected",
  "supplement": true,
  "receivedDate": "2018-10-10T00: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: 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: text/plain

Type: any

Example:

unable to create pieces -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /orders-storage/pieces/{id}

Retrieve piece item with given {pieceId}

GET /orders-storage/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

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",
      "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",
      "$ref": "piece_format.json"
    },
    "itemId": {
      "description": "UUID of the associated item record",
      "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",
      "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",
      "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}$"
    },
     "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"
    },
    "receivedDate": {
      "description": "date received",
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": false,
  "required": [
    "poLineId",
    "receivingStatus",
    "format"
  ]
}

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",
  "receivingStatus": "Expected",
  "supplement": true,
  "receivedDate": "2018-10-10T00:00:00.000Z"
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

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

DELETE /orders-storage/pieces/{id}

Delete piece item with given {pieceId}

DELETE /orders-storage/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

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 piece -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

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

PUT /orders-storage/pieces/{id}

Update piece item with given {pieceId}

PUT /orders-storage/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

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#",
  "description": "Piece details",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this piece record",
      "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",
      "$ref": "piece_format.json"
    },
    "itemId": {
      "description": "UUID of the associated item record",
      "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",
      "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",
      "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}$"
    },
     "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"
    },
    "receivedDate": {
      "description": "date received",
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": false,
  "required": [
    "poLineId",
    "receivingStatus",
    "format"
  ]
}

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",
  "receivingStatus": "Expected",
  "supplement": true,
  "receivedDate": "2018-10-10T00:00:00.000Z"
}

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

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

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