Orders (v3)

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

Table of contents

Orders Business Logic API

API for managing purchase orders

/orders

GET /orders/composite-orders

Retrieve a list of composite-order items.

GET /orders/composite-orders
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 purchase orders)

    Example:

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

    Requested language. Optional. [lang=en]

Response 200

Returns a list of composite-order items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "collection of purchase order records",
  "type": "object",
  "properties": {
    "purchase_orders": {
      "description": "collection of purchase order records",
      "type": "array",
      "id": "purchase_orders",
      "items": {
        "type": "object",
        "$ref": "purchase_order.json"
      }
    },
    "total_records": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    },
    "first": {
      "description": "The index of the first object contained in this collection",
      "type": "integer"
    },
    "last": {
      "description": "The index of the last object contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "purchase_orders",
    "total_records"
  ]
}

Example:

{
  "purchase_orders": [
    {
      "id": "0804ddec-6545-404a-b54d-a693f505681d",
      "adjustment": "9b3be694-6716-4e14-b81d-8d76f0ae4146",
      "approved": true,
      "assigned_to": "ab18897b-0e40-4f31-896b-9c9adc979a88",
      "close_reason": {
        "reason" : "No longer available",
        "note" : "Items are no longer available to purchase"
      },
      "manual_po": false,
      "notes": [
        "ABCDEFGHIJKLMNO",
        "ABCDEFGHIJKLMNOPQRST",
        "ABCDEFGHIJKLMNOPQRSTUV"
      ],
      "order_type": "Ongoing",
      "po_number": "ABC268758XYZ",
      "re_encumber": false,
      "renewal": {
         "cycle": "6 Months",
         "interval": 182,
         "manual_renewal": true,
         "review_period": 30,
         "renewal_date": "2019-04-09T00:00:00.000Z"
      },
      "total_estimated_price": 49.98,
      "total_items": 2,
      "vendor": "168f8a86-d26c-406e-813f-c7527f241ac3",
      "workflow_status": "Pending",
      "metadata": {
        "createdDate": "2018-07-19T00:00:00.000+0000",
        "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
      }
    }
  ],
  "total_records": 1,
  "first": 1,
  "last": 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: 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 composite-orders -- 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 composite-orders -- unauthorized

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, 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/composite-orders

Post a purchase order (PO) and a number of PO lines; record fund transactions corresponding to the order

POST /orders/composite-orders
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": "composite purchase order with dereferenced/expanded orders fields",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this purchase order",
      "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}$"
    },
    "adjustment": {
      "description": "the adjustment record associated with this order",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/adjustment.json"
    },
    "approved": {
      "description": "whether or not the purchase order has been approved",
      "type": "boolean"
    },
    "assigned_to": {
      "description": "UUID of the user this purchase order his assigned to",
      "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}$"
    },
    "close_reason": {
      "description": "Close reason for purchase order",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/close_reason.json"
    },
    "dateOrdered": {
      "description": "Date and time when purchase order was opened",
      "type": "string",
      "format": "date-time",
      "readonly": true
    },
    "manual_po": {
      "description": "if true, order cannot be sent automatically, e.g. via EDI",
      "type": "boolean"
    },
    "notes": {
      "description": "free-form notes associated with this purchase order",
      "id": "notes",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "po_number": {
      "description": "A human readable ID assigned to this purchase order",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{5,16}$"
    },
    "order_type": {
      "description": "the purchase order type",
      "type": "string",
      "enum": [
        "One-Time",
        "Ongoing"
      ]
    },
    "re_encumber": {
      "description": "indicates this purchase order should be re-encumbered each fiscal year. Only applies to ongoing orders",
      "type": "boolean"
    },
    "renewal": {
      "description": "Renewal information associated with this order",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/renewal.json"
    },
    "total_estimated_price": {
      "description": "total estimated price of this purchase order",
      "type": "number"
    },
    "total_items": {
      "description": "total number of items included in the purchase order",
      "type": "integer"
    },
    "vendor": {
      "description": "UUID of the vendor_details 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}$"
    },
    "workflow_status": {
      "description": "the workflow status for this purchase order",
      "type": "string",
      "enum": [
        "Pending",
        "Open",
        "Closed"
      ],
      "default": "Pending"
    },
    "compositePoLines": {
      "description": "a list of completely de-referenced purchase order lines",
      "id": "compositePoLines",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "composite_po_line.json"
      }
    },
    "metadata": {
      "type": "object",
      "$ref": "../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false
}

Example:

{
  "id": "0804ddec-6545-404a-b54d-a693f505681d",
  "adjustment": {
    "credit": 0.0,
    "discount": 0.0,
    "insurance": 0.0,
    "overhead": 0.0,
    "shipment": 0.0,
    "tax_1": 0.0,
    "tax_2": 0.0,
    "use_pro_rate": false
  },
  "approved": true,
  "assigned_to": "ab18897b-0e40-4f31-896b-9c9adc979a88",
  "close_reason": {
    "reason" : "No longer available",
    "note" : "Items are no longer available to purchase"
  },
  "dateOrdered": "2018-07-20T00:00:00.000+0000",
  "notes": [
    "ABCDEFGHIJKLMNO",
    "ABCDEFGHIJKLMNOPQRST",
    "ABCDEFGHIJKLMNOPQRSTUV"
  ],
  "order_type": "Ongoing",
  "po_number": "A268758XYZ",
  "re_encumber": false,
  "renewal": {
     "cycle": "6 Months",
     "interval": 182,
     "manual_renewal": true,
     "review_period": 30,
     "renewal_date": "2019-04-09T00:00:00.000Z"
  },
  "total_estimated_price": 74.97,
  "total_items": 3,
  "vendor": "168f8a86-d26c-406e-813f-c7527f241ac3",
  "workflow_status": "Open",
  "metadata": {
    "createdDate": "2018-07-19T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  },
  "compositePoLines": [
    {
      "id": "8c778aee-97fa-4586-b131-3ea588a728e2",
      "edition": "First edition",
      "checkin_items": false,
      "instance_id": "8343e5a0-fed8-11e8-8eb2-f2801f1b9fd1",
      "agreement_id": "bdc75fea-fed8-11e8-8eb2-f2801f1b9fd1",
      "acquisition_method": "Purchase At Vendor System",
      "adjustment": {
        "id": "1363467f-eb47-4e09-9e28-e25aa464adb7",
        "credit": 0.0,
        "discount": 0.0,
        "insurance": 0.0,
        "invoice_id": "2d6d495c-c237-476f-aa48-57f7cbf74ca4",
        "overhead": 0.0,
        "shipment": 0.0,
        "tax_1": 0.0,
        "tax_2": 0.0,
        "use_pro_rate": false,
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "alerts": [
        {
          "alert": "Receipt overdue",
          "id": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        }
      ],
      "cancellation_restriction": false,
      "cancellation_restriction_note": "ABCDEFGHIJKLMNOPQRSTUVW",
      "claims": [
        {
          "id": "f7d7d4e4-255e-46dc-9f08-b953fb1e872d",
          "claimed": false,
          "sent": "2018-10-09T00:00:00.000Z",
          "grace": 30,
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        }
      ],
      "collection": false,
      "contributors": [
        {
          "contributor": "Ed Mashburn",
          "contributor_type": "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
        }
      ],
      "cost": {
        "list_price": 24.99,
        "id": "e047212b-c94f-4cb1-84b0-367848381494",
        "currency": "USD",
        "quantity_physical": 3,
        "quantity_electronic": 0,
        "po_line_estimated_price": 74.97,
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "description": "ABCDEFGH",
      "details": {
        "id": "349d9438-12bd-4e2e-9eb6-dfa830ab99a4",
        "receiving_note": "ABCDEFGHIJKL",
        "product_ids": [
          {
            "product_id": "9780764354113",
            "product_id_type": "ISBN"
          }
        ],
        "material_types": [
          "f7e72403-2a13-43a4-a069-aaabe6c9dea8"
        ],
        "subscription_from": "2018-10-09T00:00:00.000Z",
        "subscription_interval": 824,
        "subscription_to": "2020-10-09T00:00:00.000Z",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "donor": "ABCDEFGHIJKLM",
      "eresource": {
        "id": "468b679c-378b-4009-9a17-a6711cefc85f",
        "activated": false,
        "activation_due": 10,
        "create_inventory": false,
        "trial": false,
        "expected_activation": "2018-10-09T00:00:00.000Z",
        "user_limit": 10,
        "access_provider": "ba3f3d45-247d-41f6-8dc9-6488adcad329",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2",
        "license": "7c063655-b384-4a6f-b367-3c2f95f7a49c"
      },
      "fund_distribution": [
        {
          "id": "64774a83-fd1d-469e-a4d9-ed4033082799",
          "code": "HIST",
          "percentage": 80.0,
          "encumbrance": "eb506834-6c70-4239-8d1a-6414a5b08ac3",
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        },
        {
          "id": "0d1b2d39-512f-4e0f-a497-b89eba6ecae9",
          "code": "GENRL",
          "percentage": 20.0,
          "encumbrance": "0466cb77-0344-43c6-85eb-0a64aa2934e5",
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        }
      ],
      "locations": [
        {
          "id": "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
          "location_id": "b241764c-1466-4e1d-a028-1a3684a5da87",
          "quantity": 2,
          "quantity_electronic": 0,
          "quantity_physical": 2,
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        },
        {
          "id": "7d23e4e3-5043-44b0-9507-66e58d236f20",
          "location_id": "fcd64ce1-6995-48f0-840e-89ffa2288371",
          "quantity": 1,
          "quantity_electronic": 0,
          "quantity_physical": 1,
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        }
      ],
      "order_format": "Physical Resource",
      "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
      "payment_status": "Awaiting Payment",
      "physical": {
        "volumes": [
          "vol. 1"
        ],
        "id": "5ee243f9-72e5-4464-bdbc-43a21873d648",
        "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
        "expectedReceiptDate": "2018-10-05T00:00:00.000Z",
        "receipt_due": "2018-10-10T00:00:00.000Z",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "po_line_description": "ABCDEFGHIJKLMNOPQRSTUVWXY",
      "po_line_number": "ABC268758XYZ-03",
      "publication_date": "2017",
      "publisher": "Schiffer Publishing",
      "purchase_order_id": "d79b0bcc-DcAD-1E4E-Abb7-DbFcaD5BB3bb",
      "receipt_date": "2018-10-09T00:00:00.000Z",
      "receipt_status": "Awaiting Receipt",
      "reporting_codes": [
        {
          "code": "CODE1",
          "id": "5926dcd7-85f5-4504-8283-712595ebc38b",
          "description": "ABCDEF"
        },
        {
          "code": "CODE2",
          "id": "fa316c04-8101-4e72-8aaf-01281bac718f",
          "description": "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        },
        {
          "code": "CODE3",
          "id": "ea68b696-3125-4940-bf91-1d128323473e",
          "description": "ABCDE"
        }
      ],
      "requester": "Leo Bulero",
      "rush": true,
      "selector": "ABCD",
      "source": {
        "code": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
        "id": "024b6f41-c5c6-4280-858e-33fba452a334",
        "description": "ABCDEFGHIJKLMNO"
      },
      "tags": [
        "ABCDEFGHIJKLMNOPQRSTU",
        "ABCDEFG",
        "ABCDEFGHIJKLMNOPQRSTU",
        "ABCDEFGHIJKLMNO"
      ],
      "title": "Kayak Fishing in the Northern Gulf Coast",
      "vendor_detail": {
        "id": "d5065f0d-fb88-4d23-b0c1-57e754fba40e",
        "instructions": "ABCDEFG",
        "note_from_vendor": "ABCDEFGHIKJKLMNOP",
        "ref_number": "123456-78",
        "ref_number_type": "Supplier's unique order line reference number",
        "vendor_account": "8910-10",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "metadata": {
        "createdDate": "2018-07-19T00:00:00.000+0000",
        "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
      }
    }
  ]
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created composite-order item

Body

Media type: application/json

Type: any

Example:

{
  "id": "0804ddec-6545-404a-b54d-a693f505681d",
  "adjustment": {
    "credit": 0.0,
    "discount": 0.0,
    "insurance": 0.0,
    "overhead": 0.0,
    "shipment": 0.0,
    "tax_1": 0.0,
    "tax_2": 0.0,
    "use_pro_rate": false
  },
  "approved": true,
  "assigned_to": "ab18897b-0e40-4f31-896b-9c9adc979a88",
  "close_reason": {
    "reason" : "No longer available",
    "note" : "Items are no longer available to purchase"
  },
  "dateOrdered": "2018-07-20T00:00:00.000+0000",
  "notes": [
    "ABCDEFGHIJKLMNO",
    "ABCDEFGHIJKLMNOPQRST",
    "ABCDEFGHIJKLMNOPQRSTUV"
  ],
  "order_type": "Ongoing",
  "po_number": "A268758XYZ",
  "re_encumber": false,
  "renewal": {
     "cycle": "6 Months",
     "interval": 182,
     "manual_renewal": true,
     "review_period": 30,
     "renewal_date": "2019-04-09T00:00:00.000Z"
  },
  "total_estimated_price": 74.97,
  "total_items": 3,
  "vendor": "168f8a86-d26c-406e-813f-c7527f241ac3",
  "workflow_status": "Open",
  "metadata": {
    "createdDate": "2018-07-19T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  },
  "compositePoLines": [
    {
      "id": "8c778aee-97fa-4586-b131-3ea588a728e2",
      "edition": "First edition",
      "checkin_items": false,
      "instance_id": "8343e5a0-fed8-11e8-8eb2-f2801f1b9fd1",
      "agreement_id": "bdc75fea-fed8-11e8-8eb2-f2801f1b9fd1",
      "acquisition_method": "Purchase At Vendor System",
      "adjustment": {
        "id": "1363467f-eb47-4e09-9e28-e25aa464adb7",
        "credit": 0.0,
        "discount": 0.0,
        "insurance": 0.0,
        "invoice_id": "2d6d495c-c237-476f-aa48-57f7cbf74ca4",
        "overhead": 0.0,
        "shipment": 0.0,
        "tax_1": 0.0,
        "tax_2": 0.0,
        "use_pro_rate": false,
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "alerts": [
        {
          "alert": "Receipt overdue",
          "id": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        }
      ],
      "cancellation_restriction": false,
      "cancellation_restriction_note": "ABCDEFGHIJKLMNOPQRSTUVW",
      "claims": [
        {
          "id": "f7d7d4e4-255e-46dc-9f08-b953fb1e872d",
          "claimed": false,
          "sent": "2018-10-09T00:00:00.000Z",
          "grace": 30,
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        }
      ],
      "collection": false,
      "contributors": [
        {
          "contributor": "Ed Mashburn",
          "contributor_type": "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
        }
      ],
      "cost": {
        "list_price": 24.99,
        "id": "e047212b-c94f-4cb1-84b0-367848381494",
        "currency": "USD",
        "quantity_physical": 3,
        "quantity_electronic": 0,
        "po_line_estimated_price": 74.97,
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "description": "ABCDEFGH",
      "details": {
        "id": "349d9438-12bd-4e2e-9eb6-dfa830ab99a4",
        "receiving_note": "ABCDEFGHIJKL",
        "product_ids": [
          {
            "product_id": "9780764354113",
            "product_id_type": "ISBN"
          }
        ],
        "material_types": [
          "f7e72403-2a13-43a4-a069-aaabe6c9dea8"
        ],
        "subscription_from": "2018-10-09T00:00:00.000Z",
        "subscription_interval": 824,
        "subscription_to": "2020-10-09T00:00:00.000Z",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "donor": "ABCDEFGHIJKLM",
      "eresource": {
        "id": "468b679c-378b-4009-9a17-a6711cefc85f",
        "activated": false,
        "activation_due": 10,
        "create_inventory": false,
        "trial": false,
        "expected_activation": "2018-10-09T00:00:00.000Z",
        "user_limit": 10,
        "access_provider": "ba3f3d45-247d-41f6-8dc9-6488adcad329",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2",
        "license": "7c063655-b384-4a6f-b367-3c2f95f7a49c"
      },
      "fund_distribution": [
        {
          "id": "64774a83-fd1d-469e-a4d9-ed4033082799",
          "code": "HIST",
          "percentage": 80.0,
          "encumbrance": "eb506834-6c70-4239-8d1a-6414a5b08ac3",
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        },
        {
          "id": "0d1b2d39-512f-4e0f-a497-b89eba6ecae9",
          "code": "GENRL",
          "percentage": 20.0,
          "encumbrance": "0466cb77-0344-43c6-85eb-0a64aa2934e5",
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        }
      ],
      "locations": [
        {
          "id": "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
          "location_id": "b241764c-1466-4e1d-a028-1a3684a5da87",
          "quantity": 2,
          "quantity_electronic": 0,
          "quantity_physical": 2,
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        },
        {
          "id": "7d23e4e3-5043-44b0-9507-66e58d236f20",
          "location_id": "fcd64ce1-6995-48f0-840e-89ffa2288371",
          "quantity": 1,
          "quantity_electronic": 0,
          "quantity_physical": 1,
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        }
      ],
      "order_format": "Physical Resource",
      "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
      "payment_status": "Awaiting Payment",
      "physical": {
        "volumes": [
          "vol. 1"
        ],
        "id": "5ee243f9-72e5-4464-bdbc-43a21873d648",
        "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
        "expectedReceiptDate": "2018-10-05T00:00:00.000Z",
        "receipt_due": "2018-10-10T00:00:00.000Z",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "po_line_description": "ABCDEFGHIJKLMNOPQRSTUVWXY",
      "po_line_number": "ABC268758XYZ-03",
      "publication_date": "2017",
      "publisher": "Schiffer Publishing",
      "purchase_order_id": "d79b0bcc-DcAD-1E4E-Abb7-DbFcaD5BB3bb",
      "receipt_date": "2018-10-09T00:00:00.000Z",
      "receipt_status": "Awaiting Receipt",
      "reporting_codes": [
        {
          "code": "CODE1",
          "id": "5926dcd7-85f5-4504-8283-712595ebc38b",
          "description": "ABCDEF"
        },
        {
          "code": "CODE2",
          "id": "fa316c04-8101-4e72-8aaf-01281bac718f",
          "description": "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        },
        {
          "code": "CODE3",
          "id": "ea68b696-3125-4940-bf91-1d128323473e",
          "description": "ABCDE"
        }
      ],
      "requester": "Leo Bulero",
      "rush": true,
      "selector": "ABCD",
      "source": {
        "code": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
        "id": "024b6f41-c5c6-4280-858e-33fba452a334",
        "description": "ABCDEFGHIJKLMNO"
      },
      "tags": [
        "ABCDEFGHIJKLMNOPQRSTU",
        "ABCDEFG",
        "ABCDEFGHIJKLMNOPQRSTU",
        "ABCDEFGHIJKLMNO"
      ],
      "title": "Kayak Fishing in the Northern Gulf Coast",
      "vendor_detail": {
        "id": "d5065f0d-fb88-4d23-b0c1-57e754fba40e",
        "instructions": "ABCDEFG",
        "note_from_vendor": "ABCDEFGHIKJKLMNOP",
        "ref_number": "123456-78",
        "ref_number_type": "Supplier's unique order line reference number",
        "vendor_account": "8910-10",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "metadata": {
        "createdDate": "2018-07-19T00:00:00.000+0000",
        "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
      }
    }
  ]
}

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 composite-order -- 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 composite-orders -- unauthorized

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, 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/composite-orders/{id}

Return a purchase order with given {id}

GET /orders/composite-orders/{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 purchase order

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": "composite purchase order with dereferenced/expanded orders fields",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this purchase order",
      "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}$"
    },
    "adjustment": {
      "description": "the adjustment record associated with this order",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/adjustment.json"
    },
    "approved": {
      "description": "whether or not the purchase order has been approved",
      "type": "boolean"
    },
    "assigned_to": {
      "description": "UUID of the user this purchase order his assigned to",
      "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}$"
    },
    "close_reason": {
      "description": "Close reason for purchase order",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/close_reason.json"
    },
    "dateOrdered": {
      "description": "Date and time when purchase order was opened",
      "type": "string",
      "format": "date-time",
      "readonly": true
    },
    "manual_po": {
      "description": "if true, order cannot be sent automatically, e.g. via EDI",
      "type": "boolean"
    },
    "notes": {
      "description": "free-form notes associated with this purchase order",
      "id": "notes",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "po_number": {
      "description": "A human readable ID assigned to this purchase order",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{5,16}$"
    },
    "order_type": {
      "description": "the purchase order type",
      "type": "string",
      "enum": [
        "One-Time",
        "Ongoing"
      ]
    },
    "re_encumber": {
      "description": "indicates this purchase order should be re-encumbered each fiscal year. Only applies to ongoing orders",
      "type": "boolean"
    },
    "renewal": {
      "description": "Renewal information associated with this order",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/renewal.json"
    },
    "total_estimated_price": {
      "description": "total estimated price of this purchase order",
      "type": "number"
    },
    "total_items": {
      "description": "total number of items included in the purchase order",
      "type": "integer"
    },
    "vendor": {
      "description": "UUID of the vendor_details 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}$"
    },
    "workflow_status": {
      "description": "the workflow status for this purchase order",
      "type": "string",
      "enum": [
        "Pending",
        "Open",
        "Closed"
      ],
      "default": "Pending"
    },
    "compositePoLines": {
      "description": "a list of completely de-referenced purchase order lines",
      "id": "compositePoLines",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "composite_po_line.json"
      }
    },
    "metadata": {
      "type": "object",
      "$ref": "../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false
}

Example:

{
  "id": "0804ddec-6545-404a-b54d-a693f505681d",
  "adjustment": {
    "credit": 0.0,
    "discount": 0.0,
    "insurance": 0.0,
    "overhead": 0.0,
    "shipment": 0.0,
    "tax_1": 0.0,
    "tax_2": 0.0,
    "use_pro_rate": false
  },
  "approved": true,
  "assigned_to": "ab18897b-0e40-4f31-896b-9c9adc979a88",
  "close_reason": {
    "reason" : "No longer available",
    "note" : "Items are no longer available to purchase"
  },
  "dateOrdered": "2018-07-20T00:00:00.000+0000",
  "notes": [
    "ABCDEFGHIJKLMNO",
    "ABCDEFGHIJKLMNOPQRST",
    "ABCDEFGHIJKLMNOPQRSTUV"
  ],
  "order_type": "Ongoing",
  "po_number": "A268758XYZ",
  "re_encumber": false,
  "renewal": {
     "cycle": "6 Months",
     "interval": 182,
     "manual_renewal": true,
     "review_period": 30,
     "renewal_date": "2019-04-09T00:00:00.000Z"
  },
  "total_estimated_price": 74.97,
  "total_items": 3,
  "vendor": "168f8a86-d26c-406e-813f-c7527f241ac3",
  "workflow_status": "Open",
  "metadata": {
    "createdDate": "2018-07-19T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  },
  "compositePoLines": [
    {
      "id": "8c778aee-97fa-4586-b131-3ea588a728e2",
      "edition": "First edition",
      "checkin_items": false,
      "instance_id": "8343e5a0-fed8-11e8-8eb2-f2801f1b9fd1",
      "agreement_id": "bdc75fea-fed8-11e8-8eb2-f2801f1b9fd1",
      "acquisition_method": "Purchase At Vendor System",
      "adjustment": {
        "id": "1363467f-eb47-4e09-9e28-e25aa464adb7",
        "credit": 0.0,
        "discount": 0.0,
        "insurance": 0.0,
        "invoice_id": "2d6d495c-c237-476f-aa48-57f7cbf74ca4",
        "overhead": 0.0,
        "shipment": 0.0,
        "tax_1": 0.0,
        "tax_2": 0.0,
        "use_pro_rate": false,
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "alerts": [
        {
          "alert": "Receipt overdue",
          "id": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        }
      ],
      "cancellation_restriction": false,
      "cancellation_restriction_note": "ABCDEFGHIJKLMNOPQRSTUVW",
      "claims": [
        {
          "id": "f7d7d4e4-255e-46dc-9f08-b953fb1e872d",
          "claimed": false,
          "sent": "2018-10-09T00:00:00.000Z",
          "grace": 30,
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        }
      ],
      "collection": false,
      "contributors": [
        {
          "contributor": "Ed Mashburn",
          "contributor_type": "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
        }
      ],
      "cost": {
        "list_price": 24.99,
        "id": "e047212b-c94f-4cb1-84b0-367848381494",
        "currency": "USD",
        "quantity_physical": 3,
        "quantity_electronic": 0,
        "po_line_estimated_price": 74.97,
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "description": "ABCDEFGH",
      "details": {
        "id": "349d9438-12bd-4e2e-9eb6-dfa830ab99a4",
        "receiving_note": "ABCDEFGHIJKL",
        "product_ids": [
          {
            "product_id": "9780764354113",
            "product_id_type": "ISBN"
          }
        ],
        "material_types": [
          "f7e72403-2a13-43a4-a069-aaabe6c9dea8"
        ],
        "subscription_from": "2018-10-09T00:00:00.000Z",
        "subscription_interval": 824,
        "subscription_to": "2020-10-09T00:00:00.000Z",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "donor": "ABCDEFGHIJKLM",
      "eresource": {
        "id": "468b679c-378b-4009-9a17-a6711cefc85f",
        "activated": false,
        "activation_due": 10,
        "create_inventory": false,
        "trial": false,
        "expected_activation": "2018-10-09T00:00:00.000Z",
        "user_limit": 10,
        "access_provider": "ba3f3d45-247d-41f6-8dc9-6488adcad329",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2",
        "license": "7c063655-b384-4a6f-b367-3c2f95f7a49c"
      },
      "fund_distribution": [
        {
          "id": "64774a83-fd1d-469e-a4d9-ed4033082799",
          "code": "HIST",
          "percentage": 80.0,
          "encumbrance": "eb506834-6c70-4239-8d1a-6414a5b08ac3",
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        },
        {
          "id": "0d1b2d39-512f-4e0f-a497-b89eba6ecae9",
          "code": "GENRL",
          "percentage": 20.0,
          "encumbrance": "0466cb77-0344-43c6-85eb-0a64aa2934e5",
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        }
      ],
      "locations": [
        {
          "id": "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
          "location_id": "b241764c-1466-4e1d-a028-1a3684a5da87",
          "quantity": 2,
          "quantity_electronic": 0,
          "quantity_physical": 2,
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        },
        {
          "id": "7d23e4e3-5043-44b0-9507-66e58d236f20",
          "location_id": "fcd64ce1-6995-48f0-840e-89ffa2288371",
          "quantity": 1,
          "quantity_electronic": 0,
          "quantity_physical": 1,
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        }
      ],
      "order_format": "Physical Resource",
      "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
      "payment_status": "Awaiting Payment",
      "physical": {
        "volumes": [
          "vol. 1"
        ],
        "id": "5ee243f9-72e5-4464-bdbc-43a21873d648",
        "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
        "expectedReceiptDate": "2018-10-05T00:00:00.000Z",
        "receipt_due": "2018-10-10T00:00:00.000Z",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "po_line_description": "ABCDEFGHIJKLMNOPQRSTUVWXY",
      "po_line_number": "ABC268758XYZ-03",
      "publication_date": "2017",
      "publisher": "Schiffer Publishing",
      "purchase_order_id": "d79b0bcc-DcAD-1E4E-Abb7-DbFcaD5BB3bb",
      "receipt_date": "2018-10-09T00:00:00.000Z",
      "receipt_status": "Awaiting Receipt",
      "reporting_codes": [
        {
          "code": "CODE1",
          "id": "5926dcd7-85f5-4504-8283-712595ebc38b",
          "description": "ABCDEF"
        },
        {
          "code": "CODE2",
          "id": "fa316c04-8101-4e72-8aaf-01281bac718f",
          "description": "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        },
        {
          "code": "CODE3",
          "id": "ea68b696-3125-4940-bf91-1d128323473e",
          "description": "ABCDE"
        }
      ],
      "requester": "Leo Bulero",
      "rush": true,
      "selector": "ABCD",
      "source": {
        "code": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
        "id": "024b6f41-c5c6-4280-858e-33fba452a334",
        "description": "ABCDEFGHIJKLMNO"
      },
      "tags": [
        "ABCDEFGHIJKLMNOPQRSTU",
        "ABCDEFG",
        "ABCDEFGHIJKLMNOPQRSTU",
        "ABCDEFGHIJKLMNO"
      ],
      "title": "Kayak Fishing in the Northern Gulf Coast",
      "vendor_detail": {
        "id": "d5065f0d-fb88-4d23-b0c1-57e754fba40e",
        "instructions": "ABCDEFG",
        "note_from_vendor": "ABCDEFGHIKJKLMNOP",
        "ref_number": "123456-78",
        "ref_number_type": "Supplier's unique order line reference number",
        "vendor_account": "8910-10",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "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: 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:

"composite-order not found"

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, 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/composite-orders/{id}

Update a purchase order with given {id}

  • if request does not include po_lines or includes "po_lines": [] or "po_lines": null - update just purchase order summary
  • if request includes array of "po_lines" - update PO lines as per request
PUT /orders/composite-orders/{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 purchase order

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": "composite purchase order with dereferenced/expanded orders fields",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this purchase order",
      "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}$"
    },
    "adjustment": {
      "description": "the adjustment record associated with this order",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/adjustment.json"
    },
    "approved": {
      "description": "whether or not the purchase order has been approved",
      "type": "boolean"
    },
    "assigned_to": {
      "description": "UUID of the user this purchase order his assigned to",
      "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}$"
    },
    "close_reason": {
      "description": "Close reason for purchase order",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/close_reason.json"
    },
    "dateOrdered": {
      "description": "Date and time when purchase order was opened",
      "type": "string",
      "format": "date-time",
      "readonly": true
    },
    "manual_po": {
      "description": "if true, order cannot be sent automatically, e.g. via EDI",
      "type": "boolean"
    },
    "notes": {
      "description": "free-form notes associated with this purchase order",
      "id": "notes",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "po_number": {
      "description": "A human readable ID assigned to this purchase order",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{5,16}$"
    },
    "order_type": {
      "description": "the purchase order type",
      "type": "string",
      "enum": [
        "One-Time",
        "Ongoing"
      ]
    },
    "re_encumber": {
      "description": "indicates this purchase order should be re-encumbered each fiscal year. Only applies to ongoing orders",
      "type": "boolean"
    },
    "renewal": {
      "description": "Renewal information associated with this order",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/renewal.json"
    },
    "total_estimated_price": {
      "description": "total estimated price of this purchase order",
      "type": "number"
    },
    "total_items": {
      "description": "total number of items included in the purchase order",
      "type": "integer"
    },
    "vendor": {
      "description": "UUID of the vendor_details 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}$"
    },
    "workflow_status": {
      "description": "the workflow status for this purchase order",
      "type": "string",
      "enum": [
        "Pending",
        "Open",
        "Closed"
      ],
      "default": "Pending"
    },
    "compositePoLines": {
      "description": "a list of completely de-referenced purchase order lines",
      "id": "compositePoLines",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "composite_po_line.json"
      }
    },
    "metadata": {
      "type": "object",
      "$ref": "../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false
}

Example:

{
  "id": "0804ddec-6545-404a-b54d-a693f505681d",
  "adjustment": {
    "credit": 0.0,
    "discount": 0.0,
    "insurance": 0.0,
    "overhead": 0.0,
    "shipment": 0.0,
    "tax_1": 0.0,
    "tax_2": 0.0,
    "use_pro_rate": false
  },
  "approved": true,
  "assigned_to": "ab18897b-0e40-4f31-896b-9c9adc979a88",
  "close_reason": {
    "reason" : "No longer available",
    "note" : "Items are no longer available to purchase"
  },
  "dateOrdered": "2018-07-20T00:00:00.000+0000",
  "notes": [
    "ABCDEFGHIJKLMNO",
    "ABCDEFGHIJKLMNOPQRST",
    "ABCDEFGHIJKLMNOPQRSTUV"
  ],
  "order_type": "Ongoing",
  "po_number": "A268758XYZ",
  "re_encumber": false,
  "renewal": {
     "cycle": "6 Months",
     "interval": 182,
     "manual_renewal": true,
     "review_period": 30,
     "renewal_date": "2019-04-09T00:00:00.000Z"
  },
  "total_estimated_price": 74.97,
  "total_items": 3,
  "vendor": "168f8a86-d26c-406e-813f-c7527f241ac3",
  "workflow_status": "Open",
  "metadata": {
    "createdDate": "2018-07-19T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  },
  "compositePoLines": [
    {
      "id": "8c778aee-97fa-4586-b131-3ea588a728e2",
      "edition": "First edition",
      "checkin_items": false,
      "instance_id": "8343e5a0-fed8-11e8-8eb2-f2801f1b9fd1",
      "agreement_id": "bdc75fea-fed8-11e8-8eb2-f2801f1b9fd1",
      "acquisition_method": "Purchase At Vendor System",
      "adjustment": {
        "id": "1363467f-eb47-4e09-9e28-e25aa464adb7",
        "credit": 0.0,
        "discount": 0.0,
        "insurance": 0.0,
        "invoice_id": "2d6d495c-c237-476f-aa48-57f7cbf74ca4",
        "overhead": 0.0,
        "shipment": 0.0,
        "tax_1": 0.0,
        "tax_2": 0.0,
        "use_pro_rate": false,
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "alerts": [
        {
          "alert": "Receipt overdue",
          "id": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        }
      ],
      "cancellation_restriction": false,
      "cancellation_restriction_note": "ABCDEFGHIJKLMNOPQRSTUVW",
      "claims": [
        {
          "id": "f7d7d4e4-255e-46dc-9f08-b953fb1e872d",
          "claimed": false,
          "sent": "2018-10-09T00:00:00.000Z",
          "grace": 30,
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        }
      ],
      "collection": false,
      "contributors": [
        {
          "contributor": "Ed Mashburn",
          "contributor_type": "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
        }
      ],
      "cost": {
        "list_price": 24.99,
        "id": "e047212b-c94f-4cb1-84b0-367848381494",
        "currency": "USD",
        "quantity_physical": 3,
        "quantity_electronic": 0,
        "po_line_estimated_price": 74.97,
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "description": "ABCDEFGH",
      "details": {
        "id": "349d9438-12bd-4e2e-9eb6-dfa830ab99a4",
        "receiving_note": "ABCDEFGHIJKL",
        "product_ids": [
          {
            "product_id": "9780764354113",
            "product_id_type": "ISBN"
          }
        ],
        "material_types": [
          "f7e72403-2a13-43a4-a069-aaabe6c9dea8"
        ],
        "subscription_from": "2018-10-09T00:00:00.000Z",
        "subscription_interval": 824,
        "subscription_to": "2020-10-09T00:00:00.000Z",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "donor": "ABCDEFGHIJKLM",
      "eresource": {
        "id": "468b679c-378b-4009-9a17-a6711cefc85f",
        "activated": false,
        "activation_due": 10,
        "create_inventory": false,
        "trial": false,
        "expected_activation": "2018-10-09T00:00:00.000Z",
        "user_limit": 10,
        "access_provider": "ba3f3d45-247d-41f6-8dc9-6488adcad329",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2",
        "license": "7c063655-b384-4a6f-b367-3c2f95f7a49c"
      },
      "fund_distribution": [
        {
          "id": "64774a83-fd1d-469e-a4d9-ed4033082799",
          "code": "HIST",
          "percentage": 80.0,
          "encumbrance": "eb506834-6c70-4239-8d1a-6414a5b08ac3",
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        },
        {
          "id": "0d1b2d39-512f-4e0f-a497-b89eba6ecae9",
          "code": "GENRL",
          "percentage": 20.0,
          "encumbrance": "0466cb77-0344-43c6-85eb-0a64aa2934e5",
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        }
      ],
      "locations": [
        {
          "id": "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
          "location_id": "b241764c-1466-4e1d-a028-1a3684a5da87",
          "quantity": 2,
          "quantity_electronic": 0,
          "quantity_physical": 2,
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        },
        {
          "id": "7d23e4e3-5043-44b0-9507-66e58d236f20",
          "location_id": "fcd64ce1-6995-48f0-840e-89ffa2288371",
          "quantity": 1,
          "quantity_electronic": 0,
          "quantity_physical": 1,
          "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
        }
      ],
      "order_format": "Physical Resource",
      "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
      "payment_status": "Awaiting Payment",
      "physical": {
        "volumes": [
          "vol. 1"
        ],
        "id": "5ee243f9-72e5-4464-bdbc-43a21873d648",
        "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
        "expectedReceiptDate": "2018-10-05T00:00:00.000Z",
        "receipt_due": "2018-10-10T00:00:00.000Z",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "po_line_description": "ABCDEFGHIJKLMNOPQRSTUVWXY",
      "po_line_number": "ABC268758XYZ-03",
      "publication_date": "2017",
      "publisher": "Schiffer Publishing",
      "purchase_order_id": "d79b0bcc-DcAD-1E4E-Abb7-DbFcaD5BB3bb",
      "receipt_date": "2018-10-09T00:00:00.000Z",
      "receipt_status": "Awaiting Receipt",
      "reporting_codes": [
        {
          "code": "CODE1",
          "id": "5926dcd7-85f5-4504-8283-712595ebc38b",
          "description": "ABCDEF"
        },
        {
          "code": "CODE2",
          "id": "fa316c04-8101-4e72-8aaf-01281bac718f",
          "description": "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        },
        {
          "code": "CODE3",
          "id": "ea68b696-3125-4940-bf91-1d128323473e",
          "description": "ABCDE"
        }
      ],
      "requester": "Leo Bulero",
      "rush": true,
      "selector": "ABCD",
      "source": {
        "code": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
        "id": "024b6f41-c5c6-4280-858e-33fba452a334",
        "description": "ABCDEFGHIJKLMNO"
      },
      "tags": [
        "ABCDEFGHIJKLMNOPQRSTU",
        "ABCDEFG",
        "ABCDEFGHIJKLMNOPQRSTU",
        "ABCDEFGHIJKLMNO"
      ],
      "title": "Kayak Fishing in the Northern Gulf Coast",
      "vendor_detail": {
        "id": "d5065f0d-fb88-4d23-b0c1-57e754fba40e",
        "instructions": "ABCDEFG",
        "note_from_vendor": "ABCDEFGHIKJKLMNOP",
        "ref_number": "123456-78",
        "ref_number_type": "Supplier's unique order line reference number",
        "vendor_account": "8910-10",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "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: 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 update composite-order -- malformed JSON at 13:4"

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:

"composite-order not found"

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, 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

DELETE /orders/composite-orders/{id}

Delete a purchase order with given {id}

DELETE /orders/composite-orders/{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 purchase order

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: 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 delete composite-order -- constraint violation"

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:

"composite-order not found"

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, 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/order-lines

Retrieve a list of order-line items.

GET /orders/order-lines
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 PO lines)

    Example:

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

    Requested language. Optional. [lang=en]

Response 200

Returns a list of order-line items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "collection of purchase order line records",
  "type": "object",
  "properties": {
    "po_lines": {
      "description": "collection of purchase order line records",
      "type": "array",
      "id": "po_lines",
      "items": {
        "type": "object",
        "$ref": "po_line.json"
      }
    },
    "total_records": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    },
    "first": {
      "description": "The index of the first object contained in this collection",
      "type": "integer"
    },
    "last": {
      "description": "The index of the last object contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "po_lines",
    "total_records"
  ]
}

Example:

{
    "po_lines": [
      {
        "id": "c0d08448-347b-418a-8c2f-5fb50248d67e",
        "edition": "First edition",
        "checkin_items": false,
        "instance_id": "8343e5a0-fed8-11e8-8eb2-f2801f1b9fd1",
        "agreement_id": "bdc75fea-fed8-11e8-8eb2-f2801f1b9fd1",
        "acquisition_method": "Purchase At Vendor System",
        "adjustment": "1363467f-eb47-4e09-9e28-e25aa464adb7",
        "alerts": [
          "9a665b22-9fe5-4c95-b4ee-837a5433c95d"
        ],
        "cancellation_restriction": false,
        "cancellation_restriction_note": "ABCDEFGHIJKLMNOPQRSTUVW",
        "claims": [
          "f7d7d4e4-255e-46dc-9f08-b953fb1e872d"
        ],
        "collection": false,
        "contributors": [
          {
            "contributor": "Ed Mashburn",
            "contributor_type": "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
          }
        ],
        "cost": "e047212b-c94f-4cb1-84b0-367848381494",
        "description": "ABCDEFGH",
        "details": "349d9438-12bd-4e2e-9eb6-dfa830ab99a4",
        "donor": "ABCDEFGHIJKLM",
        "eresource": "468b679c-378b-4009-9a17-a6711cefc85f",
        "fund_distribution": [
          "d10879e8-8c2d-4850-bcb9-0ec8e2e10021"
        ],
        "locations": [
          "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
          "7d23e4e3-5043-44b0-9507-66e58d236f20"
        ],
        "order_format": "Physical Resource",
        "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
        "payment_status": "Awaiting Payment",
        "physical": "5ee243f9-72e5-4464-bdbc-43a21873d648",
        "po_line_description": "ABCDEFGHIJKLMNOPQRSTUVWXY",
        "po_line_number": "268758-03",
        "publication_date": "2017",
        "publisher": "Schiffer Publishing",
        "purchase_order_id": "d79b0bcc-DcAD-1E4E-Abb7-DbFcaD5BB3bb",
        "receipt_date": "2018-10-09T00:00:00.000Z",
        "receipt_status": "Awaiting Receipt",
        "reporting_codes": [
          "5926dcd7-85f5-4504-8283-712595ebc38b",
          "fa316c04-8101-4e72-8aaf-01281bac718f",
          "ea68b696-3125-4940-bf91-1d128323473e"
        ],
        "requester": "Leo Bulero",
        "rush": true,
        "selector": "ABCD",
        "source": "024b6f41-c5c6-4280-858e-33fba452a334",
        "tags": [
          "ABCDEFGHIJKLMNOPQRSTU",
          "ABCDEFG",
          "ABCDEFGHIJKLMNOPQRSTU",
          "ABCDEFGHIJKLMNO"
        ],
        "title": "Kayak Fishing in the Northern Gulf Coast",
        "vendor_detail": "d5065f0d-fb88-4d23-b0c1-57e754fba40e",
        "metadata": {
          "createdDate": "2018-07-19T00:00:00.000+0000",
          "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
        }
      }
    ],
    "total_records": 1,
    "first": 1,
    "last": 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: 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 order-lines -- 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 order-lines -- unauthorized

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, 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/order-lines

Post a PO lines to corresponding PO

POST /orders/order-lines
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": "composite purchase order line with dereferenced/expanded orders fields",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID identifying this purchase order line",
      "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}$"
    },
    "edition": {
      "description": "edition of the material",
      "type": "string"
    },
    "checkin_items": {
      "description": "if true this will toggle the Check-in workflow for details associated with this PO line",
      "type": "boolean"
    },
    "instance_id": {
      "description": "UUID of the instance record this purchase order line is related to",
      "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}$"
    },
    "agreement_id": {
      "description": "UUID of the agreement this purchase order line is related to",
      "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}$"
    },
    "acquisition_method": {
      "description": "the acquisition method for this purchase order line",
      "type": "string",
      "enum": [
        "Approval Plan",
        "Demand Driven Acquisitions (DDA)",
        "Depository",
        "Evidence Based Acquisitions (EBA)",
        "Exchange",
        "Gift",
        "Purchase At Vendor System",
        "Purchase",
        "Technical"
      ]
    },
    "adjustment": {
      "description": "the adjustment record associated with this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/adjustment.json"
    },
    "alerts": {
      "description": "alerts associated with this purchase order line",
      "id": "alerts",
      "type": "array",
      "items": {
        "description": "an alert record",
        "type": "object",
        "$ref": "mod-orders-storage/schemas/alert.json"
      }
    },
    "cancellation_restriction": {
      "description": "whether or not there are cancellation restrictions for this purchase order line",
      "type": "boolean"
    },
    "cancellation_restriction_note": {
      "description": "free-form notes related to cancellation restrictions",
      "type": "string"
    },
    "claims": {
      "description": "claims associated with this purchase order line",
      "id": "claims",
      "type": "array",
      "items": {
        "description": "a claim record",
        "type": "object",
        "$ref": "mod-orders-storage/schemas/claim.json"
      }
    },
    "collection": {
      "description": "whether or not this purchase order line is for a collection",
      "type": "boolean"
    },
    "contributors": {
      "description": "list of contributors to the material",
      "id": "contributors",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "contributor": {
            "description": "the name of a contributor to the material",
            "type": "string"
          },
          "contributor_type": {
            "description": "UUID of the contributor type",
            "type": "string",
            "pattern": "^[a-f0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
          }
        }
      }
    },
    "cost": {
      "description": "cost details associated with this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/cost.json"
    },
    "description": {
      "description": "description of the material",
      "type": "string"
    },
    "details": {
      "description": "details about this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/details.json"
    },
    "donor": {
      "description": "the donor contributing to this purchase order line",
      "type": "string"
    },
    "eresource": {
      "description": "eresource-related details of this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/eresource.json"
    },
    "fund_distribution": {
      "description": "the UUIDs of the fund distribution records for this purchase order line",
      "id": "fund_distribution",
      "type": "array",
      "items": {
        "description": "a fund distribution record",
        "type": "object",
        "$ref": "mod-orders-storage/schemas/fund_distribution.json"
      }
    },
    "locations": {
      "description": "a list of the location records for this purchase order line",
      "id": "locations",
      "type": "array",
      "items": {
        "description": "The location details",
        "type": "object",
        "$ref": "mod-orders-storage/schemas/location.json"
      }
    },
    "order_format": {
      "description": "The purchase order line format",
      "type": "string",
      "enum": [
        "Electronic Resource",
        "P/E Mix",
        "Physical Resource",
        "Other"
      ]
    },
    "owner": {
      "description": "the owner of this purchase order line",
      "type": "string"
    },
    "payment_status": {
      "description": "The purchase order line payment status",
      "type": "string",
      "enum": [
        "Awaiting Payment",
        "Cancelled",
        "Fully Paid",
        "Partially Paid",
        "Payment Not Required",
        "Pending"
      ]
    },
    "physical": {
      "description": "details of this purchase order line relating to physical materials",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/physical.json"
    },
    "po_line_description": {
      "description": "purchase order line description",
      "type": "string"
    },
    "po_line_number": {
      "description": "A human readable number assigned to this PO line",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{5,16}-[0-9]{1,3}$",
      "readonly": true
    },
    "publication_date": {
      "description": "date (year) of the material's publication",
      "type": "string",
      "pattern": "^[0-9]{4}$"
    },
    "publisher": {
      "description": "publisher of the material",
      "type": "string"
    },
    "purchase_order_id": {
      "description": "UUID of this parent purchase order",
      "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}$"
    },
    "receipt_date": {
      "description": "date the purchase order line was received",
      "type": [
        "null",
        "string"
      ],
      "format": "date-time"
    },
    "receipt_status": {
      "description": "The purchase order line receipt status",
      "type": "string",
      "enum": [
        "Awaiting Receipt",
        "Cancelled",
        "Fully Received",
        "Partially Received",
        "Pending",
        "Receipt Not Required"
      ]
    },
    "reporting_codes": {
      "description": "a list of reporting codes associated with this purchase order line",
      "id": "reporting_codes",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "mod-orders-storage/schemas/reporting_code.json"
      }
    },
    "requester": {
      "description": "who requested this purchase order line",
      "type": "string"
    },
    "rush": {
      "description": "whether or not this is a rush order",
      "type": "boolean"
    },
    "selector": {
      "description": "who selected this material",
      "type": "string"
    },
    "source": {
      "description": "details related to the source of this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/source.json"
    },
    "tags": {
      "description": "arbitrary tags associated with this purchase order line",
      "id": "tags",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "title": {
      "description": "title of the material",
      "type": "string"
    },
    "vendor_detail": {
      "description": "details related to the vendor of this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/vendor_detail.json"
    },
    "metadata": {
      "type": "object",
      "$ref": "../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "source"
  ]
}

Example:

{
  "id": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "edition": "First edition",
  "checkin_items": false,
  "instance_id": "8343e5a0-fed8-11e8-8eb2-f2801f1b9fd1",
  "agreement_id": "bdc75fea-fed8-11e8-8eb2-f2801f1b9fd1",
  "acquisition_method": "Purchase At Vendor System",
  "adjustment": {
    "id": "1363467f-eb47-4e09-9e28-e25aa464adb7",
    "credit": 0.0,
    "discount": 0.0,
    "insurance": 0.0,
    "invoice_id": "2d6d495c-c237-476f-aa48-57f7cbf74ca4",
    "overhead": 0.0,
    "shipment": 0.0,
    "tax_1": 0.0,
    "tax_2": 0.0,
    "use_pro_rate": false,
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "alerts": [
    {
      "alert": "Receipt overdue",
      "id": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
      "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
    }
  ],
  "cancellation_restriction": false,
  "cancellation_restriction_note": "ABCDEFGHIJKLMNOPQRSTUVW",
  "claims": [
    {
      "id": "f7d7d4e4-255e-46dc-9f08-b953fb1e872d",
      "claimed": false,
      "sent": "2018-10-09T00:00:00.000Z",
      "grace": 30,
      "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
    }
  ],
  "collection": false,
  "contributors": [
    {
      "contributor": "Ed Mashburn",
      "contributor_type": "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
    }
  ],
  "cost": {
    "list_price": 24.99,
    "id": "e047212b-c94f-4cb1-84b0-367848381494",
    "currency": "USD",
    "quantity_physical": 6,
    "quantity_electronic": 1,
    "po_line_estimated_price": 174.93,
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "description": "ABCDEFGH",
  "details": {
    "id": "349d9438-12bd-4e2e-9eb6-dfa830ab99a4",
    "receiving_note": "ABCDEFGHIJKL",
    "product_ids": [
      {
        "product_id": "9780764354113",
        "product_id_type": "ISBN"
      }
    ],
    "material_types": [
      "f7e72403-2a13-43a4-a069-aaabe6c9dea8"
    ],
    "subscription_from": "2018-10-09T00:00:00.000Z",
    "subscription_interval": 824,
    "subscription_to": "2020-10-09T00:00:00.000Z",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "donor": "ABCDEFGHIJKLM",
  "eresource": {
    "id": "468b679c-378b-4009-9a17-a6711cefc85f",
    "activated": false,
    "activation_due": 10,
    "create_inventory": true,
    "trial": false,
    "expected_activation": "2018-10-09T00:00:00.000Z",
    "user_limit": 10,
    "access_provider": "ba3f3d45-247d-41f6-8dc9-6488adcad329",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2",
    "license": "7c063655-b384-4a6f-b367-3c2f95f7a49c"
  },
  "fund_distribution": [
    {
      "id": "64774a83-fd1d-469e-a4d9-ed4033082799",
      "code": "HIST",
      "percentage": 80.0,
      "encumbrance": "eb506834-6c70-4239-8d1a-6414a5b08ac3",
      "po_line_id": "c0d08448-347b-418a-8c2f-5fb50248d67e"
    },
    {
      "id": "0d1b2d39-512f-4e0f-a497-b89eba6ecae9",
      "code": "GENRL",
      "percentage": 20.0,
      "encumbrance": "0466cb77-0344-43c6-85eb-0a64aa2934e5",
      "po_line_id": "c0d08448-347b-418a-8c2f-5fb50248d67e"
    }
  ],
  "locations": [
    {
      "id": "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
      "location_id": "b241764c-1466-4e1d-a028-1a3684a5da87",
      "quantity": 5,
      "quantity_electronic": 1,
      "quantity_physical": 4,
      "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
    },
    {
      "id": "7d23e4e3-5043-44b0-9507-66e58d236f20",
      "location_id": "fcd64ce1-6995-48f0-840e-89ffa2288371",
      "quantity": 2,
      "quantity_electronic": 0,
      "quantity_physical": 2,
      "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
    }
  ],
  "order_format": "P/E Mix",
  "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
  "payment_status": "Awaiting Payment",
  "physical": {
    "volumes": [
      "vol. 1"
    ],
    "id": "5ee243f9-72e5-4464-bdbc-43a21873d648",
    "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
    "expectedReceiptDate": "2018-10-05T00:00:00.000Z",
    "receipt_due": "2018-10-10T00:00:00.000Z",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "po_line_description": "ABCDEFGHIJKLMNOPQRSTUVWXY",
  "po_line_number": "268758-03",
  "publication_date": "2017",
  "publisher": "Schiffer Publishing",
  "purchase_order_id": "d79b0bcc-DcAD-1E4E-Abb7-DbFcaD5BB3bb",
  "receipt_date": "2018-10-09T00:00:00.000Z",
  "receipt_status": "Awaiting Receipt",
  "reporting_codes": [
    {
      "code": "CODE1",
      "id": "5926dcd7-85f5-4504-8283-712595ebc38b",
      "description": "ABCDEF"
    },
    {
      "code": "CODE2",
      "id": "fa316c04-8101-4e72-8aaf-01281bac718f",
      "description": "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    },
    {
      "code": "CODE3",
      "id": "ea68b696-3125-4940-bf91-1d128323473e",
      "description": "ABCDE"
    }
  ],
  "requester": "Leo Bulero",
  "rush": true,
  "selector": "ABCD",
  "source": {
    "code": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
    "id": "024b6f41-c5c6-4280-858e-33fba452a334",
    "description": "ABCDEFGHIJKLMNO"
  },
  "tags": [
    "ABCDEFGHIJKLMNOPQRSTU",
    "ABCDEFG",
    "ABCDEFGHIJKLMNOPQRSTU",
    "ABCDEFGHIJKLMNO"
  ],
  "title": "Kayak Fishing in the Northern Gulf Coast",
  "vendor_detail": {
    "id": "d5065f0d-fb88-4d23-b0c1-57e754fba40e",
    "instructions": "ABCDEFG",
    "note_from_vendor": "ABCDEFGHIKJKLMNOP",
    "ref_number": "123456-78",
    "ref_number_type": "Supplier's unique order line reference number",
    "vendor_account": "8910-10",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "metadata": {
    "createdDate": "2018-07-19T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created order-line item

Body

Media type: application/json

Type: any

Example:

{
  "id": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "edition": "First edition",
  "checkin_items": false,
  "instance_id": "8343e5a0-fed8-11e8-8eb2-f2801f1b9fd1",
  "agreement_id": "bdc75fea-fed8-11e8-8eb2-f2801f1b9fd1",
  "acquisition_method": "Purchase At Vendor System",
  "adjustment": {
    "id": "1363467f-eb47-4e09-9e28-e25aa464adb7",
    "credit": 0.0,
    "discount": 0.0,
    "insurance": 0.0,
    "invoice_id": "2d6d495c-c237-476f-aa48-57f7cbf74ca4",
    "overhead": 0.0,
    "shipment": 0.0,
    "tax_1": 0.0,
    "tax_2": 0.0,
    "use_pro_rate": false,
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "alerts": [
    {
      "alert": "Receipt overdue",
      "id": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
      "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
    }
  ],
  "cancellation_restriction": false,
  "cancellation_restriction_note": "ABCDEFGHIJKLMNOPQRSTUVW",
  "claims": [
    {
      "id": "f7d7d4e4-255e-46dc-9f08-b953fb1e872d",
      "claimed": false,
      "sent": "2018-10-09T00:00:00.000Z",
      "grace": 30,
      "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
    }
  ],
  "collection": false,
  "contributors": [
    {
      "contributor": "Ed Mashburn",
      "contributor_type": "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
    }
  ],
  "cost": {
    "list_price": 24.99,
    "id": "e047212b-c94f-4cb1-84b0-367848381494",
    "currency": "USD",
    "quantity_physical": 6,
    "quantity_electronic": 1,
    "po_line_estimated_price": 174.93,
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "description": "ABCDEFGH",
  "details": {
    "id": "349d9438-12bd-4e2e-9eb6-dfa830ab99a4",
    "receiving_note": "ABCDEFGHIJKL",
    "product_ids": [
      {
        "product_id": "9780764354113",
        "product_id_type": "ISBN"
      }
    ],
    "material_types": [
      "f7e72403-2a13-43a4-a069-aaabe6c9dea8"
    ],
    "subscription_from": "2018-10-09T00:00:00.000Z",
    "subscription_interval": 824,
    "subscription_to": "2020-10-09T00:00:00.000Z",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "donor": "ABCDEFGHIJKLM",
  "eresource": {
    "id": "468b679c-378b-4009-9a17-a6711cefc85f",
    "activated": false,
    "activation_due": 10,
    "create_inventory": true,
    "trial": false,
    "expected_activation": "2018-10-09T00:00:00.000Z",
    "user_limit": 10,
    "access_provider": "ba3f3d45-247d-41f6-8dc9-6488adcad329",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2",
    "license": "7c063655-b384-4a6f-b367-3c2f95f7a49c"
  },
  "fund_distribution": [
    {
      "id": "64774a83-fd1d-469e-a4d9-ed4033082799",
      "code": "HIST",
      "percentage": 80.0,
      "encumbrance": "eb506834-6c70-4239-8d1a-6414a5b08ac3",
      "po_line_id": "c0d08448-347b-418a-8c2f-5fb50248d67e"
    },
    {
      "id": "0d1b2d39-512f-4e0f-a497-b89eba6ecae9",
      "code": "GENRL",
      "percentage": 20.0,
      "encumbrance": "0466cb77-0344-43c6-85eb-0a64aa2934e5",
      "po_line_id": "c0d08448-347b-418a-8c2f-5fb50248d67e"
    }
  ],
  "locations": [
    {
      "id": "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
      "location_id": "b241764c-1466-4e1d-a028-1a3684a5da87",
      "quantity": 5,
      "quantity_electronic": 1,
      "quantity_physical": 4,
      "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
    },
    {
      "id": "7d23e4e3-5043-44b0-9507-66e58d236f20",
      "location_id": "fcd64ce1-6995-48f0-840e-89ffa2288371",
      "quantity": 2,
      "quantity_electronic": 0,
      "quantity_physical": 2,
      "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
    }
  ],
  "order_format": "P/E Mix",
  "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
  "payment_status": "Awaiting Payment",
  "physical": {
    "volumes": [
      "vol. 1"
    ],
    "id": "5ee243f9-72e5-4464-bdbc-43a21873d648",
    "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
    "expectedReceiptDate": "2018-10-05T00:00:00.000Z",
    "receipt_due": "2018-10-10T00:00:00.000Z",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "po_line_description": "ABCDEFGHIJKLMNOPQRSTUVWXY",
  "po_line_number": "268758-03",
  "publication_date": "2017",
  "publisher": "Schiffer Publishing",
  "purchase_order_id": "d79b0bcc-DcAD-1E4E-Abb7-DbFcaD5BB3bb",
  "receipt_date": "2018-10-09T00:00:00.000Z",
  "receipt_status": "Awaiting Receipt",
  "reporting_codes": [
    {
      "code": "CODE1",
      "id": "5926dcd7-85f5-4504-8283-712595ebc38b",
      "description": "ABCDEF"
    },
    {
      "code": "CODE2",
      "id": "fa316c04-8101-4e72-8aaf-01281bac718f",
      "description": "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    },
    {
      "code": "CODE3",
      "id": "ea68b696-3125-4940-bf91-1d128323473e",
      "description": "ABCDE"
    }
  ],
  "requester": "Leo Bulero",
  "rush": true,
  "selector": "ABCD",
  "source": {
    "code": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
    "id": "024b6f41-c5c6-4280-858e-33fba452a334",
    "description": "ABCDEFGHIJKLMNO"
  },
  "tags": [
    "ABCDEFGHIJKLMNOPQRSTU",
    "ABCDEFG",
    "ABCDEFGHIJKLMNOPQRSTU",
    "ABCDEFGHIJKLMNO"
  ],
  "title": "Kayak Fishing in the Northern Gulf Coast",
  "vendor_detail": {
    "id": "d5065f0d-fb88-4d23-b0c1-57e754fba40e",
    "instructions": "ABCDEFG",
    "note_from_vendor": "ABCDEFGHIKJKLMNOP",
    "ref_number": "123456-78",
    "ref_number_type": "Supplier's unique order line reference number",
    "vendor_account": "8910-10",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "metadata": {
    "createdDate": "2018-07-19T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

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 order-line -- 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 order-lines -- unauthorized

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, 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/order-lines/{id}

Return a purchase order line with given {id}

GET /orders/order-lines/{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 purchase order line

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": "composite purchase order line with dereferenced/expanded orders fields",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID identifying this purchase order line",
      "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}$"
    },
    "edition": {
      "description": "edition of the material",
      "type": "string"
    },
    "checkin_items": {
      "description": "if true this will toggle the Check-in workflow for details associated with this PO line",
      "type": "boolean"
    },
    "instance_id": {
      "description": "UUID of the instance record this purchase order line is related to",
      "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}$"
    },
    "agreement_id": {
      "description": "UUID of the agreement this purchase order line is related to",
      "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}$"
    },
    "acquisition_method": {
      "description": "the acquisition method for this purchase order line",
      "type": "string",
      "enum": [
        "Approval Plan",
        "Demand Driven Acquisitions (DDA)",
        "Depository",
        "Evidence Based Acquisitions (EBA)",
        "Exchange",
        "Gift",
        "Purchase At Vendor System",
        "Purchase",
        "Technical"
      ]
    },
    "adjustment": {
      "description": "the adjustment record associated with this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/adjustment.json"
    },
    "alerts": {
      "description": "alerts associated with this purchase order line",
      "id": "alerts",
      "type": "array",
      "items": {
        "description": "an alert record",
        "type": "object",
        "$ref": "mod-orders-storage/schemas/alert.json"
      }
    },
    "cancellation_restriction": {
      "description": "whether or not there are cancellation restrictions for this purchase order line",
      "type": "boolean"
    },
    "cancellation_restriction_note": {
      "description": "free-form notes related to cancellation restrictions",
      "type": "string"
    },
    "claims": {
      "description": "claims associated with this purchase order line",
      "id": "claims",
      "type": "array",
      "items": {
        "description": "a claim record",
        "type": "object",
        "$ref": "mod-orders-storage/schemas/claim.json"
      }
    },
    "collection": {
      "description": "whether or not this purchase order line is for a collection",
      "type": "boolean"
    },
    "contributors": {
      "description": "list of contributors to the material",
      "id": "contributors",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "contributor": {
            "description": "the name of a contributor to the material",
            "type": "string"
          },
          "contributor_type": {
            "description": "UUID of the contributor type",
            "type": "string",
            "pattern": "^[a-f0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
          }
        }
      }
    },
    "cost": {
      "description": "cost details associated with this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/cost.json"
    },
    "description": {
      "description": "description of the material",
      "type": "string"
    },
    "details": {
      "description": "details about this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/details.json"
    },
    "donor": {
      "description": "the donor contributing to this purchase order line",
      "type": "string"
    },
    "eresource": {
      "description": "eresource-related details of this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/eresource.json"
    },
    "fund_distribution": {
      "description": "the UUIDs of the fund distribution records for this purchase order line",
      "id": "fund_distribution",
      "type": "array",
      "items": {
        "description": "a fund distribution record",
        "type": "object",
        "$ref": "mod-orders-storage/schemas/fund_distribution.json"
      }
    },
    "locations": {
      "description": "a list of the location records for this purchase order line",
      "id": "locations",
      "type": "array",
      "items": {
        "description": "The location details",
        "type": "object",
        "$ref": "mod-orders-storage/schemas/location.json"
      }
    },
    "order_format": {
      "description": "The purchase order line format",
      "type": "string",
      "enum": [
        "Electronic Resource",
        "P/E Mix",
        "Physical Resource",
        "Other"
      ]
    },
    "owner": {
      "description": "the owner of this purchase order line",
      "type": "string"
    },
    "payment_status": {
      "description": "The purchase order line payment status",
      "type": "string",
      "enum": [
        "Awaiting Payment",
        "Cancelled",
        "Fully Paid",
        "Partially Paid",
        "Payment Not Required",
        "Pending"
      ]
    },
    "physical": {
      "description": "details of this purchase order line relating to physical materials",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/physical.json"
    },
    "po_line_description": {
      "description": "purchase order line description",
      "type": "string"
    },
    "po_line_number": {
      "description": "A human readable number assigned to this PO line",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{5,16}-[0-9]{1,3}$",
      "readonly": true
    },
    "publication_date": {
      "description": "date (year) of the material's publication",
      "type": "string",
      "pattern": "^[0-9]{4}$"
    },
    "publisher": {
      "description": "publisher of the material",
      "type": "string"
    },
    "purchase_order_id": {
      "description": "UUID of this parent purchase order",
      "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}$"
    },
    "receipt_date": {
      "description": "date the purchase order line was received",
      "type": [
        "null",
        "string"
      ],
      "format": "date-time"
    },
    "receipt_status": {
      "description": "The purchase order line receipt status",
      "type": "string",
      "enum": [
        "Awaiting Receipt",
        "Cancelled",
        "Fully Received",
        "Partially Received",
        "Pending",
        "Receipt Not Required"
      ]
    },
    "reporting_codes": {
      "description": "a list of reporting codes associated with this purchase order line",
      "id": "reporting_codes",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "mod-orders-storage/schemas/reporting_code.json"
      }
    },
    "requester": {
      "description": "who requested this purchase order line",
      "type": "string"
    },
    "rush": {
      "description": "whether or not this is a rush order",
      "type": "boolean"
    },
    "selector": {
      "description": "who selected this material",
      "type": "string"
    },
    "source": {
      "description": "details related to the source of this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/source.json"
    },
    "tags": {
      "description": "arbitrary tags associated with this purchase order line",
      "id": "tags",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "title": {
      "description": "title of the material",
      "type": "string"
    },
    "vendor_detail": {
      "description": "details related to the vendor of this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/vendor_detail.json"
    },
    "metadata": {
      "type": "object",
      "$ref": "../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "source"
  ]
}

Example:

{
  "id": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "edition": "First edition",
  "checkin_items": false,
  "instance_id": "8343e5a0-fed8-11e8-8eb2-f2801f1b9fd1",
  "agreement_id": "bdc75fea-fed8-11e8-8eb2-f2801f1b9fd1",
  "acquisition_method": "Purchase At Vendor System",
  "adjustment": {
    "id": "1363467f-eb47-4e09-9e28-e25aa464adb7",
    "credit": 0.0,
    "discount": 0.0,
    "insurance": 0.0,
    "invoice_id": "2d6d495c-c237-476f-aa48-57f7cbf74ca4",
    "overhead": 0.0,
    "shipment": 0.0,
    "tax_1": 0.0,
    "tax_2": 0.0,
    "use_pro_rate": false,
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "alerts": [
    {
      "alert": "Receipt overdue",
      "id": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
      "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
    }
  ],
  "cancellation_restriction": false,
  "cancellation_restriction_note": "ABCDEFGHIJKLMNOPQRSTUVW",
  "claims": [
    {
      "id": "f7d7d4e4-255e-46dc-9f08-b953fb1e872d",
      "claimed": false,
      "sent": "2018-10-09T00:00:00.000Z",
      "grace": 30,
      "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
    }
  ],
  "collection": false,
  "contributors": [
    {
      "contributor": "Ed Mashburn",
      "contributor_type": "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
    }
  ],
  "cost": {
    "list_price": 24.99,
    "id": "e047212b-c94f-4cb1-84b0-367848381494",
    "currency": "USD",
    "quantity_physical": 6,
    "quantity_electronic": 1,
    "po_line_estimated_price": 174.93,
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "description": "ABCDEFGH",
  "details": {
    "id": "349d9438-12bd-4e2e-9eb6-dfa830ab99a4",
    "receiving_note": "ABCDEFGHIJKL",
    "product_ids": [
      {
        "product_id": "9780764354113",
        "product_id_type": "ISBN"
      }
    ],
    "material_types": [
      "f7e72403-2a13-43a4-a069-aaabe6c9dea8"
    ],
    "subscription_from": "2018-10-09T00:00:00.000Z",
    "subscription_interval": 824,
    "subscription_to": "2020-10-09T00:00:00.000Z",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "donor": "ABCDEFGHIJKLM",
  "eresource": {
    "id": "468b679c-378b-4009-9a17-a6711cefc85f",
    "activated": false,
    "activation_due": 10,
    "create_inventory": true,
    "trial": false,
    "expected_activation": "2018-10-09T00:00:00.000Z",
    "user_limit": 10,
    "access_provider": "ba3f3d45-247d-41f6-8dc9-6488adcad329",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2",
    "license": "7c063655-b384-4a6f-b367-3c2f95f7a49c"
  },
  "fund_distribution": [
    {
      "id": "64774a83-fd1d-469e-a4d9-ed4033082799",
      "code": "HIST",
      "percentage": 80.0,
      "encumbrance": "eb506834-6c70-4239-8d1a-6414a5b08ac3",
      "po_line_id": "c0d08448-347b-418a-8c2f-5fb50248d67e"
    },
    {
      "id": "0d1b2d39-512f-4e0f-a497-b89eba6ecae9",
      "code": "GENRL",
      "percentage": 20.0,
      "encumbrance": "0466cb77-0344-43c6-85eb-0a64aa2934e5",
      "po_line_id": "c0d08448-347b-418a-8c2f-5fb50248d67e"
    }
  ],
  "locations": [
    {
      "id": "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
      "location_id": "b241764c-1466-4e1d-a028-1a3684a5da87",
      "quantity": 5,
      "quantity_electronic": 1,
      "quantity_physical": 4,
      "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
    },
    {
      "id": "7d23e4e3-5043-44b0-9507-66e58d236f20",
      "location_id": "fcd64ce1-6995-48f0-840e-89ffa2288371",
      "quantity": 2,
      "quantity_electronic": 0,
      "quantity_physical": 2,
      "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
    }
  ],
  "order_format": "P/E Mix",
  "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
  "payment_status": "Awaiting Payment",
  "physical": {
    "volumes": [
      "vol. 1"
    ],
    "id": "5ee243f9-72e5-4464-bdbc-43a21873d648",
    "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
    "expectedReceiptDate": "2018-10-05T00:00:00.000Z",
    "receipt_due": "2018-10-10T00:00:00.000Z",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "po_line_description": "ABCDEFGHIJKLMNOPQRSTUVWXY",
  "po_line_number": "268758-03",
  "publication_date": "2017",
  "publisher": "Schiffer Publishing",
  "purchase_order_id": "d79b0bcc-DcAD-1E4E-Abb7-DbFcaD5BB3bb",
  "receipt_date": "2018-10-09T00:00:00.000Z",
  "receipt_status": "Awaiting Receipt",
  "reporting_codes": [
    {
      "code": "CODE1",
      "id": "5926dcd7-85f5-4504-8283-712595ebc38b",
      "description": "ABCDEF"
    },
    {
      "code": "CODE2",
      "id": "fa316c04-8101-4e72-8aaf-01281bac718f",
      "description": "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    },
    {
      "code": "CODE3",
      "id": "ea68b696-3125-4940-bf91-1d128323473e",
      "description": "ABCDE"
    }
  ],
  "requester": "Leo Bulero",
  "rush": true,
  "selector": "ABCD",
  "source": {
    "code": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
    "id": "024b6f41-c5c6-4280-858e-33fba452a334",
    "description": "ABCDEFGHIJKLMNO"
  },
  "tags": [
    "ABCDEFGHIJKLMNOPQRSTU",
    "ABCDEFG",
    "ABCDEFGHIJKLMNOPQRSTU",
    "ABCDEFGHIJKLMNO"
  ],
  "title": "Kayak Fishing in the Northern Gulf Coast",
  "vendor_detail": {
    "id": "d5065f0d-fb88-4d23-b0c1-57e754fba40e",
    "instructions": "ABCDEFG",
    "note_from_vendor": "ABCDEFGHIKJKLMNOP",
    "ref_number": "123456-78",
    "ref_number_type": "Supplier's unique order line reference number",
    "vendor_account": "8910-10",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "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: 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:

"order-line not found"

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, 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/order-lines/{id}

Update a purchase order line with given {id}

PUT /orders/order-lines/{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 purchase order line

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": "composite purchase order line with dereferenced/expanded orders fields",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID identifying this purchase order line",
      "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}$"
    },
    "edition": {
      "description": "edition of the material",
      "type": "string"
    },
    "checkin_items": {
      "description": "if true this will toggle the Check-in workflow for details associated with this PO line",
      "type": "boolean"
    },
    "instance_id": {
      "description": "UUID of the instance record this purchase order line is related to",
      "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}$"
    },
    "agreement_id": {
      "description": "UUID of the agreement this purchase order line is related to",
      "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}$"
    },
    "acquisition_method": {
      "description": "the acquisition method for this purchase order line",
      "type": "string",
      "enum": [
        "Approval Plan",
        "Demand Driven Acquisitions (DDA)",
        "Depository",
        "Evidence Based Acquisitions (EBA)",
        "Exchange",
        "Gift",
        "Purchase At Vendor System",
        "Purchase",
        "Technical"
      ]
    },
    "adjustment": {
      "description": "the adjustment record associated with this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/adjustment.json"
    },
    "alerts": {
      "description": "alerts associated with this purchase order line",
      "id": "alerts",
      "type": "array",
      "items": {
        "description": "an alert record",
        "type": "object",
        "$ref": "mod-orders-storage/schemas/alert.json"
      }
    },
    "cancellation_restriction": {
      "description": "whether or not there are cancellation restrictions for this purchase order line",
      "type": "boolean"
    },
    "cancellation_restriction_note": {
      "description": "free-form notes related to cancellation restrictions",
      "type": "string"
    },
    "claims": {
      "description": "claims associated with this purchase order line",
      "id": "claims",
      "type": "array",
      "items": {
        "description": "a claim record",
        "type": "object",
        "$ref": "mod-orders-storage/schemas/claim.json"
      }
    },
    "collection": {
      "description": "whether or not this purchase order line is for a collection",
      "type": "boolean"
    },
    "contributors": {
      "description": "list of contributors to the material",
      "id": "contributors",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "contributor": {
            "description": "the name of a contributor to the material",
            "type": "string"
          },
          "contributor_type": {
            "description": "UUID of the contributor type",
            "type": "string",
            "pattern": "^[a-f0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
          }
        }
      }
    },
    "cost": {
      "description": "cost details associated with this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/cost.json"
    },
    "description": {
      "description": "description of the material",
      "type": "string"
    },
    "details": {
      "description": "details about this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/details.json"
    },
    "donor": {
      "description": "the donor contributing to this purchase order line",
      "type": "string"
    },
    "eresource": {
      "description": "eresource-related details of this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/eresource.json"
    },
    "fund_distribution": {
      "description": "the UUIDs of the fund distribution records for this purchase order line",
      "id": "fund_distribution",
      "type": "array",
      "items": {
        "description": "a fund distribution record",
        "type": "object",
        "$ref": "mod-orders-storage/schemas/fund_distribution.json"
      }
    },
    "locations": {
      "description": "a list of the location records for this purchase order line",
      "id": "locations",
      "type": "array",
      "items": {
        "description": "The location details",
        "type": "object",
        "$ref": "mod-orders-storage/schemas/location.json"
      }
    },
    "order_format": {
      "description": "The purchase order line format",
      "type": "string",
      "enum": [
        "Electronic Resource",
        "P/E Mix",
        "Physical Resource",
        "Other"
      ]
    },
    "owner": {
      "description": "the owner of this purchase order line",
      "type": "string"
    },
    "payment_status": {
      "description": "The purchase order line payment status",
      "type": "string",
      "enum": [
        "Awaiting Payment",
        "Cancelled",
        "Fully Paid",
        "Partially Paid",
        "Payment Not Required",
        "Pending"
      ]
    },
    "physical": {
      "description": "details of this purchase order line relating to physical materials",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/physical.json"
    },
    "po_line_description": {
      "description": "purchase order line description",
      "type": "string"
    },
    "po_line_number": {
      "description": "A human readable number assigned to this PO line",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{5,16}-[0-9]{1,3}$",
      "readonly": true
    },
    "publication_date": {
      "description": "date (year) of the material's publication",
      "type": "string",
      "pattern": "^[0-9]{4}$"
    },
    "publisher": {
      "description": "publisher of the material",
      "type": "string"
    },
    "purchase_order_id": {
      "description": "UUID of this parent purchase order",
      "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}$"
    },
    "receipt_date": {
      "description": "date the purchase order line was received",
      "type": [
        "null",
        "string"
      ],
      "format": "date-time"
    },
    "receipt_status": {
      "description": "The purchase order line receipt status",
      "type": "string",
      "enum": [
        "Awaiting Receipt",
        "Cancelled",
        "Fully Received",
        "Partially Received",
        "Pending",
        "Receipt Not Required"
      ]
    },
    "reporting_codes": {
      "description": "a list of reporting codes associated with this purchase order line",
      "id": "reporting_codes",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "mod-orders-storage/schemas/reporting_code.json"
      }
    },
    "requester": {
      "description": "who requested this purchase order line",
      "type": "string"
    },
    "rush": {
      "description": "whether or not this is a rush order",
      "type": "boolean"
    },
    "selector": {
      "description": "who selected this material",
      "type": "string"
    },
    "source": {
      "description": "details related to the source of this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/source.json"
    },
    "tags": {
      "description": "arbitrary tags associated with this purchase order line",
      "id": "tags",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "title": {
      "description": "title of the material",
      "type": "string"
    },
    "vendor_detail": {
      "description": "details related to the vendor of this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/vendor_detail.json"
    },
    "metadata": {
      "type": "object",
      "$ref": "../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "source"
  ]
}

Example:

{
  "id": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "edition": "First edition",
  "checkin_items": false,
  "instance_id": "8343e5a0-fed8-11e8-8eb2-f2801f1b9fd1",
  "agreement_id": "bdc75fea-fed8-11e8-8eb2-f2801f1b9fd1",
  "acquisition_method": "Purchase At Vendor System",
  "adjustment": {
    "id": "1363467f-eb47-4e09-9e28-e25aa464adb7",
    "credit": 0.0,
    "discount": 0.0,
    "insurance": 0.0,
    "invoice_id": "2d6d495c-c237-476f-aa48-57f7cbf74ca4",
    "overhead": 0.0,
    "shipment": 0.0,
    "tax_1": 0.0,
    "tax_2": 0.0,
    "use_pro_rate": false,
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "alerts": [
    {
      "alert": "Receipt overdue",
      "id": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
      "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
    }
  ],
  "cancellation_restriction": false,
  "cancellation_restriction_note": "ABCDEFGHIJKLMNOPQRSTUVW",
  "claims": [
    {
      "id": "f7d7d4e4-255e-46dc-9f08-b953fb1e872d",
      "claimed": false,
      "sent": "2018-10-09T00:00:00.000Z",
      "grace": 30,
      "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
    }
  ],
  "collection": false,
  "contributors": [
    {
      "contributor": "Ed Mashburn",
      "contributor_type": "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
    }
  ],
  "cost": {
    "list_price": 24.99,
    "id": "e047212b-c94f-4cb1-84b0-367848381494",
    "currency": "USD",
    "quantity_physical": 6,
    "quantity_electronic": 1,
    "po_line_estimated_price": 174.93,
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "description": "ABCDEFGH",
  "details": {
    "id": "349d9438-12bd-4e2e-9eb6-dfa830ab99a4",
    "receiving_note": "ABCDEFGHIJKL",
    "product_ids": [
      {
        "product_id": "9780764354113",
        "product_id_type": "ISBN"
      }
    ],
    "material_types": [
      "f7e72403-2a13-43a4-a069-aaabe6c9dea8"
    ],
    "subscription_from": "2018-10-09T00:00:00.000Z",
    "subscription_interval": 824,
    "subscription_to": "2020-10-09T00:00:00.000Z",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "donor": "ABCDEFGHIJKLM",
  "eresource": {
    "id": "468b679c-378b-4009-9a17-a6711cefc85f",
    "activated": false,
    "activation_due": 10,
    "create_inventory": true,
    "trial": false,
    "expected_activation": "2018-10-09T00:00:00.000Z",
    "user_limit": 10,
    "access_provider": "ba3f3d45-247d-41f6-8dc9-6488adcad329",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2",
    "license": "7c063655-b384-4a6f-b367-3c2f95f7a49c"
  },
  "fund_distribution": [
    {
      "id": "64774a83-fd1d-469e-a4d9-ed4033082799",
      "code": "HIST",
      "percentage": 80.0,
      "encumbrance": "eb506834-6c70-4239-8d1a-6414a5b08ac3",
      "po_line_id": "c0d08448-347b-418a-8c2f-5fb50248d67e"
    },
    {
      "id": "0d1b2d39-512f-4e0f-a497-b89eba6ecae9",
      "code": "GENRL",
      "percentage": 20.0,
      "encumbrance": "0466cb77-0344-43c6-85eb-0a64aa2934e5",
      "po_line_id": "c0d08448-347b-418a-8c2f-5fb50248d67e"
    }
  ],
  "locations": [
    {
      "id": "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
      "location_id": "b241764c-1466-4e1d-a028-1a3684a5da87",
      "quantity": 5,
      "quantity_electronic": 1,
      "quantity_physical": 4,
      "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
    },
    {
      "id": "7d23e4e3-5043-44b0-9507-66e58d236f20",
      "location_id": "fcd64ce1-6995-48f0-840e-89ffa2288371",
      "quantity": 2,
      "quantity_electronic": 0,
      "quantity_physical": 2,
      "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
    }
  ],
  "order_format": "P/E Mix",
  "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
  "payment_status": "Awaiting Payment",
  "physical": {
    "volumes": [
      "vol. 1"
    ],
    "id": "5ee243f9-72e5-4464-bdbc-43a21873d648",
    "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
    "expectedReceiptDate": "2018-10-05T00:00:00.000Z",
    "receipt_due": "2018-10-10T00:00:00.000Z",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "po_line_description": "ABCDEFGHIJKLMNOPQRSTUVWXY",
  "po_line_number": "268758-03",
  "publication_date": "2017",
  "publisher": "Schiffer Publishing",
  "purchase_order_id": "d79b0bcc-DcAD-1E4E-Abb7-DbFcaD5BB3bb",
  "receipt_date": "2018-10-09T00:00:00.000Z",
  "receipt_status": "Awaiting Receipt",
  "reporting_codes": [
    {
      "code": "CODE1",
      "id": "5926dcd7-85f5-4504-8283-712595ebc38b",
      "description": "ABCDEF"
    },
    {
      "code": "CODE2",
      "id": "fa316c04-8101-4e72-8aaf-01281bac718f",
      "description": "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    },
    {
      "code": "CODE3",
      "id": "ea68b696-3125-4940-bf91-1d128323473e",
      "description": "ABCDE"
    }
  ],
  "requester": "Leo Bulero",
  "rush": true,
  "selector": "ABCD",
  "source": {
    "code": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
    "id": "024b6f41-c5c6-4280-858e-33fba452a334",
    "description": "ABCDEFGHIJKLMNO"
  },
  "tags": [
    "ABCDEFGHIJKLMNOPQRSTU",
    "ABCDEFG",
    "ABCDEFGHIJKLMNOPQRSTU",
    "ABCDEFGHIJKLMNO"
  ],
  "title": "Kayak Fishing in the Northern Gulf Coast",
  "vendor_detail": {
    "id": "d5065f0d-fb88-4d23-b0c1-57e754fba40e",
    "instructions": "ABCDEFG",
    "note_from_vendor": "ABCDEFGHIKJKLMNOP",
    "ref_number": "123456-78",
    "ref_number_type": "Supplier's unique order line reference number",
    "vendor_account": "8910-10",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "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: 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 update order-line -- malformed JSON at 13:4"

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:

"order-line not found"

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, 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

DELETE /orders/order-lines/{id}

Delete a purchase order line with given {id}

DELETE /orders/order-lines/{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 purchase order line

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: 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 delete order-line -- constraint violation"

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:

"order-line not found"

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, 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/po-number

Get generated PO number

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

    Requested language. Optional. [lang=en]

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Generated PO number object",
  "type": "object",
  "properties": {
    "poNumber": {
      "description": "A human readable generated or manually entered ID assigned to the purchase order",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{5,16}$"
    }
  },
  "required": [
    "poNumber"
  ],
  "additionalProperties": false
}

Example:

{
  "poNumber" : "100500"
}

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"
        }
      ]
    }
  ]
}

POST /orders/po-number/validate

validate if the PO Number is unique and matches the pattern specified

POST /orders/po-number/validate
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": "Generated PO number object",
  "type": "object",
  "properties": {
    "poNumber": {
      "description": "A human readable generated or manually entered ID assigned to the purchase order",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{5,16}$"
    }
  },
  "required": [
    "poNumber"
  ],
  "additionalProperties": false
}

Example:

{
  "poNumber" : "100500"
}

Response 204

Valid PO Number

Response 400

Bad request, e.g. existing PO Number. Details of the error 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"
        }
      ]
    }
  ]
}

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, 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"
        }
      ]
    }
  ]
}

POST /orders/receive

Receive items spanning one or more PO lines

POST /orders/receive
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": "A collection of receiving items",
  "type": "object",
  "properties": {
    "toBeReceived": {
      "description": "List of receivings",
      "id": "toBeReceived",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "poLineId": {
            "description": "The id of the receiving PO line",
            "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}$"
          },
          "received": {
            "description": "The number of items received",
            "type": "integer"
          },
          "receivedItems": {
            "description": "List of receiving items details",
            "id": "receivedItems",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "barcode": {
                  "description": "The barcode assigned to the item",
                  "type": "string"
                },
                "comment": {
                  "description": "The free form notes pertaining to this item",
                  "type": "string"
                },
                "caption": {
                  "description": "The volume or caption of the item",
                  "type": "string"
                },
                "locationId": {
                  "description": "The id of the location",
                  "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}$"
                },
                "pieceId": {
                  "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}$"
                }
              },
              "required": [
                "pieceId"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "poLineId"
        ],
        "additionalProperties": false
      }
    },
    "totalRecords": {
      "description": "The total number of receiving items in the list",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "toBeReceived",
    "totalRecords"
  ]
}

Example:

{
  "toBeReceived": [
    {
      "poLineId": "0804ddec-6545-404a-b54d-a693f505681d",
      "received": 2,
      "receivedItems": [
        {
          "barcode": "0987654321",
          "comment": "Very important note",
          "caption": "Vol. 1",
          "locationId": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6",
          "pieceId": "c18c49b7-d970-44d6-b5d4-bd76c1c62d83"
        },
        {
          "barcode": "0987654111",
          "comment": "Very important note",
          "caption": "Vol. 2",
          "locationId": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6"
          "pieceId": "cb9b0468-f2b4-4a13-b64c-662c4c9ec3ed"
        }
      ]
    },
    {
      "poLineId": "7f0c4975-885e-47d5-8d5a-793dffbba9b2",
      "received": 1,
      "receivedItems": [
        {
          "barcode": "0987654333",
          "comment": "Very important note",
          "caption": "Vol. 286",
          "locationId": "279f42ce-17d1-463e-b890-deeebd1baeee"
          "pieceId": "20241b8c-9076-4cf5-817b-f2c1e2cb242f"
        }
      ]
    }
  ],
  "totalRecords": 3
}

Response 200

Returns processing result of the receive

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A collection of receiving results",
  "type": "object",
  "properties": {
    "receivingResults": {
      "description": "List of receiving results",
      "id": "receivingResults",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "poLineId": {
            "description": "The id of the receiving po line",
            "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}$"
          },
          "processedSuccessfully": {
            "description": "The number of items processed successfully",
            "type": "integer"
          },
          "processedWithError": {
            "description": "The number of items processed with error",
            "type": "integer"
          },
          "receivingItemResults": {
            "description": "List of processed receiving item details",
            "id": "receivingItemResults",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "pieceId": {
                  "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}$"
                },
                "processingStatus": {
                  "description": "The status describing item processing result",
                  "type": "object",
                  "properties": {
                    "type": {
                      "description": "Resulting status of the processed piece record",
                      "type": "string",
                      "enum": [
                        "success",
                        "failure"
                      ]
                    },
                    "message": {
                      "description": "The message describing processed piece record",
                      "type": "string"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "pieceId",
                "processingStatus"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "poLineId",
          "receivingItemResults"
        ],
        "additionalProperties": false
      }
    },
    "totalRecords": {
      "description": "The total number of receiving items in the list",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "receivingResults",
    "totalRecords"
  ]
}

Example:

{
  "receivingResults": [
    {
      "poLineId": "0804ddec-6545-404a-b54d-a693f505681d",
      "processedSuccessfully": 1,
      "processedWithError": 1,
      "receivingItemResults": [
        {
          "pieceId": "c18c49b7-d970-44d6-b5d4-bd76c1c62d83",
          "processingStatus": {
            "type": "success"
          }
        },
        {
          "pieceId": "cb9b0468-f2b4-4a13-b64c-662c4c9ec3ed",
          "processingStatus": {
            "type": "failure",
            "message": "The item has not been updated in the inventory"
          }
        }
      ]
    },
    {
      "poLineId": "7f0c4975-885e-47d5-8d5a-793dffbba9b2",
      "processedSuccessfully": 1,
      "processedWithError": 0,
      "receivingItemResults": [
        {
          "pieceId": "20241b8c-9076-4cf5-817b-f2c1e2cb242f",
          "processingStatus": {
            "type": "success"
          }
        }
      ]
    }
  ],
  "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 update receive -- malformed JSON at 13:4"

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, 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/check-in

Check-in items spanning one or more po_lines in this order

POST /orders/check-in
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": "A collection of check-in",
  "type": "object",
  "properties": {
    "checkInItems": {
      "description": "List of check-in",
      "id": "checkInItems",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "poLineId": {
            "description": "The id of the checkin PO line",
            "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}$"
          },
          "checkedIn": {
            "description": "The number of items to check-in",
            "type": "integer"
          },
          "checkInPieces": {
            "description": "A collection of piece records",
            "type": "array",
            "id": "checkInPieces",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "description": "The id of the piece",
                  "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}$"
                },
                "barcode": {
                  "description": "The barcode assigned to the piece",
                  "type": "string"
                },
                "comment": {
                  "description": "The free form notes pertaining to the piece",
                  "type": "string"
                },
                "caption": {
                  "description": "The enumeration caption of the piece",
                  "type": "string"
                },
                "createItem": {
                  "description": "Whether or not to create an item record for this piece",
                  "type": "boolean"
                },   
                "supplement": {
                  "description": "Whether or not this is a supplementary material for this piece",
                  "type": "boolean"
                }, 
                "locationId": {
                  "description": "The id of the location",
                  "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}$"
                },
                "materialTypeId": {
                  "description": "The id of the materialType",
                  "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}$"
                },
                "productId": {
                  "description": "The id of the Product",
                  "type": "string"
                },
                "productIdType": {
                  "description": "The UUID corresponding to the type of product id",
                  "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}$"
                },
                "accessionNumber": {
                  "description": "The number referencing physical item acquired by the library",
                  "type": "string"
                },
                "itemDescription": {
                  "description": "The description associated with the item record",
                  "type": "string"
                },
                "electronicBookplate": {
                  "description": "A text that relates to the owner of the book",
                  "type": "string"
                }                                
              },
              "additionalProperties": false,
              "required": [
                "caption",
                "locationId"
              ]   
            }
          }
        },
        "additionalProperties": false,
        "required": [
          "poLineId"
        ]
      }
    },
    "totalRecords": {
      "description": "The total number of checkin items in the list",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "checkInItems",
    "totalRecords"
  ]
}

Example:

{
  "checkInItems": [
    {
      "poLineId": "0804ddec-6545-404a-b54d-a693f505681d",
      "checkedIn": 2,
      "checkInPieces": [
        {
          "id": "5e317dc2-deeb-4429-b2a1-91e5cd0fd5f7",
          "barcode": "0987654321",
          "comment": "Very important note",
          "caption": "Vol. 1",
          "createItem": true,
          "supplement": false,
          "locationId": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6",
          "materialTypeId": "3cdc2cd3-6646-43bf-aacc-37934aeae36c",
          "productId": "9780547840482",
          "productIdType": "bae22dfa-5ea8-43aa-b61d-8da89ba339c4",
          "accessionNumber": "1956.1",
          "itemDescription": "This is the piece item one to checkin",
          "electronicBookplate": "This book is from the Harvard University library"
        },
        {
          "id": "71d9322b-5cdd-45d8-ad45-c7f3044802e7",
          "barcode": "0987654111",
          "comment": "Very important note",
          "caption": "Vol. 2",
          "createItem": false,
          "supplement": true,
          "locationId": "c21a334d-b11a-49ff-88d9-97a700ed263e",
          "materialTypeId": "93da93b3-5c2c-4077-b92d-12341d2070d2",
          "productId": "2573-0797",
          "productIdType": "31dcaba7-bce1-4a12-bd06-9ce901422285",
          "accessionNumber": "2002.4",
          "itemDescription": "This is the piece item two to checkin",
          "electronicBookplate": "This book is from the Florida University library"
        }
      ]
    }
  ],
  "totalRecords": 2
}

Response 200

Returns processing result of the check-in

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A collection of receiving results",
  "type": "object",
  "properties": {
    "receivingResults": {
      "description": "List of receiving results",
      "id": "receivingResults",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "poLineId": {
            "description": "The id of the receiving po line",
            "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}$"
          },
          "processedSuccessfully": {
            "description": "The number of items processed successfully",
            "type": "integer"
          },
          "processedWithError": {
            "description": "The number of items processed with error",
            "type": "integer"
          },
          "receivingItemResults": {
            "description": "List of processed receiving item details",
            "id": "receivingItemResults",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "pieceId": {
                  "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}$"
                },
                "processingStatus": {
                  "description": "The status describing item processing result",
                  "type": "object",
                  "properties": {
                    "type": {
                      "description": "Resulting status of the processed piece record",
                      "type": "string",
                      "enum": [
                        "success",
                        "failure"
                      ]
                    },
                    "message": {
                      "description": "The message describing processed piece record",
                      "type": "string"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "pieceId",
                "processingStatus"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "poLineId",
          "receivingItemResults"
        ],
        "additionalProperties": false
      }
    },
    "totalRecords": {
      "description": "The total number of receiving items in the list",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "receivingResults",
    "totalRecords"
  ]
}

Example:

{
  "receivingResults": [
    {
      "poLineId": "0804ddec-6545-404a-b54d-a693f505681d",
      "processedSuccessfully": 1,
      "processedWithError": 1,
      "receivingItemResults": [
        {
          "pieceId": "c18c49b7-d970-44d6-b5d4-bd76c1c62d83",
          "processingStatus": {
            "type": "success"
          }
        },
        {
          "pieceId": "cb9b0468-f2b4-4a13-b64c-662c4c9ec3ed",
          "processingStatus": {
            "type": "failure",
            "message": "The item has not been updated in the inventory"
          }
        }
      ]
    },
    {
      "poLineId": "7f0c4975-885e-47d5-8d5a-793dffbba9b2",
      "processedSuccessfully": 1,
      "processedWithError": 0,
      "receivingItemResults": [
        {
          "pieceId": "20241b8c-9076-4cf5-817b-f2c1e2cb242f",
          "processingStatus": {
            "type": "success"
          }
        }
      ]
    }
  ],
  "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 update check-in -- malformed JSON at 13:4"

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, 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

Receiving history

Get receiving history matching the provided criteria

GET /orders/receiving-history
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.

    With valid searchable fields

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    title==Harry Potter AND receiving_status==received sortBy po_line_number
    
  • 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": "collection of receiving history",
  "type": "object",
  "properties": {
    "receiving_history": {
      "description": "collection of receiving history",
      "type": "array",
      "id": "receiving_history",
      "items": {
        "type": "object",
        "$ref": "receiving_history.json"
      }
    },
    "total_records": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    },
    "first": {
      "description": "The index of the first object contained in this collection",
      "type": "integer"
    },
    "last": {
      "description": "The index of the last object contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "receiving_history",
    "total_records"
  ]
}

Example:

{
  "receiving_history":
    [
      {
        "id": "5e317dc2-deeb-4429-b2a1-91e5cd0fd5f7",
        "caption": "Tutorial Volume 10",
        "comment": "Special Edition",
        "dateOrdered": "2018-09-09T00:00:00.000",
        "itemId": "1c92433e-916d-452e-ac76-5268d0ec3f66",
        "poLineId": "c1498090-538a-4470-9525-27e4e0c74b07",
        "poLineNumber": "268758-03",
        "purchaseOrderId": "0804ddec-6545-404a-b54d-a693f505681d",
        "receivedDate": "2018-10-09T00:00:00.000Z",
        "receivingNote": "ASD FGH ABCDEFGHIJKLMNOPQ",
        "receivingStatus": "Expected",
        "supplement": true,
        "title": "Kayak Fishing in the Northern Gulf Coast"
      }
    ],
  "total_records": 1,
  "first": 1,
  "last": 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: 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 receiving-history -- 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 receiving-history -- unauthorized"

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:

"receiving-history not found"

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, 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