API Reference
Reorder
/api/v1/console/purchase-orders/from-suggestions JWT API KeyRaise one DRAFT purchase order from a supplier group's selected suggestions
201, because a purchase order really is created. It lands in `draft` with no unit costs, so each line takes the item's live moving-average cost for the operator to review before submitting — a suggestion is a claim about quantity, not about price.
- Capability
create_purchase_order- API key scope
cap:create_purchase_order(the key's owner must also hold the capability)
Request body
{
"supplierId": "00000000-0000-0000-0000-000000000000",
"expectedDeliveryDate": "2026-11-27",
"notes": "string",
"lines": [
{
"inventoryItemId": "00000000-0000-0000-0000-000000000000",
"quantity": 0
}
]
}| supplierId string (uuid) | The supplier group being drafted. The <i>unassigned</i> group has no supplier and is deliberately not draftable (FR-PUR-064) — there is nobody to send the order to. |
| expectedDeliveryDate string (date) | A business date — a delivery is expected on a Baghdad calendar day. |
| notes string | — |
| lines DraftPoSuggestionLineRequest[] | — |
Responses
curl -X POST "https://staging-api.panoptesos.com/api/v1/console/purchase-orders/from-suggestions" \
-H "Content-Type: application/json" \
-H "X-Api-Key: <YOUR_API_KEY>" \
-d '{
"supplierId": "00000000-0000-0000-0000-000000000000",
"expectedDeliveryDate": "2026-11-27",
"notes": "string",
"lines": [
{
"inventoryItemId": "00000000-0000-0000-0000-000000000000",
"quantity": 0
}
]
}'Request body (JSON)
Headers
/api/v1/console/purchase-orders/reorder-suggestions JWT API KeyConsumption-aware reorder suggestions grouped by supplier
Three things in the response are there specifically so a reader is not misled by an apparently confident number:
• `velocitySource` — whether the daily rate came from enough trailing days to mean something, or from too few, in which case the velocity leg was dropped and the size came from par headroom alone.
• `unsized` — items below their reorder point that could not be sized at all, reported with the reason and with no quantity, rather than given an invented one.
• `dormantReason` — set when the branch has no item with a reorder point, so an empty screen cannot be misread as an all-clear ( item 11).
- Capability
create_purchase_order- API key scope
cap:create_purchase_order(the key's owner must also hold the capability)
Query parameters
| WindowDays integer (int32) | Trailing days of consumption to average over. Default 14 (B15), clamped 1 … 90. |
| CoverDays integer (int32) | Days of stock the order should cover after the supplier's lead time — the planning horizon the purchaser picks (comeback r4). Default 3 (B15 `REORDER_COVER_DAYS`), clamped 1 … 42, the forecast horizon: a month's order is sized from the forecast's month, Ramadan and Eid included. |
| Sort string | A snake_case column key from the endpoint's allow-list (`created_at`, `gross_total`, `status` …). Absent or blank → the endpoint's default order. |
| Dir string | `asc` (the default when Panoptes.Application.Common.SortableRequest.Sort is present) or `desc`. Ignored without a sort. |
Responses
curl -X GET "https://staging-api.panoptesos.com/api/v1/console/purchase-orders/reorder-suggestions" \
-H "X-Api-Key: <YOUR_API_KEY>"Query parameters
Headers