Skip to main content
The cancelAll action removes all open orders — both limit and conditional (take-profit / stop-loss) — for a specified contract in a single signed request. Use this when you need to flatten your order book exposure for a contract quickly without tracking individual order IDs.

Endpoint

Request

Action Fields

string
required
type (required) — Fixed value: "cancelAll".
int32
required
a (asset) (required) — The integer contract ID for which all open orders should be cancelled. Only orders on this contract are affected; orders on other contracts remain untouched.
boolean
sync — Envelope-level, beside action, and not signed. true returns HTTP 200 with the limitCancelled / conditionalCancelled counts; false returns HTTP 202 and the results arrive on orderUpdates. When omitted, the server default applies. Must be a JSON boolean. See Synchronous and asynchronous responses.

Response

Two status codes are possible. With sync: true the server answers HTTP 200 with the result shown below; with sync: false it answers HTTP 202, acknowledging the request for asynchronous processing:
count is always 1. On a 202 the outcome arrives on the orderUpdates channel instead. Without sync the server default decides — handle both.
The synchronous result carries counts, not a statuses[] array — a parser that reads statuses[] for every 200 from the order and cancel actions must special-case cancelAll.

Response Fields

int
The number of resting limit orders that were cancelled for the specified contract.
int
The number of conditional orders (take-profit and stop-loss) that were cancelled for the specified contract.
If there are no open orders for the contract, the call still succeeds and both counts will be 0. This makes cancelAll safe to call defensively at the start of a session or strategy reset.
cancelAll is scoped to a single contract per request. To cancel all orders across multiple contracts, send one cancelAll request per contract, each with its own signed nonce.

Errors