Orders Storage (v1.0)

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

Table of contents

Titles

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

/orders-storage/titles

Collection of title items.

GET /orders-storage/titles

Get list of titles

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

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    ["title", "TITLE", "="]
    
  • 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 title items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of titles",
  "type": "object",
  "properties": {
    "titles": {
      "description": "Collection of titles",
      "type": "array",
      "id": "titles",
      "items": {
        "$ref": "title.json"
      }
    },
    "totalRecords": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "titles",
    "totalRecords"
  ]
}

Example:

{
  "titles": [
    {
      "id": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
      "expectedReceiptDate": "2018-10-05T00:00:00.000Z",
      "title": "Sample Title",
      "poLineId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
      "instanceId": "f1b57aeb-23c9-4386-bcb8-efda56878267",
      "contributors": [
        {
          "contributor": "Ed Mashburn",
          "contributorNameTypeId": "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
        }
      ],
      "packageName": "Package sample",
      "poLineNumber": "268758-03",
      "publisher": "Schiffer Publishing",
      "publishedDate": "1972",
      "receivingNote": "ABCDEFGHIJKL",
      "edition": "Third Edt.",
      "subscriptionFrom": "2018-10-09T00:00:00.000Z",
      "subscriptionInterval": 824,
      "subscriptionTo": "2020-10-09T00:00:00.000Z",
      "isAcknowledged": true,
      "productIds": [
        {
          "productId": "9780764354113",
          "productIdType": "8261054f-be78-422d-bd51-4ed9f33c3422",
          "qualifier": "(paperback)"
        }
      ],
      "metadata": {
        "createdDate": "2018-07-19T00:00:00.000+0000",
        "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
      }
    }
  ],
  "totalRecords": 1
}

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 titles -- 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 titles -- 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/titles

Create a new title item.

POST /orders-storage/titles
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": "Title",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this title",
      "$ref": "../../common/schemas/uuid.json"
    },
    "expectedReceiptDate": {
      "description": "Vendor agreed date prior to the Receipt Due date item is expected to be received by",
      "type": "string",
      "format": "date-time"
    },
    "title": {
      "description": "The title name",
      "type": "string"
    },
    "poLineId": {
      "description": "UUID of the purchase order line this Title is associated with",
      "$ref": "../../common/schemas/uuid.json"
    },
    "instanceId": {
      "description": "UUID of the instance associated with this Title",
      "$ref": "../../common/schemas/uuid.json"
    },
    "productIds": {
      "description": "List of product identifiers",
      "id": "productIds",
      "type": "array",
      "items": {
        "$ref": "product_identifier.json"
      }
    },
    "contributors": {
      "description": "List of contributors to the material",
      "id": "contributors",
      "type": "array",
      "items": {
       "type": "object",
        "$ref": "contributor.json"
      }
    },
    "publisher": {
      "description": "Publisher of the material",
      "type": "string"
    },
    "edition": {
      "description": "Edition of the material",
      "type": "string"
    },
    "packageName": {
      "description": "The name of the package",
      "type": "string"
    },
    "poLineNumber": {
      "description": "The number of the POL identified by poLineId",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{1,16}-[0-9]{1,3}$"
    },
    "publishedDate": {
      "description": "Year of the material's publication",
      "type": "string",
      "pattern": "^[0-9]{4}$"
    },
    "receivingNote": {
      "description": "Receiving note of the POL identified by poLineId",
      "type": "string"
    },
    "subscriptionFrom": {
      "description": "The start date of the subscription",
      "type": "string",
      "format": "date-time"
    },
    "subscriptionTo": {
      "description": "The end date of the subscription",
      "type": "string",
      "format": "date-time"
    },
    "subscriptionInterval": {
      "description": "The subscription interval in days",
      "type": "integer"
    },
    "isAcknowledged": {
      "description": "Flag for acknowledge receiving note",
      "type": "boolean",
      "default": false
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "title",
    "poLineId"
  ]
}

Example:

