Cancel orders by CLOID
Endpoint
POST /exchange
Selector: action.type: "cancelByCloid"
Purpose
Targets an order by its client order ID instead of a returned venue order ID. The lookup is scoped to the authorized customer's account and the specified asset.
Authorization
Owner or permitted trading agent. The SDK signs the action; see raw signing for custom clients.
Request fields
| Field | Type | Required | Meaning |
|---|---|---|---|
action | Object | Yes | The supported action described below. |
nonce | Unsigned integer | Yes | Trading nonce; native-style millisecond timestamp convention. |
signature | Object | Yes | Wallet signature containing r, s and recovery byte v (27 or 28). |
expiresAfter | Unsigned integer or null | No | Request expiry in Unix milliseconds. |
vaultAddress | Null | No | Omit or use null; customer subaccount/vault routing is outside this profile. |
The action object contains:
| Field | Type | Required | Meaning |
|---|---|---|---|
action.type | String | Yes | "cancelByCloid". |
action.cancels | Array | Yes | Between 1 and 32 cancellation objects. |
action.cancels[].asset | Unsigned integer | Yes | Supported perpetual asset index. |
action.cancels[].cloid | Hex string | Yes | 0x followed by 32 hexadecimal characters. |
See the shared trading envelope for the common signing and routing fields.
Request example
The proof and identifiers are illustrative.
{
"action": {
"type": "cancelByCloid",
"cancels": [
{
"asset": 0,
"cloid": "0x11111111111111111111111111111111"
}
]
},
"nonce": 1796250000000,
"signature": {
"r": "0x1111111111111111111111111111111111111111111111111111111111111111",
"s": "0x2222222222222222222222222222222222222222222222222222222222222222",
"v": 27
}
}Response fields
| Field | Meaning |
|---|---|
status | Outer status, "ok" in the example below. |
response | Cancellation response object. |
response.type | "cancel", including for the cancelByCloid action. |
response.data.statuses | One result per cancellation, in request order: "success" or an error object. |
Response example
The action returns the cancellation response type, "cancel":
{
"status": "ok",
"response": {
"type": "cancel",
"data": {
"statuses": [
"success"
]
}
}
}Constraints
A batch contains between 1 and 32 cancellations. The CLOID must identify a matching open order owned by that customer on the specified asset.
Cancellation can race with fills. Reconcile uncertain outcomes before releasing reservations. Details.