E131: Get work order detail
GET /api/work-orders/:id
Returns a single WO with everything the detail page needs: header, items (with received-quantity rollup), recipe snapshot, referenced catalog rows, and the derived material status. Triggered by clicking a WO in the list.
Authentication
Standard tenant route. Requires Authorization: Bearer <firebase-id-token> and X-Org-Id: <org-id>. Access: Member.
Request
No body.
Response — 200 OK
{
"workOrder": WorkOrder,
"sku": { "id": "uuid", "code": "...", "name": "..." },
"siteLocation": { "id": "uuid", "name": "..." },
"stockLocation": { "id": "uuid", "name": "..." },
"recipeSnapshot": [ { "inputId": "uuid", "inputType": "material", "quantity": 2.0, "unit": "kg" } ],
"receipts": [ Receipt, ... ],
"producedTotals": { "produced": 100, "expected": 100 }
}
recipeSnapshot is the captured BOM at WO-create time (per W129) — not a live BOM lookup.
Errors
| HTTP | code | Condition |
|---|---|---|
| 404 | not_found | No such WO. |
Workflow
Calls W131 Get work order detail.