Split Line Across Warehouses
POST/api/sales-order-lines/:salesOrderLine/split-across-warehouses
Redistribute a sales order line's pre-dispatch fulfillment across multiple warehouses WITHOUT duplicating the line (Pattern C). The channel line stays 1:1 with upstream; the split materialises as one InventoryAllocation + one FulfillmentOrder per warehouse (1 SOL → N allocations → N FOs). Each slice allocates on-hand up to availability at that warehouse, with the remainder planned (backorder).
orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Pre-dispatch only. Allowed while every fulfillment order for the line is still open + unsubmitted. Once any FO has been submitted to a carrier the line can no longer be redistributed — returns 409.
Body fields:
slices(required, array, min 1) — the target distribution.slices[].warehouse_id(required, integer, must exist) — destination warehouse for this slice.slices[].quantity(required, integer, min 1) — units to fulfil from that warehouse.
The slice total must not exceed the line's unfulfilled quantity (422 otherwise). Duplicate warehouses are merged. Returns the refreshed sales order.
Request
Responses
- 200
- 401
- 403
- 404
- 409
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Conflict
Response Headers
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.