E065: Create material
POST /api/materials
Creates a new raw-material record. Triggered from the Materials page, "New material".
Authentication
Standard tenant route. Requires Authorization: Bearer <firebase-id-token> and X-Org-Id: <org-id>. Access: Member.
Request
{ "code": "MAT-001", "name": "...", "materialTypeId": "uuid", "unit": "kg" }
Response — 201 Created
{ "id": "uuid", "code": "MAT-001", "name": "...", "materialTypeId": "uuid", "unit": "kg", "isActive": true, "createdAt": "..." }
Errors
| HTTP | code | Condition |
|---|---|---|
| 404 | not_found | Material type not found. |
| 422 | validation_failed | Duplicate code, or shape invalid. |
Workflow
Calls W065 Create material.