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). A partial split — slices totalling less than the unfulfilled quantity — keeps the remainder at the line's own (home) warehouse: it is re-allocated there (on hand first, then backorder) and stays on that warehouse's fulfillment order, merged with any slice you sent for that warehouse. No unit is left unallocated. 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.