E044: Create customer
POST /api/customers
Creates a new customer record. Triggered from the Customers page, "New customer". Classification rows (type, segment, broker) and parent (for hierarchy) are optional but, if supplied, must already exist in this org.
Authentication
Standard tenant route. Requires Authorization: Bearer <firebase-id-token> and X-Org-Id: <org-id>. Access: Member.
Request
{ "name": "Acme Foods", "code": "ACME", "customerTypeId": "uuid", "customerSegmentId": "uuid", "brokerId": null }
Response — 201 Created
{ "id": "uuid", "name": "Acme Foods", "code": "ACME", "customerTypeId": "uuid", "customerSegmentId": "uuid", "brokerId": null, "isActive": true, "createdAt": "..." }
Errors
| HTTP | code | Condition |
|---|---|---|
| 404 | not_found | Customer type / segment / broker not found. |
| 422 | validation_failed | Duplicate code within org, or shape invalid. |
Workflow
Calls W044 Create customer.