Skip to main content
Version: v1.0.0(int)

E134: Add item to work order

POST /api/work-orders/:id/items

Appends an output-SKU line to an existing WO and snapshots its BOM into work_order_inputs (scaled by quantity) — the same per-item logic create runs. The new line's ledger events are projected immediately against the WO's current status (adding to an Entered WO books FG ORDER + input DEMAND; Draft books nothing). Each SKU may appear at most once per WO.

Authentication

Standard tenant route. Requires Authorization: Bearer <firebase-id-token> and X-Org-Id: <org-id>. Access: Member.

Request

{ "skuId": "uuid", "quantity": 6, "conversionCost": 1.50 }

conversionCost is optional.

Response — 201 Created

{ "item": WorkOrderItem, "inputs": [ WorkOrderInput ] }

inputs is the freshly snapshotted recipe (empty for a BOM-less SKU).

Errors

HTTPcodeCondition
404not_foundWO or SKU not found.
409conflictA receipt exists against the WO (items are locked), or the SKU is already on this WO.
422validation_failedShape invalid.

Workflow

Calls W134 Add item to work order.