Bulk Allocate Sales Orders
POST/api/sales-orders/bulk-allocate
Starts an asynchronous bulk allocate operation for the targeted sales orders and returns immediately with a tracked_job_log_id to poll for progress and results.
orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token.
Request body fields (one of ids or filters is required):
- ids (array of integers, required without
filters): Sales order IDs to target. Each ID must exist. - filters (object or string, required without
ids): Resolves to the matching sales order IDs — the same targeting the sales-orders list uses. Two shapes are accepted:- Grouped filters:
{ "filter_groups": "<base64-encoded JSON tree>" }. The decoded tree looks like{"conjunction":"and","children":[{"type":"condition","condition":{"column":"order_status","operator":"is","value":"open"}}]}. - Legacy filter set (JSON string) for older clients.
- Grouped filters:
Behavior:
- For each order, inventory is allocated to every eligible line's remaining unallocated demand. Lines whose warehouse does not track allocations, and lines already fully allocated or fulfilled, are skipped.
- The operation runs in the background. Poll the tracked job log endpoints with the returned ID for progress and the completion summary (orders processed / fully allocated / partially allocated / skipped; lines allocated / already allocated / failed) plus any per-order errors.
- Call the preview endpoint (
POST /api/sales-orders/bulk-allocate/preview) first to see exactly which orders and lines will be affected.
Requires permission: sales_orders.update
Request
Responses
- 200
- 401
- 403
- 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.
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.