Orders (v1)

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

Table of contents

Orders Business Logic API

API for managing purchase orders

Orders

POST /orders

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

POST /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}$"
    },
    "created": {
      "description": "date/time when this purchase order was created",
      "type": "string",
      "format": "date-time"
    },
    "created_by": {
      "description": "UUID of the user this purchase order was created by",
      "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}$"
    },
    "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"
    },
    "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"
      ]
    },
    "po_lines": {
      "description": "a list of completely de-referenced purchase order lines",
      "id": "po_lines",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "composite_po_line.json"
      }
    }
  },
  "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",
  "created": "2010-10-08T03:53:00.000Z",
  "created_by": "ab18897b-0e40-4f31-896b-9c9adc979a88",
  "notes": [
    "ABCDEFGHIJKLMNO",
    "ABCDEFGHIJKLMNOPQRST",
    "ABCDEFGHIJKLMNOPQRSTUV"
  ],
  "order_type": "Ongoing",
  "po_number": "268758",
  "re_encumber": false,
  "total_estimated_price": 49.98,
  "total_items": 2,
  "vendor": "168f8a86-d26c-406e-813f-c7527f241ac3",
  "workflow_status": "Open",
  "po_lines": [
    {
      "id": "c0d08448-347b-418a-8c2f-5fb50248d67e",
      "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": 1,
        "quantity_electronic": 1,
        "po_line_estimated_price": 49.98,
        "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"
        } 
      ],
      "location": {
        "id": "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
        "location_id": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6",
        "quantity": 2,
        "quantity_electronic": 1,
        "quantity_physical": 1,
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "order_format": "Physical Resource",
      "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
      "payment_status": "Awaiting Payment",
      "physical": {
        "volumes": 1,
        "id": "5ee243f9-72e5-4464-bdbc-43a21873d648",
        "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
        "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",
      "po_line_workflow_status": "Open",
      "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",
      "renewal": {
        "interval": 182,
        "id": "8e414baa-8cf2-4916-a90f-d1da4009e06e",
        "cycle": "6 Months",
        "manual_renewal": true,
        "review_period": 30,
        "renewal_date": "2019-04-09T00:00:00.000Z",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },      
      "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"
      }
    }
  ]
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created order item

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}$"
    },
    "created": {
      "description": "date/time when this purchase order was created",
      "type": "string",
      "format": "date-time"
    },
    "created_by": {
      "description": "UUID of the user this purchase order was created by",
      "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}$"
    },
    "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"
    },
    "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"
      ]
    },
    "po_lines": {
      "description": "a list of completely de-referenced purchase order lines",
      "id": "po_lines",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "composite_po_line.json"
      }
    }
  },
  "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",
  "created": "2010-10-08T03:53:00.000Z",
  "created_by": "ab18897b-0e40-4f31-896b-9c9adc979a88",
  "notes": [
    "ABCDEFGHIJKLMNO",
    "ABCDEFGHIJKLMNOPQRST",
    "ABCDEFGHIJKLMNOPQRSTUV"
  ],
  "order_type": "Ongoing",
  "po_number": "268758",
  "re_encumber": false,
  "total_estimated_price": 49.98,
  "total_items": 2,
  "vendor": "168f8a86-d26c-406e-813f-c7527f241ac3",
  "workflow_status": "Open",
  "po_lines": [
    {
      "id": "c0d08448-347b-418a-8c2f-5fb50248d67e",
      "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": 1,
        "quantity_electronic": 1,
        "po_line_estimated_price": 49.98,
        "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"
        } 
      ],
      "location": {
        "id": "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
        "location_id": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6",
        "quantity": 2,
        "quantity_electronic": 1,
        "quantity_physical": 1,
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "order_format": "Physical Resource",
      "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
      "payment_status": "Awaiting Payment",
      "physical": {
        "volumes": 1,
        "id": "5ee243f9-72e5-4464-bdbc-43a21873d648",
        "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
        "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",
      "po_line_workflow_status": "Open",
      "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",
      "renewal": {
        "interval": 182,
        "id": "8e414baa-8cf2-4916-a90f-d1da4009e06e",
        "cycle": "6 Months",
        "manual_renewal": true,
        "review_period": 30,
        "renewal_date": "2019-04-09T00:00:00.000Z",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },      
      "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"
      }
    }
  ]
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

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

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create order -- 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: text/plain

