cancel action removes resting orders from the order book using the exchange-assigned order IDs returned in the resting.oid field when you originally placed them. An entry without o can instead locate the order by its client order ID c. You can cancel up to 10 orders in a single signed request, mixing contracts freely within the batch.
Endpoint
Request
Action Fields
string
required
type (required) — Fixed value: "cancel".array
required
cancels (required) — Array of cancel objects. Maximum 10 per request; more returns BATCH_TOO_LARGE. Each entry identifies the contract and the order to cancel.boolean
sync — Envelope-level, beside action, and not signed. true returns HTTP 200 with one result per cancel; 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.Cancel Object Fields
int32
required
a (asset) (required) — The integer contract ID for the order you want to cancel. Must match the contract the order was placed on.int64
o (orderId) — The exchange-assigned order ID from the resting.oid field returned when the order was placed. When o is present it identifies the order and c is ignored.string
c (clientOrderId) — The client order ID set at placement, used to locate the order only when o is omitted. Only decimal digits (0–9) are accepted, at most 20 bytes, within the int64 range; otherwise the request returns 400 INVALID_PARAM with errors[].reason INVALID_FORMAT (OUT_OF_RANGE outside int64). The format check applies only when c is used to locate the order.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 per-item outcome arrives on the orderUpdates channel instead. Without sync the server default decides — handle both.- Success
- Order Not Found
Both cancellations succeeded. Each successful entry is the plain string
"success", in the same order as cancels[].Response Fields
array
One entry per cancel object in request order. Each entry is either:
- The string
"success"— the order was found and removed from the book. - An object
{"error": "<reason>"}— the cancellation failed; the reason string explains why.
A top-level
"status": "ok" does not mean every individual cancellation succeeded. Always inspect each element of statuses to detect per-order failures.