Bulk Delete Sales Orders (Tracked)
DELETE/api/sales-orders/tracked
Bulk deletes sales orders with progress tracking. Dispatches a background job and returns a tracked_job_log_id to poll via the tracked job log endpoints.
orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token.
Request body (scope: one of ids or filters is required):
ids(array of int, required withoutfilters): Explicit sales order IDs to delete.filters(object, required withoutids): Resolves to a list of sales order IDs via the same Spatie QueryBuilder pipeline the V2 sales-orders list/export use. Two shapes are accepted:- Grouped filters (current list):
{ \"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 (current list):
apply_to_all(bool, optional): When true the action targets every order matching the activefiltersrather than an explicitidslist.
Behavior:
- Returns the tracked job log ID immediately; deletion runs asynchronously.
- Sending
filtersas the groupedfilter_groupsobject is fully supported (previously returned a 500).
Requires permission: sales_orders.delete
Request
Responses
- 200
- 401
- 403
- 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.
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.