API Reference

Purchase Orders

8 endpoints· Auth: JWT or API Key
get/api/v1/console/purchase-orders JWT API Key

List 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

200Success
cURL
curl -X GET "https://staging-api.panoptesos.com/api/v1/console/purchase-orders" \
  -H "X-Api-Key: <YOUR_API_KEY>"
Try itagainst staging · https://staging-api.panoptesos.com

Query parameters

Headers

Set credentials in the “Authorize” menu
post/api/v1/console/purchase-orders JWT API Key

Create 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

application/json
{
  "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

200Success
cURL
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
    }
  ]
}'
Try itagainst staging · https://staging-api.panoptesos.com

Request body (JSON)

Headers

Set credentials in the “Authorize” menu
get/api/v1/console/purchase-orders/{id} JWT API Key

One 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

200Success
cURL
curl -X GET "https://staging-api.panoptesos.com/api/v1/console/purchase-orders/{id}" \
  -H "X-Api-Key: <YOUR_API_KEY>"
Try itagainst staging · https://staging-api.panoptesos.com

Path parameters

Query parameters

Headers

Set credentials in the “Authorize” menu
put/api/v1/console/purchase-orders/{id} JWT API Key

Replace 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

application/json
{
  "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

200Success
cURL
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
    }
  ]
}'
Try itagainst staging · https://staging-api.panoptesos.com

Path parameters

Request body (JSON)

Headers

Set credentials in the “Authorize” menu
delete/api/v1/console/purchase-orders/{id} JWT API Key

Retire 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

application/json
{
  "reason": "string"
}
reason
string
—

Responses

200Success
cURL
curl -X DELETE "https://staging-api.panoptesos.com/api/v1/console/purchase-orders/{id}" \
  -H "X-Api-Key: <YOUR_API_KEY>"
Try itagainst staging · https://staging-api.panoptesos.com

Path parameters

Headers

Set credentials in the “Authorize” menu
post/api/v1/console/purchase-orders/{id}/cancel JWT API Key

Cancel

— 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

application/json
{
  "reason": "string"
}
reason
string
—

Responses

200Success
cURL
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"
}'
Try itagainst staging · https://staging-api.panoptesos.com

Path parameters

Request body (JSON)

Headers

Set credentials in the “Authorize” menu
post/api/v1/console/purchase-orders/{id}/close JWT API Key

Close, 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

application/json
{
  "reason": "string"
}
reason
string
—

Responses

200Success
cURL
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"
}'
Try itagainst staging · https://staging-api.panoptesos.com

Path parameters

Request body (JSON)

Headers

Set credentials in the “Authorize” menu
post/api/v1/console/purchase-orders/{id}/submit JWT API Key

Submit 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

200Success
cURL
curl -X POST "https://staging-api.panoptesos.com/api/v1/console/purchase-orders/{id}/submit" \
  -H "X-Api-Key: <YOUR_API_KEY>"
Try itagainst staging · https://staging-api.panoptesos.com

Path parameters

Headers

Set credentials in the “Authorize” menu