{
  "title": "Sample Title",
  "poLineId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "instanceId": "f1b57aeb-23c9-4386-bcb8-efda56878267",
  "contributors": [
    {
      "contributor": "Ed Mashburn",
      "contributorNameTypeId": "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
    }
  ],
  "publisher": "Schiffer Publishing",
  "publishedDate": "1972",
  "edition": "Third Edt.",
  "subscriptionFrom": "2018-10-09T00:00:00.000Z",
  "subscriptionInterval": 824,
  "subscriptionTo": "2020-10-09T00:00:00.000Z",
  "isAcknowledged": true,
  "productIds": [
    {
      "productId": "9780764354113",
      "productIdType": "8261054f-be78-422d-bd51-4ed9f33c3422",
      "qualifier": "(paperback)"
    }
  ]
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created title item

Body

Media type: application/json

Type: any

Example:

{
  "title": "Sample Title",
  "poLineId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "instanceId": "f1b57aeb-23c9-4386-bcb8-efda56878267",
  "contributors": [
    {
      "contributor": "Ed Mashburn",
      "contributorNameTypeId": "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
    }
  ],
  "publisher": "Schiffer Publishing",
  "publishedDate": "1972",
  "edition": "Third Edt.",
  "subscriptionFrom": "2018-10-09T00:00:00.000Z",
  "subscriptionInterval": 824,
  "subscriptionTo": "2020-10-09T00:00:00.000Z",
  "isAcknowledged": true,
  "productIds": [
    {
      "productId": "9780764354113",
      "productIdType": "8261054f-be78-422d-bd51-4ed9f33c3422",
      "qualifier": "(paperback)"
    }
  ]
}

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

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create titles -- 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/titles/{id}

Retrieve title item with given {titleId}

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

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": "Title",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this title",
      "$ref": "../../common/schemas/uuid.json"
    },
    "expectedReceiptDate": {
      "description": "Vendor agreed date prior to the Receipt Due date item is expected to be received by",
      "type": "string",
      "format": "date-time"
    },
    "title": {
      "description": "The title name",
      "type": "string"
    },
    "poLineId": {
      "description": "UUID of the purchase order line this Title is associated with",
      "$ref": "../../common/schemas/uuid.json"
    },
    "instanceId": {
      "description": "UUID of the instance associated with this Title",
      "$ref": "../../common/schemas/uuid.json"
    },
    "productIds": {
      "description": "List of product identifiers",
      "id": "productIds",
      "type": "array",
      "items": {
        "$ref": "product_identifier.json"
      }
    },
    "contributors": {
      "description": "List of contributors to the material",
      "id": "contributors",
      "type": "array",
      "items": {
       "type": "object",
        "$ref": "contributor.json"
      }
    },
    "publisher": {
      "description": "Publisher of the material",
      "type": "string"
    },
    "edition": {
      "description": "Edition of the material",
      "type": "string"
    },
    "packageName": {
      "description": "The name of the package",
      "type": "string"
    },
    "poLineNumber": {
      "description": "The number of the POL identified by poLineId",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{1,16}-[0-9]{1,3}$"
    },
    "publishedDate": {
      "description": "Year of the material's publication",
      "type": "string",
      "pattern": "^[0-9]{4}$"
    },
    "receivingNote": {
      "description": "Receiving note of the POL identified by poLineId",
      "type": "string"
    },
    "subscriptionFrom": {
      "description": "The start date of the subscription",
      "type": "string",
      "format": "date-time"
    },
    "subscriptionTo": {
      "description": "The end date of the subscription",
      "type": "string",
      "format": "date-time"
    },
    "subscriptionInterval": {
      "description": "The subscription interval in days",
      "type": "integer"
    },
    "isAcknowledged": {
      "description": "Flag for acknowledge receiving note",
      "type": "boolean",
      "default": false
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "title",
    "poLineId"
  ]
}

Example:

