API Reference
Purchase Orders
/api/v1/console/purchase-orders JWT API KeyList purchase orders, newest first
- Capability
create_purchase_order- API key scope
cap:create_purchase_order(the key's owner must also hold the capability)
Query parameters
| Status string | One of the seven lifecycle states. Optional. |
| SupplierId string (uuid) | — |
| IncludeDeleted boolean | Include tombstoned orders (FR-PUR-109). Capability-gated in the service. |
| Page integer (int32) | — |
| PerPage integer (int32) | — |
| Search string | Free-text filter. Its meaning is per-resource and documented on the endpoint. |
| Skip integer (int32) | Rows to skip, derived — never sent by the caller on this surface. |
| 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" \
-H "X-Api-Key: <YOUR_API_KEY>"Query parameters
Headers
/api/v1/console/purchase-orders JWT API KeyCreate a draft order
- 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,
"unitCost": 0
}
]
}| supplierId string (uuid) | — |
| expectedDeliveryDate string (date) | A business date, therefore System.DateOnly — a delivery is expected on a Baghdad calendar day, not at an instant. |
| notes string | — |
| lines PurchaseOrderLineRequest[] | — |
Responses
curl -X POST "https://staging-api.panoptesos.com/api/v1/console/purchase-orders" \
-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,
"unitCost": 0
}
]
}'Request body (JSON)
Headers
/api/v1/console/purchase-orders/{id} JWT API KeyOne order with its contracted lines
The lines take `?sort=&dir=` (`PurchaseOrderLineSort`); the parameter is not named `sort` so the binder does not read that key as its prefix.
- Capability
create_purchase_order- API key scope
cap:create_purchase_order(the key's owner must also hold the capability)
Path parameters
| idrequired string (uuid) | — |
Query parameters
| 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/{id}" \
-H "X-Api-Key: <YOUR_API_KEY>"Path parameters
Query parameters
Headers
/api/v1/console/purchase-orders/{id} JWT API KeyReplace a draft's contents
— draft only, `CONFLICT` otherwise.
- Capability
create_purchase_order- API key scope
cap:create_purchase_order(the key's owner must also hold the capability)
Path parameters
| idrequired string (uuid) | — |
Request body
{
"supplierId": "00000000-0000-0000-0000-000000000000",
"expectedDeliveryDate": "2026-11-27",
"notes": "string",
"lines": [
{
"inventoryItemId": "00000000-0000-0000-0000-000000000000",
"quantity": 0,
"unitCost": 0
}
]
}| supplierId string (uuid) | — |
| expectedDeliveryDate string (date) | — |
| notes string | — |
| lines PurchaseOrderLineRequest[] | — |
Responses
curl -X PUT "https://staging-api.panoptesos.com/api/v1/console/purchase-orders/{id}" \
-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,
"unitCost": 0
}
]
}'Path parameters
Request body (JSON)
Headers
/api/v1/console/purchase-orders/{id} JWT API KeyRetire a draft or cancelled order
- Capability
create_purchase_order- API key scope
cap:create_purchase_order(the key's owner must also hold the capability)
Path parameters
| idrequired string (uuid) | — |
Request body
{
"reason": "string"
}| reason string | — |
Responses
curl -X DELETE "https://staging-api.panoptesos.com/api/v1/console/purchase-orders/{id}" \
-H "X-Api-Key: <YOUR_API_KEY>"Path parameters
Headers
/api/v1/console/purchase-orders/{id}/cancel JWT API KeyCancel
— refused once anything has arrived; close it instead.
- Capability
create_purchase_order- API key scope
cap:create_purchase_order(the key's owner must also hold the capability)
Path parameters
| idrequired string (uuid) | — |
Request body
{
"reason": "string"
}| reason string | — |
Responses
curl -X POST "https://staging-api.panoptesos.com/api/v1/console/purchase-orders/{id}/cancel" \
-H "Content-Type: application/json" \
-H "X-Api-Key: <YOUR_API_KEY>" \
-d '{
"reason": "string"
}'Path parameters
Request body (JSON)
Headers
/api/v1/console/purchase-orders/{id}/close JWT API KeyClose, booking the outstanding quantity as a priced shortage
A dated financial write: a locked business day returns `PERIOD_LOCKED`.
- Capability
create_purchase_order- API key scope
cap:create_purchase_order(the key's owner must also hold the capability)
Path parameters
| idrequired string (uuid) | — |
Request body
{
"reason": "string"
}| reason string | — |
Responses
curl -X POST "https://staging-api.panoptesos.com/api/v1/console/purchase-orders/{id}/close" \
-H "Content-Type: application/json" \
-H "X-Api-Key: <YOUR_API_KEY>" \
-d '{
"reason": "string"
}'Path parameters
Request body (JSON)
Headers
/api/v1/console/purchase-orders/{id}/submit JWT API KeySubmit for ordering.,
At or below T1 the order goes straight to `ordered`; above it, to `pending_approval` with an approval request filed in the same transaction. The caller learns which from the returned status, not from a separate lookup.
- Capability
create_purchase_order- API key scope
cap:create_purchase_order(the key's owner must also hold the capability)
Path parameters
| idrequired string (uuid) | — |
Responses
curl -X POST "https://staging-api.panoptesos.com/api/v1/console/purchase-orders/{id}/submit" \
-H "X-Api-Key: <YOUR_API_KEY>"Path parameters
Headers