Skip to main content

Bulk Close Sales Orders

POST 

/api/sales-orders/close

Bulk closes one or more sales orders by transitioning their order_status to closed.

Required scope: orders:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Authentication: Requires Bearer token.

Request body (one of ids or filters is required):

  • ids (array of integers, required without filters): Sales order IDs to close.
  • filters (object, required without ids): Filter set that resolves to a list of sales order IDs (same shape used by the V2 sales-orders listing endpoint). It accepts the grouped filter_groups shape ({ \"filter_groups\": \"<base64 JSON>\" }, same as the V2 list) as well as the legacy JSON-string filter set.
  • archived (integer, optional, default 0): Used with filters — set to 1 to include archived orders when resolving IDs.

Behavior:

  • Each order is closed individually via SalesOrder::close.
  • Orders with active backorders (Planned or AwaitingReceipt allocations) or unmapped product lines are skipped and returned as warnings.
  • Returns 200 if all orders close, 200/warning if some are skipped, 400 if none can close.

Requires permission: sales_orders.cancel

Request

Responses

OK

Response Headers
    Content-Type