Skip to content

List Purchase Orders

Retrieves a paginated, filterable list of all purchase order headers.


Request

GET /api/purchase-order

Required privilege: Procurement / View

Query Parameters

Parameter Type Description
filter string Filter expression (see Filtering & Sorting)
sort string Sort column and direction
page integer Page number (1-based)
page_size integer Number of rows per page

Example Request

GET /api/purchase-order?page=1&page_size=50 HTTP/1.1
Host: acme.knosc.com
Cookie: access_token_cookie=<token>

Response

200 OK
Content-Type: application/json

Response Body

{
  "data": {
    "headers": [
      {
        "key": "PO List Number",
        "format": "string-link",
        "alias": "PO #",
        "filters": [{ "category": "PO List Number", "alias": "PO #" }]
      },
      {
        "key": "Supplier Name",
        "format": "string-link"
      },
      {
        "key": "PO List Document Status",
        "format": "string",
        "alias": "Status"
      },
      {
        "key": "PO List Order Date",
        "format": "date"
      },
      {
        "key": "PO Total Items",
        "format": "number"
      },
      {
        "key": "PO List Quantity",
        "format": "number"
      }
    ],
    "sort": {
      "key": "PO List Order Date",
      "type": "Ascending"
    },
    "rows": [
      {
        "id": 42,
        "PO List Number": "PO-2024-001",
        "PO List Order Date": "2024-03-01",
        "Supplier Id": 7,
        "Supplier Name": "Acme Components Ltd.",
        "Supplier Number": "SUP-007",
        "PO Total Items": 3,
        "PO List Quantity": 500,
        "PO List Document Status": "Open",
        "PO List Servicenow Id": null
      },
      {
        "id": 43,
        "PO List Number": "PO-2024-002",
        "PO List Order Date": "2024-03-05",
        "Supplier Id": 12,
        "Supplier Name": "Global Parts Inc.",
        "Supplier Number": "SUP-012",
        "PO Total Items": 1,
        "PO List Quantity": 200,
        "PO List Document Status": "Shipped",
        "PO List Servicenow Id": "SN-4892"
      }
    ]
  },
  "tags": {},
  "extra": {}
}

Response Fields

Top-level

Field Type Description
data object Container for the response payload
data.headers array Column definitions for rendering the list
data.sort object Active sort configuration
data.rows array Purchase order records
tags object Additional metadata tags
extra object Additional contextual data

headers Items

Field Type Description
key string Field key matching row data keys
format string Display format hint (string, string-link, date, number, currency)
alias string Display label (falls back to key if absent)
filters array Available filter categories for this column

rows Items

Field Type Description
id integer Internal PO identifier - use in GET /api/purchase-order/{id}
PO List Number string Human-readable PO document number
PO List Order Date string | null Earliest order date across all line items (ISO 8601 date)
Supplier Id integer Internal supplier identifier
Supplier Name string Supplier display name
Supplier Number string Supplier reference code
PO Total Items integer Count of distinct line items on this PO
PO List Quantity number Sum of quantities across all line items
PO List Document Status string PO status (Open, Shipped, Received, etc.)
PO List Servicenow Id string | null ServiceNow external reference ID

Default Behaviour

  • Default sort: PO List Order Date, Ascending
  • Inactive warehouses are excluded by default
  • Suggested status POs are excluded from default results unless explicitly filtered

Code Examples

curl

curl -b cookies.txt "https://acme.knosc.com/api/purchase-order"

Python

import requests

session = requests.Session()
# ... authenticate first (see Quick Start)

response = session.get("https://acme.knosc.com/api/purchase-order")
data = response.json()

for po in data["data"]["rows"]:
    print(f"{po['PO List Number']} - {po['Supplier Name']} - {po['PO List Document Status']}")

JavaScript (fetch)

const response = await fetch('/api/purchase-order', {
  credentials: 'include'
});
const { data } = await response.json();

data.rows.forEach(po => {
  console.log(`${po['PO List Number']}: ${po['PO List Document Status']}`);
});