Bulk Close Sales Orders
POST/api/sales-orders/close
Bulk closes one or more sales orders by transitioning their order_status to closed.
orders:writeGrant 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 withoutfilters): Sales order IDs to close.filters(object, required withoutids): Filter set that resolves to a list of sales order IDs (same shape used by the V2 sales-orders listing endpoint). It accepts the groupedfilter_groupsshape ({ \"filter_groups\": \"<base64 JSON>\" }, same as the V2 list) as well as the legacy JSON-string filter set.archived(integer, optional, default 0): Used withfilters— 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
- 200
- 400
- 401
- 403
- 422
- 429
OK
Response Headers
Bad Request
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.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
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.