E144: Create sales order
POST /api/sales-orders
Opens a new sales order and records demand against finished-goods inventory. Triggered from the Sales Orders page, "New SO". On creation the SO already lands at status Received (or whatever initial status the caller picks), so the FG ledger DEMAND entries are written immediately and the SO is visible in inventory planning right away.
Authentication
Standard tenant route. Requires Authorization: Bearer <firebase-id-token> and X-Org-Id: <org-id>. Access: Member.
Request
{
"customerId": "uuid",
"orderChannelId": "uuid",
"brokerId": null,
"shipToLocationId": "uuid",
"orderDate": "2026-05-18",
"expectedShipDate": "2026-05-22",
"notes": "..."
}
soNumber generated server-side (per-tenant). On create, the SO status is initialized to the configured "first" order status type and fulfillment status to "Not allocated"; DEMAND ledger entries are written when items are added.
Response — 201 Created
{
"id": "uuid",
"soNumber": "SO-2026-0123",
"customerId": "uuid",
"orderChannelId": "uuid",
"brokerId": null,
"shipToLocationId": "uuid",
"orderDate": "2026-05-18",
"expectedShipDate": "2026-05-22",
"status": "Confirmed",
"fulfillmentStatus": "Allocated",
"totalCost": 1234.56,
"totalRevenue": 2400.00,
"notes": "..."
}
Errors
| HTTP | code | Condition |
|---|---|---|
| 404 | not_found | Customer / channel / broker / location does not exist. |
| 422 | validation_failed | Field shape invalid. |
Workflow
Calls W144 Create sales order.