Type: any

Example:

Internal server error, contact administrator

PUT /orders/{id}

Update an order by id

PUT /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}$"
    },
    "created": {
      "description": "date/time when this purchase order was created",
      "type": "string",
      "format": "date-time"
    },
    "created_by": {
      "description": "UUID of the user this purchase order was created by",
      "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}$"
    },
    "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"
    },
    "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"
      ]
    },
    "po_lines": {
      "description": "a list of completely de-referenced purchase order lines",
      "id": "po_lines",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "composite_po_line.json"
      }
    }
  },
  "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",
  "created": "2010-10-08T03:53:00.000Z",
  "created_by": "ab18897b-0e40-4f31-896b-9c9adc979a88",
  "notes": [
    "ABCDEFGHIJKLMNO",
    "ABCDEFGHIJKLMNOPQRST",
    "ABCDEFGHIJKLMNOPQRSTUV"
  ],
  "order_type": "Ongoing",
  "po_number": "268758",
  "re_encumber": false,
  "total_estimated_price": 49.98,
  "total_items": 2,
  "vendor": "168f8a86-d26c-406e-813f-c7527f241ac3",
  "workflow_status": "Open",
  "po_lines": [
    {
      "id": "c0d08448-347b-418a-8c2f-5fb50248d67e",
      "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": 1,
        "quantity_electronic": 1,
        "po_line_estimated_price": 49.98,
        "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"
        } 
      ],
      "location": {
        "id": "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
        "location_id": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6",
        "quantity": 2,
        "quantity_electronic": 1,
        "quantity_physical": 1,
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "order_format": "Physical Resource",
      "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
      "payment_status": "Awaiting Payment",
      "physical": {
        "volumes": 1,
        "id": "5ee243f9-72e5-4464-bdbc-43a21873d648",
        "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
        "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",
      "po_line_workflow_status": "Open",
      "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",
      "renewal": {
        "interval": 182,
        "id": "8e414baa-8cf2-4916-a90f-d1da4009e06e",
        "cycle": "6 Months",
        "manual_renewal": true,
        "review_period": 30,
        "renewal_date": "2019-04-09T00:00:00.000Z",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },      
      "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"
      }
    }
  ]
}

Response 204

Item successfully updated

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to update order -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"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: text/plain

Type: any

Example:

internal server error, contact administrator

GET /orders/{id}

Retrieve order item with given {orderId}

GET /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}$"
    },
    "created": {
      "description": "date/time when this purchase order was created",
      "type": "string",
      "format": "date-time"
    },
    "created_by": {
      "description": "UUID of the user this purchase order was created by",
      "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}$"
    },
    "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"
    },
    "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"
      ]
    },
    "po_lines": {
      "description": "a list of completely de-referenced purchase order lines",
      "id": "po_lines",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "composite_po_line.json"
      }
    }
  },
  "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",
  "created": "2010-10-08T03:53:00.000Z",
  "created_by": "ab18897b-0e40-4f31-896b-9c9adc979a88",
  "notes": [
    "ABCDEFGHIJKLMNO",
    "ABCDEFGHIJKLMNOPQRST",
    "ABCDEFGHIJKLMNOPQRSTUV"
  ],
  "order_type": "Ongoing",
  "po_number": "268758",
  "re_encumber": false,
  "total_estimated_price": 49.98,
  "total_items": 2,
  "vendor": "168f8a86-d26c-406e-813f-c7527f241ac3",
  "workflow_status": "Open",
  "po_lines": [
    {
      "id": "c0d08448-347b-418a-8c2f-5fb50248d67e",
      "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": 1,
        "quantity_electronic": 1,
        "po_line_estimated_price": 49.98,
        "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"
        } 
      ],
      "location": {
        "id": "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
        "location_id": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6",
        "quantity": 2,
        "quantity_electronic": 1,
        "quantity_physical": 1,
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },
      "order_format": "Physical Resource",
      "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
      "payment_status": "Awaiting Payment",
      "physical": {
        "volumes": 1,
        "id": "5ee243f9-72e5-4464-bdbc-43a21873d648",
        "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
        "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",
      "po_line_workflow_status": "Open",
      "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",
      "renewal": {
        "interval": 182,
        "id": "8e414baa-8cf2-4916-a90f-d1da4009e06e",
        "cycle": "6 Months",
        "manual_renewal": true,
        "review_period": 30,
        "renewal_date": "2019-04-09T00:00:00.000Z",
        "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
      },      
      "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"
      }
    }
  ]
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"order not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /orders/{id}

