Get Purchase Orders by Item¶
Returns aggregated purchase order data for a specific item, optionally scoped to a single warehouse.
Endpoints¶
By Item¶
Returns all purchase order lines for the specified item, aggregated across all warehouses.
By Item and Warehouse¶
Returns purchase order lines for the specified item scoped to a specific warehouse.
Required privilege (both): Procurement / View
Path Parameters¶
| Parameter | Type | Required | Endpoint | Description |
|---|---|---|---|---|
item_id |
integer | Yes | Both | Internal Item Master identifier |
warehouse_id |
integer | No | Second endpoint only | Internal Warehouse Master identifier |
Example Requests¶
Response¶
{
"data": {
"headers": [
{ "key": "PO List Number", "format": "string-link", "alias": "PO #" },
{ "key": "Supplier Name", "format": "string-link" },
{ "key": "Warehouse Number", "format": "string-link", "alias": "Warehouse #" },
{ "key": "PO Details Document Status", "format": "string", "alias": "Status" },
{ "key": "PO Details Quantity", "format": "number" },
{ "key": "PO Details ETA Date", "format": "date" },
{ "key": "PO Details Ship Date", "format": "date" }
],
"sort": { "key": "PO Details ETA Date", "type": "Descending" },
"rows": [
{
"id": 101,
"PO List Number": "PO-2024-001",
"Supplier Name": "Acme Components Ltd.",
"Warehouse Number": "WH-01",
"Warehouse Name": "Main Distribution Center",
"PO Details Document Status": "Open",
"PO Details Quantity": 200,
"PO Details ETA Date": "2024-03-15",
"PO Details Ship Date": "2024-03-08",
"PO Details Order Date": "2024-03-01"
}
]
},
"tags": {},
"extra": {}
}
Default sort: PO Details ETA Date, Descending
Code Examples¶
curl¶
# All warehouses
curl -b cookies.txt "https://acme.knosc.com/api/purchase-order-item/55"
# Specific warehouse
curl -b cookies.txt "https://acme.knosc.com/api/purchase-order-item/55/3"
Python¶
item_id = 55
warehouse_id = 3
# All warehouses for item
response = session.get(f"https://acme.knosc.com/api/purchase-order-item/{item_id}")
# Scoped to one warehouse
response = session.get(
f"https://acme.knosc.com/api/purchase-order-item/{item_id}/{warehouse_id}"
)
rows = response.json()["data"]["rows"]
for row in rows:
print(f"PO: {row['PO List Number']} | Qty: {row['PO Details Quantity']} | ETA: {row['PO Details ETA Date']}")