E140: Update receipt
PATCH /api/work-order-receipts/:id
Edits a previously-recorded WO receipt. Triggered from Work Order Detail receipts section. Metadata-only edits are a fast path; any change to received quantities rebuilds the paired ledger entries and recomputes the WO status.
Authentication
Standard tenant route. Requires Authorization: Bearer <firebase-id-token> and X-Org-Id: <org-id>. Access: Member.
Request
{ "receiptDate": "2026-05-26", "notes": "..." }
Header fields only — quantity / cost edits go through delete + re-create.
Response — 200 OK
{
"id": "uuid",
"woId": "uuid",
"receiptDate": "2026-05-25",
"notes": "...",
"consumedMaterials": [
{ "materialId": "uuid", "quantity": 200, "fifoLayers": [ { "ledgerEntryId": "uuid", "quantity": 200, "unitCost": 4.10 } ] }
],
"produced": [
{ "skuId": "uuid", "quantity": 100, "unitCost": 5.62 }
]
}
Errors
| HTTP | code | Condition |
|---|---|---|
| 404 | not_found | No such receipt. |
| 422 | validation_failed | Shape invalid. |
Workflow
Calls W140 Update receipt.