Delete order item with given {orderId}

DELETE /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: text/plain

Type: any

Example:

"unable to delete order -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"order not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

Create a new purchace order line

Post a purchase order (PO) line

POST /orders/{id}/lines
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 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}$"
    },
    "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"
      }
    },
    "location": {
      "description": "location details of this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/location.json"
    },
    "order_format": {
      "description": "The purchase order line format",
      "type": "string",
      "enum": [
        "Container",
        "Electronic Resource",
        "P/E Mix",
        "Physical Resource",
        "Service"
      ]
    },
    "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}$"
    },
    "po_line_workflow_status": {
      "description": "The status of this purchase order line",
      "type": "string",
      "enum": [
        "Closed",
        "Open",
        "Pending"
      ]
    },
    "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"
      ]
    },
    "renewal": {
      "description": "renewal information assoicated with this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/renewal.json"
    },
    "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"
    }
  },
  "additionalProperties": false
}

Example:

{
  "id": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "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": 1,
    "quantity_electronic": 1,
    "po_line_estimated_price": 49.98,
    "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"
    }
  ],
  "location": {
    "id": "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
    "location_id": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6",
    "quantity": 2,
    "quantity_electronic": 1,
    "quantity_physical": 1,
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "order_format": "Physical Resource",
  "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
  "payment_status": "Awaiting Payment",
  "physical": {
    "volumes": 1,
    "id": "5ee243f9-72e5-4464-bdbc-43a21873d648",
    "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
    "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",
  "po_line_workflow_status": "Open",
  "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",
  "renewal": {
    "interval": 182,
    "id": "8e414baa-8cf2-4916-a90f-d1da4009e06e",
    "cycle": "6 Months",
    "manual_renewal": true,
    "review_period": 30,
    "renewal_date": "2019-04-09T00:00:00.000Z",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "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"
  }
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created line item

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}$"
    },
    "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"
      }
    },
    "location": {
      "description": "location details of this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/location.json"
    },
    "order_format": {
      "description": "The purchase order line format",
      "type": "string",
      "enum": [
        "Container",
        "Electronic Resource",
        "P/E Mix",
        "Physical Resource",
        "Service"
      ]
    },
    "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}$"
    },
    "po_line_workflow_status": {
      "description": "The status of this purchase order line",
      "type": "string",
      "enum": [
        "Closed",
        "Open",
        "Pending"
      ]
    },
    "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"
      ]
    },
    "renewal": {
      "description": "renewal information assoicated with this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/renewal.json"
    },
    "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"
    }
  },
  "additionalProperties": false
}

Example:

