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

E137: Create receipt against work order

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

Records production output from a work order. Triggered from Work Order Detail receipts section. The WO equivalent of the PO receipt: consumes inputs from both ledgers using the recipe snapshot and produces finished goods into the FG ledger, all in one transaction.

Authentication

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

Request

{
"receiptDate": "2026-05-25",
"notes": "...",
"items": [ { "skuId": "uuid", "quantity": 100, "unitCost": 5.62 } ]
}

Each line targets an output SKU already on the WO. Posts CONSUME entries on the input ledgers (per the recipe snapshot, scaled by received quantity) and PRODUCE entries on the FG ledger at the work site, and advances WO status to Partial / Received. Atomic across both ledgers; FIFO consume costing and the cost cascade are a v1 gap — see W137.

Response — 201 Created

{
"workOrder": { "id": "uuid", "woNumber": "WO-2026-0017", "status": "Received", "...": "..." },
"receipt": { "id": "uuid", "workOrderId": "uuid", "receiptDate": "2026-05-25", "...": "..." },
"receiptItems": [ { "id": "uuid", "receiptId": "uuid", "skuId": "uuid", "quantity": 100, "...": "..." } ]
}

Errors

HTTPcodeCondition
404not_foundNo such WO.
409invalid_transitionWO is Cancelled.
422validation_failedShape invalid, or a receipt line references a SKU that is not on this WO.

Workflow

Calls W137 Create receipt against work order.