E068: Update material
PATCH /api/materials/:id
Edits a material's header fields. Triggered from Material Detail.
Authentication
Standard tenant route. Requires Authorization: Bearer <firebase-id-token> and X-Org-Id: <org-id>. Access: Member.
Request
{ "name": "...", "materialTypeId": "uuid", "unit": "kg", "isActive": true }
Passing isActive archives (false) or reactivates (true) the material; all fields are optional.
Response — 200 OK
{ "id": "uuid", "code": "MAT-001", "name": "...", "materialTypeId": "uuid", "unit": "kg", "isActive": true, "createdAt": "..." }
Errors
| HTTP | code | Condition |
|---|---|---|
| 404 | not_found | No such material. |
| 422 | validation_failed | Shape invalid. |
Workflow
Calls W068 Update material.