{
  "id": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
  "expectedReceiptDate": "2018-10-05T00:00:00.000Z",
  "title": "Sample Title",
  "poLineId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "instanceId": "f1b57aeb-23c9-4386-bcb8-efda56878267",
  "contributors": [
    {
      "contributor": "Ed Mashburn",
      "contributorNameTypeId": "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
    }
  ],
  "packageName": "Package sample",
  "poLineNumber": "268758-03",
  "publisher": "Schiffer Publishing",
  "publishedDate": "1972",
  "receivingNote": "ABCDEFGHIJKL",
  "edition": "Third Edt.",
  "subscriptionFrom": "2018-10-09T00:00:00.000Z",
  "subscriptionInterval": 824,
  "subscriptionTo": "2020-10-09T00:00:00.000Z",
  "isAcknowledged": true,
  "productIds": [
    {
      "productId": "9780764354113",
      "productIdType": "8261054f-be78-422d-bd51-4ed9f33c3422",
      "qualifier": "(paperback)"
    }
  ],
  "metadata": {
    "createdDate": "2018-07-19T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"title 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/titles/{id}

Delete title item with given {titleId}

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

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

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"title 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/titles/{id}

Update title item with given {titleId}

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

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": "Title",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this title",
      "$ref": "../../common/schemas/uuid.json"
    },
    "expectedReceiptDate": {
      "description": "Vendor agreed date prior to the Receipt Due date item is expected to be received by",
      "type": "string",
      "format": "date-time"
    },
    "title": {
      "description": "The title name",
      "type": "string"
    },
    "poLineId": {
      "description": "UUID of the purchase order line this Title is associated with",
      "$ref": "../../common/schemas/uuid.json"
    },
    "instanceId": {
      "description": "UUID of the instance associated with this Title",
      "$ref": "../../common/schemas/uuid.json"
    },
    "productIds": {
      "description": "List of product identifiers",
      "id": "productIds",
      "type": "array",
      "items": {
        "$ref": "product_identifier.json"
      }
    },
    "contributors": {
      "description": "List of contributors to the material",
      "id": "contributors",
      "type": "array",
      "items": {
       "type": "object",
        "$ref": "contributor.json"
      }
    },
    "publisher": {
      "description": "Publisher of the material",
      "type": "string"
    },
    "edition": {
      "description": "Edition of the material",
      "type": "string"
    },
    "packageName": {
      "description": "The name of the package",
      "type": "string"
    },
    "poLineNumber": {
      "description": "The number of the POL identified by poLineId",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{1,16}-[0-9]{1,3}$"
    },
    "publishedDate": {
      "description": "Year of the material's publication",
      "type": "string",
      "pattern": "^[0-9]{4}$"
    },
    "receivingNote": {
      "description": "Receiving note of the POL identified by poLineId",
      "type": "string"
    },
    "subscriptionFrom": {
      "description": "The start date of the subscription",
      "type": "string",
      "format": "date-time"
    },
    "subscriptionTo": {
      "description": "The end date of the subscription",
      "type": "string",
      "format": "date-time"
    },
    "subscriptionInterval": {
      "description": "The subscription interval in days",
      "type": "integer"
    },
    "isAcknowledged": {
      "description": "Flag for acknowledge receiving note",
      "type": "boolean",
      "default": false
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "title",
    "poLineId"
  ]
}

Example:

{
  "id": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
  "expectedReceiptDate": "2018-10-05T00:00:00.000Z",
  "title": "Sample Title",
  "poLineId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "instanceId": "f1b57aeb-23c9-4386-bcb8-efda56878267",
  "contributors": [
    {
      "contributor": "Ed Mashburn",
      "contributorNameTypeId": "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
    }
  ],
  "packageName": "Package sample",
  "poLineNumber": "268758-03",
  "publisher": "Schiffer Publishing",
  "publishedDate": "1972",
  "receivingNote": "ABCDEFGHIJKL",
  "edition": "Third Edt.",
  "subscriptionFrom": "2018-10-09T00:00:00.000Z",
  "subscriptionInterval": 824,
  "subscriptionTo": "2020-10-09T00:00:00.000Z",
  "isAcknowledged": true,
  "productIds": [
    {
      "productId": "9780764354113",
      "productIdType": "8261054f-be78-422d-bd51-4ed9f33c3422",
      "qualifier": "(paperback)"
    }
  ],
  "metadata": {
    "createdDate": "2018-07-19T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

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

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

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