mod-orders-storage (v1)

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

Table of contents

mod-orders

Get list of purchase orders API

/orders

Entity representing a order

GET /orders

Get list of purchase orders

GET /orders
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 records",
  "type": "object",
  "properties": {
    "purchase_orders": {
      "description": "collection of purchase order records",
      "type": "array",
      "id": "purchase_orders",
      "items": {
        "type": "object",
        "$ref": "purchase_order.json"
      }
    },
    "total_records": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    },
    "first": {
      "description": "The index of the first object contained in this collection",
      "type": "integer"
    },
    "last": {
      "description": "The index of the last object contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "purchase_orders",
    "total_records"
  ]
}

Example:

{
  "purchase_orders": [
    {
      "id": "0804ddec-6545-404a-b54d-a693f505681d",
      "adjustment": "9b3be694-6716-4e14-b81d-8d76f0ae4146",
      "approved": true,
      "assigned_to": "ab18897b-0e40-4f31-896b-9c9adc979a88",
      "created": "2010-10-08T03:53:00.000Z",
      "created_by": "ab18897b-0e40-4f31-896b-9c9adc979a88",
      "manual_po": false,
      "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"
    }
  ],
  "total_records": 1,
  "first": 1,
  "last": 1
}

Response 400

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

Body

Media type: text/plain

Type: any

Example:

"unable to list orders -- 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 orders -- unauthorized"

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