API Reference
Batch Templates
3 endpoints· Auth: JWT or API Key
get
/api/v1/console/production/batch-templates JWT API KeyThe branch's templates with their output and input nodes.,
- Capability
edit_batch- API key scope
cap:edit_batch(the key's owner must also hold the capability)
Query parameters
| Active boolean | Restrict to templates the picker would offer (`active = true`). Null returns both. <br>`active` and `deletedAt` are <b>two different things</b> (FR-PRD-073): `active = false` withdraws a template from the picker while it stays a live, editable row; a tombstone removes it from history's reach. v1 overloaded the flag to mean both, so "withdraw this for the season" and "this was a mistake" were the same button. |
| 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/production/batch-templates" \
-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/production/batch-templates JWT API KeyAuthor a template.,
One of the two names suffices; each falls back to the other. At least one output, every output a branch-scoped item that is not `packaging`, every weight greater than zero.
- Capability
edit_batch- API key scope
cap:edit_batch(the key's owner must also hold the capability)
Request body
application/json
{
"nameAr": "string",
"nameEn": "string",
"labourCostIqd": 0,
"notes": "string",
"outputs": [
{
"inventoryItemId": "00000000-0000-0000-0000-000000000000",
"code": "string",
"allocationWeight": 0,
"yieldPerDriverUnit": 0,
"shelfLifeHours": 0,
"sortOrder": 0
}
],
"inputs": [
{
"role": "string",
"inventoryItemId": "00000000-0000-0000-0000-000000000000",
"defaultQty": 0
}
]
}| nameAr string | — |
| nameEn string | — |
| labourCostIqd integer (int64) | A flat per-run labour adder in base-currency minor units, <b>outside</b> unit COGS (FR-PRD-072). It is recorded and never spent: the module's first invariant is that every dinar of a batch is inventory-backed, and no labour or overhead enters any unit cost today (SRS §5.6.11 limitation 2). |
| notes string | — |
| outputs CreateBatchTemplateOutputRequest[] | At least one output. A template that yields nothing has nothing to allocate to. |
| inputs CreateBatchTemplateInputRequest[] | The input side — optional. The reference shipped these tables with no writer at all (SRS §5.6.11), so a template could name what it produced and never what it consumed. |
Responses
200Success
cURL
curl -X POST "https://staging-api.panoptesos.com/api/v1/console/production/batch-templates" \
-H "Content-Type: application/json" \
-H "X-Api-Key: <YOUR_API_KEY>" \
-d '{
"nameAr": "string",
"nameEn": "string",
"labourCostIqd": 0,
"notes": "string",
"outputs": [
{
"inventoryItemId": "00000000-0000-0000-0000-000000000000",
"code": "string",
"allocationWeight": 0,
"yieldPerDriverUnit": 0,
"shelfLifeHours": 0,
"sortOrder": 0
}
],
"inputs": [
{
"role": "string",
"inventoryItemId": "00000000-0000-0000-0000-000000000000",
"defaultQty": 0
}
]
}' Try itagainst staging · https://staging-api.panoptesos.com
Request body (JSON)
Headers
Set credentials in the “Authorize” menu
delete
/api/v1/console/production/batch-templates/{id} JWT API KeyRetire a template.,
A tombstone with a mandatory reason, carried down to the template's outputs and inputs so retiring the parent orphans nothing. Never a hard delete: the unique indexes on these tables are partial on `deleted_at IS NULL`, so the row can go without the history going.
- 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
application/json
{
"reason": "string"
}| reason string | — |
Responses
200Success
cURL
curl -X DELETE "https://staging-api.panoptesos.com/api/v1/console/production/batch-templates/{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