API Reference
Production Batches
/api/v1/console/production/batches JWT API KeyList the branch's batches
No capability gate: anyone who works the production board must be able to see what is cooking. The scope is the control, and it is applied in the service.
- API key scope
- Any key holding a cap: scope (a read every signed-in role can make).
Query parameters
| Status string | One of the `BATCH_STATUS` vocabulary. Optional. |
| From string (date) | Inclusive lower bound on the batch's <b>business date</b>, never on an instant. |
| To string (date) | Inclusive upper bound on the batch's business date. |
| IncludeDeleted boolean | Include tombstoned batches (FR-PRD-110). Gated on `edit_batch` 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/production/batches" \
-H "X-Api-Key: <YOUR_API_KEY>"Query parameters
Headers
/api/v1/console/production/batches JWT API KeyCreate the day's batch
One call consumes the kitchen, mints the code, builds the pools, re-prices every batch portion, writes the audit row and rebuilds the day's capacity slice — in one transaction.
- Capability
create_batch- API key scope
cap:create_batch(the key's owner must also hold the capability)
Request body
{
"businessDate": "2026-11-27",
"chickenItemId": "00000000-0000-0000-0000-000000000000",
"chickenCount": 0,
"meatItemId": "00000000-0000-0000-0000-000000000000",
"meatKg": 0,
"riceItemId": "00000000-0000-0000-0000-000000000000",
"rawRiceKg": 0,
"cookedRiceMultiplier": 0,
"reservedRiceDirectSaleKg": 0,
"riceRoundingMethod": "string",
"extras": [
{
"inventoryItemId": "00000000-0000-0000-0000-000000000000",
"quantity": 0,
"unit": "string"
}
],
"notes": "string"
}| businessDate string (date) | The Baghdad business day the batch belongs to (INV-024). Defaults to today. It is passed through the period guard, so a back-dated batch into a locked day is `PERIOD_LOCKED`, never silently redated. |
| chickenItemId string (uuid) | The kitchen item drawn for whole chickens. Null when the batch cooks no chicken. |
| chickenCount integer (int32) | Whole birds. One bird yields four quarters — the base unit (FR-PRD-014). |
| meatItemId string (uuid) | — |
| meatKg number (double) | Kilograms. 250 g is one base unit (FR-PRD-015). |
| riceItemId string (uuid) | — |
| rawRiceKg number (double) | Kilograms of rice weighed <b>before</b> cooking. |
| cookedRiceMultiplier number (double) | Raw → cooked yield factor (FR-PRD-016). Below 0.1 is refused, not clamped. |
| reservedRiceDirectSaleKg number (double) | Cooked kilograms held back for plain-rice sales (FR-PRD-017). |
| riceRoundingMethod string | `exact` | `nearest_5` | `nearest_10` | `nearest_50` (FR-PRD-019). |
| extras CreateBatchExtraRequest[] | The flexible extras — salt, oil, spices. Each must carry `InventoryItem.eligibleForProduction` (FR-PRD-004/005: eligibility is a <b>per-item flag</b>, not a category rule). Their cost is spread <i>equally</i> across every base unit, because an extra attaches to no particular portion (R4). |
| notes string | — |
Responses
curl -X POST "https://staging-api.panoptesos.com/api/v1/console/production/batches" \
-H "Content-Type: application/json" \
-H "X-Api-Key: <YOUR_API_KEY>" \
-d '{
"businessDate": "2026-11-27",
"chickenItemId": "00000000-0000-0000-0000-000000000000",
"chickenCount": 0,
"meatItemId": "00000000-0000-0000-0000-000000000000",
"meatKg": 0,
"riceItemId": "00000000-0000-0000-0000-000000000000",
"rawRiceKg": 0,
"cookedRiceMultiplier": 0,
"reservedRiceDirectSaleKg": 0,
"riceRoundingMethod": "string",
"extras": [
{
"inventoryItemId": "00000000-0000-0000-0000-000000000000",
"quantity": 0,
"unit": "string"
}
],
"notes": "string"
}'Request body (JSON)
Headers
/api/v1/console/production/batches/{id} JWT API KeyOne batch with its pools, plan lines and stocked outputs
`?sort=&dir=` orders the plan lines, `?output_sort=&output_dir=` the stocked outputs (`ProductionBatchSort`).
The output pair is also named on the action. The snake_case fallback (`SnakeCaseQueryValueProvider`) now survives a `[FromQuery]` model's binding-source filter, so `output_sort` reaches `OutputSort` through the model as well and the named parameters are no longer load-bearing; the named value wins when both spellings arrive.
- API key scope
- Any key holding a cap: scope (a read every signed-in role can make).
Path parameters
| idrequired string (uuid) | — |
Query parameters
| OutputSort string | A key of the stocked-output list. Absent → the default order. |
| OutputDir string | `asc` (the default) or `desc`; ignored without Panoptes.Application.DTOs.Requests.Production.GetProductionBatchRequest.OutputSort. |
| 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. |
| output_sort string | — |
| output_dir string | — |
Responses
curl -X GET "https://staging-api.panoptesos.com/api/v1/console/production/batches/{id}" \
-H "X-Api-Key: <YOUR_API_KEY>"Path parameters
Query parameters
Headers
/api/v1/console/production/batches/{id} JWT API KeyEdit the rice model of an unconsumed batch
- Capability
edit_batch- API key scope
cap:edit_batch(the key's owner must also hold the capability)
Path parameters
| idrequired string (uuid) | — |
Request body
{
"cookedRiceMultiplier": 0,
"reservedRiceDirectSaleKg": 0,
"riceRoundingMethod": "string"
}| cookedRiceMultiplier number (double) | — |
| reservedRiceDirectSaleKg number (double) | — |
| riceRoundingMethod string | — |
Responses
curl -X PUT "https://staging-api.panoptesos.com/api/v1/console/production/batches/{id}" \
-H "Content-Type: application/json" \
-H "X-Api-Key: <YOUR_API_KEY>" \
-d '{
"cookedRiceMultiplier": 0,
"reservedRiceDirectSaleKg": 0,
"riceRoundingMethod": "string"
}'Path parameters
Request body (JSON)
Headers
/api/v1/console/production/batches/{id} JWT API KeyRetire a batch
A tombstone, never a `DELETE`, and the reason is mandatory. A batch that has sold or wasted a unit cannot be retired at all — closing is the action for that.
- Capability
edit_batch- API key scope
cap:edit_batch(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/production/batches/{id}" \
-H "X-Api-Key: <YOUR_API_KEY>"Path parameters
Headers
/api/v1/console/production/batches/{id}/close JWT API KeyClose a batch and let the day's capacity slice finalise
- Capability
close_batch- API key scope
cap:close_batch(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/production/batches/{id}/close" \
-H "X-Api-Key: <YOUR_API_KEY>"Path parameters
Headers
/api/v1/console/production/batches/{id}/overflow JWT API KeyAllow or forbid plain-rice sales spilling into the meal bucket
Owner-only. It is an override of a stock guarantee, which is why it carries the override capability rather than `edit_batch`.
- Capability
override_stock_warning- API key scope
cap:override_stock_warning(the key's owner must also hold the capability)
Path parameters
| idrequired string (uuid) | — |
Request body
{
"allowDirectRiceOverflow": false
}| allowDirectRiceOverflow boolean | — |
Responses
curl -X PUT "https://staging-api.panoptesos.com/api/v1/console/production/batches/{id}/overflow" \
-H "Content-Type: application/json" \
-H "X-Api-Key: <YOUR_API_KEY>" \
-d '{
"allowDirectRiceOverflow": false
}'Path parameters
Request body (JSON)
Headers
/api/v1/console/production/batches/{id}/status JWT API KeyMove a batch through the manual part of its status vocabulary
- Capability
create_batch- API key scope
cap:create_batch(the key's owner must also hold the capability)
Path parameters
| idrequired string (uuid) | — |
Request body
{
"status": "string"
}| status string | — |
Responses
curl -X PUT "https://staging-api.panoptesos.com/api/v1/console/production/batches/{id}/status" \
-H "Content-Type: application/json" \
-H "X-Api-Key: <YOUR_API_KEY>" \
-d '{
"status": "string"
}'Path parameters
Request body (JSON)
Headers