mod-orders-storage (v1)

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

Table of contents

Order-lines

API to get list of po lines by quering a view combining purchase_orders,po_lines. This API is intended for internal use only. Please use the /orders/order-lines API provided by mod-orders instead.

/orders-storage/order-lines

Entity representing a order-line

GET /orders-storage/order-lines

Get list of po lines matching a query that can contain fields from purchase_order or/and po_line

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

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

    with valid searchable fields: for example code

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    ["code", "MEDGRANT", "="]
    
  • offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)

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

    Example:

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

    Limit the number of elements returned in the response

    Example:

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

    Requested language. Optional. [lang=en]

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

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

Example:

{
    "poLines": [
      {
        "id": "c0d08448-347b-418a-8c2f-5fb50248d67e",
        "edition": "First edition",
        "checkinItems": false,
        "instanceId": "8343e5a0-fed8-11e8-8eb2-f2801f1b9fd1",
        "agreementId": "bdc75fea-fed8-11e8-8eb2-f2801f1b9fd1",
        "acquisitionMethod": "Purchase At Vendor System",
        "alerts": [
          "9a665b22-9fe5-4c95-b4ee-837a5433c95d"
        ],
        "cancellationRestriction": false,
        "cancellationRestrictionRote": "ABCDEFGHIJKLMNOPQRSTUVW",
        "claims": [
          {
            "claimed": false,
            "sent": "2018-10-09T00:00:00.000Z",
            "grace": 30
          }
        ],
        "collection": false,
        "contributors": [
          {
            "contributor": "Ed Mashburn",
            "contributorType": "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
          }
        ],
        "cost": {
          "additionalCost": 4.99,
          "currency": "USD",
          "discount": 10,
          "discountType": "percentage",
          "listUnitPriceElectronic": 24.99,
          "quantityElectronic": 2,
          "poLineEstimatedPrice": 49.97
        },
        "description": "ABCDEFGH",
        "details": {
          "receivingNote": "ABCDEFGHIJKL",
          "productIds": [
            {
              "productId": "9780764354113",
              "productIdType": "ISBN"
            }
          ],
          "subscriptionFrom": "2018-10-09T00:00:00.000Z",
          "subscriptionInterval": 824,
          "subscriptionTo": "2020-10-09T00:00:00.000Z"
        },
        "donor": "ABCDEFGHIJKLM",
        "eresource": {
          "accessProvider": "ba3f3d45-247d-41f6-8dc9-6488adcad329",
          "activated": false,
          "activationDue": 10,
          "createInventory": "Instance, Holding",
          "expectedActivation": "2018-10-09T00:00:00.000Z",
          "license": {
            "code": "Code 1",
            "description": "License Agreement 1"
          },
          "materialType": "f7e72403-2a13-43a4-a069-aaabe6c9dea8",
          "trial": false,
          "userLimit": 10
        },
        "fundDistribution": [
          {
            "code": "HIST",
            "percentage": 80.0,
            "encumbrance": "eb506834-6c70-4239-8d1a-6414a5b08ac3"
          }
        ],
        "locations": [
          {
            "locationId": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6",
            "quantity": 1,
            "quantityElectronic": 1
          },
          {
            "locationId": "53cf956f-c1df-410b-8bea-27f712cca7c0",
            "quantity": 1,
            "quantityElectronic": 1
          }
        ],
        "orderFormat": "Electronic Resource",
        "paymentStatus": "Awaiting Payment",
        "poLineDescription": "ABCDEFGHIJKLMNOPQRSTUVWXY",
        "poLineNumber": "268758-03",
        "publicationDate": "2017",
        "publisher": "Schiffer Publishing",
        "purchaseOrderId": "d79b0bcc-DcAD-1E4E-Abb7-DbFcaD5BB3bb",
        "receiptDate": "2018-10-09T00:00:00.000Z",
        "receiptStatus": "Awaiting Receipt",
        "reportingCodes": [
          "5926dcd7-85f5-4504-8283-712595ebc38b",
          "fa316c04-8101-4e72-8aaf-01281bac718f",
          "ea68b696-3125-4940-bf91-1d128323473e"
        ],
        "requester": "Leo Bulero",
        "rush": true,
        "selector": "ABCD",
        "source": {
          "code": "Code1",
          "description": ""
        },
        "tags": [
          "ABCDEFGHIJKLMNOPQRSTU",
          "ABCDEFG",
          "ABCDEFGHIJKLMNOPQRSTU",
          "ABCDEFGHIJKLMNO"
        ],
        "title": "Kayak Fishing in the Northern Gulf Coast",
        "vendorDetail": {
          "instructions": "ABCDEFG",
          "noteFromVendor": "ABCDEFGHIKJKLMNOP",
          "refNumber": "123456-78",
          "refNumberType": "Supplier's unique order line reference number",
          "vendorAccount": "8910-25"
        },
        "metadata": {
          "createdDate": "2018-07-19T00:00:00.000+0000",
          "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
        }
      }
    ],
    "totalRecords": 1
}

Response 400

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

Body

Media type: text/plain

Type: any

Example:

"unable to list order-lines -- malformed parameter 'query', syntax error at column 6"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

"unable to list order-lines -- unauthorized"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

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