{
  "id": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "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": 1,
    "quantity_electronic": 1,
    "po_line_estimated_price": 49.98,
    "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"
    }
  ],
  "location": {
    "id": "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
    "location_id": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6",
    "quantity": 2,
    "quantity_electronic": 1,
    "quantity_physical": 1,
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "order_format": "Physical Resource",
  "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
  "payment_status": "Awaiting Payment",
  "physical": {
    "volumes": 1,
    "id": "5ee243f9-72e5-4464-bdbc-43a21873d648",
    "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
    "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",
  "po_line_workflow_status": "Open",
  "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",
  "renewal": {
    "interval": 182,
    "id": "8e414baa-8cf2-4916-a90f-d1da4009e06e",
    "cycle": "6 Months",
    "manual_renewal": true,
    "review_period": 30,
    "renewal_date": "2019-04-09T00:00:00.000Z",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "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"
  }
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

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

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create line -- 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: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /orders/{id}/lines/{lineId}

Return a purchase order line

GET /orders/{id}/lines/{lineId}
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

  • lineId: 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}$"
    },
    "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"
      }
    },
    "location": {
      "description": "location details of this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/location.json"
    },
    "order_format": {
      "description": "The purchase order line format",
      "type": "string",
      "enum": [
        "Container",
        "Electronic Resource",
        "P/E Mix",
        "Physical Resource",
        "Service"
      ]
    },
    "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}$"
    },
    "po_line_workflow_status": {
      "description": "The status of this purchase order line",
      "type": "string",
      "enum": [
        "Closed",
        "Open",
        "Pending"
      ]
    },
    "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"
      ]
    },
    "renewal": {
      "description": "renewal information assoicated with this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/renewal.json"
    },
    "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"
    }
  },
  "additionalProperties": false
}

Example:

{
  "id": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "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": 1,
    "quantity_electronic": 1,
    "po_line_estimated_price": 49.98,
    "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"
    }
  ],
  "location": {
    "id": "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
    "location_id": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6",
    "quantity": 2,
    "quantity_electronic": 1,
    "quantity_physical": 1,
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "order_format": "Physical Resource",
  "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
  "payment_status": "Awaiting Payment",
  "physical": {
    "volumes": 1,
    "id": "5ee243f9-72e5-4464-bdbc-43a21873d648",
    "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
    "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",
  "po_line_workflow_status": "Open",
  "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",
  "renewal": {
    "interval": 182,
    "id": "8e414baa-8cf2-4916-a90f-d1da4009e06e",
    "cycle": "6 Months",
    "manual_renewal": true,
    "review_period": 30,
    "renewal_date": "2019-04-09T00:00:00.000Z",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "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"
  }
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"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: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /orders/{id}/lines/{lineId}

Delete line item with given {lineId}

DELETE /orders/{id}/lines/{lineId}
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

  • lineId: 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: text/plain

Type: any

Example:

"unable to delete line -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"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: text/plain

Type: any

Example:

Internal server error, contact administrator

PUT /orders/{id}/lines/{lineId}

Update line item with given {lineId}

PUT /orders/{id}/lines/{lineId}
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

  • lineId: 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}$"
    },
    "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"
      }
    },
    "location": {
      "description": "location details of this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/location.json"
    },
    "order_format": {
      "description": "The purchase order line format",
      "type": "string",
      "enum": [
        "Container",
        "Electronic Resource",
        "P/E Mix",
        "Physical Resource",
        "Service"
      ]
    },
    "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}$"
    },
    "po_line_workflow_status": {
      "description": "The status of this purchase order line",
      "type": "string",
      "enum": [
        "Closed",
        "Open",
        "Pending"
      ]
    },
    "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"
      ]
    },
    "renewal": {
      "description": "renewal information assoicated with this purchase order line",
      "type": "object",
      "$ref": "mod-orders-storage/schemas/renewal.json"
    },
    "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"
    }
  },
  "additionalProperties": false
}

Example:

{
  "id": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "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": 1,
    "quantity_electronic": 1,
    "po_line_estimated_price": 49.98,
    "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"
    }
  ],
  "location": {
    "id": "a4e65e03-99a4-4b39-8e6a-ae666ac52bea",
    "location_id": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6",
    "quantity": 2,
    "quantity_electronic": 1,
    "quantity_physical": 1,
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "order_format": "Physical Resource",
  "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
  "payment_status": "Awaiting Payment",
  "physical": {
    "volumes": 1,
    "id": "5ee243f9-72e5-4464-bdbc-43a21873d648",
    "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
    "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",
  "po_line_workflow_status": "Open",
  "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",
  "renewal": {
    "interval": 182,
    "id": "8e414baa-8cf2-4916-a90f-d1da4009e06e",
    "cycle": "6 Months",
    "manual_renewal": true,
    "review_period": 30,
    "renewal_date": "2019-04-09T00:00:00.000Z",
    "po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
  },
  "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"
  }
}

Response 204

Item successfully updated

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to update line -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"line not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator