Skip to main content

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.

Required scope: orders:write

Grant 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.

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

OK

Response Headers
    Content-Type