E132: Update work order
PATCH /api/work-orders/:id
Edits a WO's header fields, including status and lifecycle timestamps. Triggered from Work Order Detail. The WO status flow is Draft → Entered → Placed → Production → In Transit → Partial → Received → Completed, with Cancelled available at any point. Status is patched directly; a validated transition map is a v1 gap. Status changes reconcile the inventory ledgers via the projector (see W132). Partial / Received are normally computed by the receipt workflow (W137).
Authentication
Standard tenant route. Requires Authorization: Bearer <firebase-id-token> and X-Org-Id: <org-id>. Access: Member.
Request
{
"expectedDate": "2026-05-27",
"status": "Placed",
"notes": "..."
}
Header fields only. status accepts any of the nine org.wo_status values (Draft, Entered, Placed, Production, In Transit, Partial, Received, Completed, Cancelled); transition validation is a v1 gap.
Response — 200 OK
{
"id": "uuid",
"woNumber": "WO-2026-0017",
"skuId": "uuid",
"quantity": 100,
"status": "Production",
"siteLocationId": "uuid",
"stockLocationId": "uuid",
"startDate": "2026-05-18",
"expectedDate": "2026-05-25",
"materialUnitCost": 4.12,
"conversionCost": 1.50,
"notes": "..."
}
Errors
| HTTP | code | Condition |
|---|---|---|
| 404 | not_found | No such WO. |
| 422 | validation_failed | Shape invalid. |
Workflow
Calls W132 Update work order.