POST/api/packing/bakes

K6 — log a bake (Packaging)

Packers bake. The floor works early mornings on a standing plan, but the night team routinely puts things in the oven — a shortfall they can cover, a last-minute addition — and this records it instead of sending them to another department's app.

It is a packaging-owned log, not a production record: a production requires a recipe and the platform has none, so this works on day one and can be reconciled into production later (D-21).

Append-only. No edit and no delete in v1 — a bake log records something that physically happened, so a fat-fingered quantity is corrected with another entry, never a silent rewrite of history.

locationId is optional: shelves may not be labelled yet, and an inventory gap must degrade rather than block (PK-4). The response carries the item's refreshed inventory row, so the on-hand chip updates without a second call.

⚠️ Send bakedAt. The night shift crosses midnight, and the server clock cannot tell which night a packer thinks they are on — the screen can. Which day production belongs to at all is a still-open question; see §4.1 of the Phase 5 plan.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

5 status codes
400Invalid input — the `error` string says what was wrong.
errorstringrequired
401Not authenticated. Sign in first (see the Auth tag).
errorstringrequired
403Authenticated, but not allowed — this endpoint requires a department membership or a role you do not have.
errorstringrequired
404Not found.
errorstringrequired
500Unexpected server error.
errorstringrequired

Error handling

A 400 is returned: Invalid input — the error string says what was wrong. A 401 is returned: Not authenticated. Sign in first (see the Auth tag). A 403 is returned: Authenticated, but not allowed — this endpoint requires a department membership or a role you do not have. A 404 is returned: Not found. A 500 is returned: Unexpected server error.