Skip to main content
Version: v1.0.0(int)

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

HTTPcodeCondition
404not_foundCustomer / channel / broker / location does not exist.
422validation_failedField shape invalid.

Workflow

Calls W144 Create sales order.