Skip to content

Delayed Shipments

Returns analytics data for delayed shipments. Currently supports histogram-format output for delay distribution analysis.


Request

GET /api/delayed-shipments/{details}

Required privilege: Procurement / View

Path Parameters

Parameter Type Required Description
details string Yes Output format. Currently supported: histogram

Query Parameters (for histogram)

Parameter Type Required Description
bucket string Yes Histogram bucket identifier defining the grouping/time range

Histogram Endpoint

GET /api/delayed-shipments/histogram?bucket={bucket}

Returns delay distribution data grouped by the specified bucket definition, suitable for charting delay frequency across purchase order lines.

Example Request

GET /api/delayed-shipments/histogram?bucket=week HTTP/1.1
Host: acme.knosc.com
Cookie: access_token_cookie=<token>

Example Response

{
  "data": {
    "buckets": [
      { "label": "0–7 days", "count": 42 },
      { "label": "8–14 days", "count": 18 },
      { "label": "15–30 days", "count": 7 },
      { "label": "30+ days", "count": 3 }
    ],
    "total_delayed": 70,
    "bucket": "week"
  }
}

Code Examples

curl

curl -b cookies.txt "https://acme.knosc.com/api/delayed-shipments/histogram?bucket=week"

Python

response = session.get(
    "https://acme.knosc.com/api/delayed-shipments/histogram",
    params={"bucket": "week"}
)
data = response.json()["data"]
print(f"Total delayed shipments: {data['total_delayed']}")
for bucket in data["buckets"]:
    print(f"  {bucket['label']}: {bucket['count']}")