cancelByCloid action lets you cancel orders using the client order ID (c field) you assigned when placing each order. This is useful when your system manages its own order identifiers and you want to avoid storing the exchange-assigned oid alongside them. You can include up to 10 cancels in a single signed request.
Endpoint
Request
Action Fields
string
required
type (required) — Fixed value: "cancelByCloid".array
required
cancels (required) — Array of cancel-by-cloid objects. Maximum 10 per request; more returns BATCH_TOO_LARGE. Each entry identifies the contract and the client order ID of 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.string
required
cloid (clientOrderId) (required) — The client order ID you set in the c field when placing the order (an int64 decimal string, e.g. "1778763737044"). This value must match exactly. 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). A missing cloid returns INVALID_PARAM with reason MISSING_PARAM.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
- Not Found
The order was found by its client order ID and removed from the book.
Response Fields
array
One entry per cancel object in request order. Each entry is either:
- The string
"success"— the order was located by client order ID and cancelled. - An object
{"error": "<reason>"}— the cancellation failed; inspect the reason string for details.
