Cancel a single open order by its order ID or client order ID. The response confirms ConneX has accepted the cancellation request — the order is not immediately cancelled. A push message on the Orders channel with orderState: "CANCELLED" confirms the exchange has cancelled it.
Tip:
You can cancel order by websocket after login.
This action runs over the User Data WebSocket connection at wwss://wss.connex.trade/v1/private. The server rejects everything until you send a login message, and drops the connection after 30 seconds of inactivity — see Overview for the login payload, signature and heartbeat.
Rate Limit
The limits below apply to this operation. Binance perpetual, Binance spot and margin combined, and OKX across all business lines are counted separately.
main portfolio:
Binance (all business lines)
- Rate Limit: 1200 requests per 60 seconds.
OKX (all business lines)
- Rate Limit: 30 requests per 2 seconds per symbol.
- Rate Limit: 500 requests per 2 seconds per user across all OKX symbols and business lines.
sub portfolio:
Binance perpetual
- Rate Limit: 20 requests per 10 seconds.
Binance spot and margin
- Rate Limit: 20 requests per 10 seconds.
OKX (all business lines)
- Rate Limit: 20 requests per 10 seconds.
Request
Send a cancel_order action and identify the order using either orderId or clientOrderId. If you provide both, orderId takes precedence.
{
"id": "XXX",
"action": "cancel_order",
"args":
{
"clientOrderId": "XXXX",
"orderId": "XXX"
}
}
| Field name | Type | Necessary | Remarks |
|---|---|---|---|
| id | String | N | Request ID. Echoed back in the response so you can match requests to responses. |
| action | String | Y | Must be cancel_order. |
| args | Object | Y | Cancellation parameters. |
| > orderId | String | N | ConneX-assigned order ID to cancel. If both orderId and clientOrderId are provided, orderId takes precedence. |
| > clientOrderId | String | N | Customer defined order ID ,only support letters(a-z) and numbers(0-9) |
Tip:Either orderId or clientOrderId must be sent. If both orderId and clientOrderId are provided, orderId takes precedence,note that you can only cancel orders in the NEW/OPEN/PARTIALLY_FILLED status,otherwise even if the api request successful, it does not mean that the order has been cancelled.
Response
The response is sent immediately after ConneX accepts the cancellation request and forwards it to the exchange.
Success example:
{
"id": "XXXX", // request id
"event": "cancel_order",
"code": "0",
"msg": "",
"data": {
"orderId": "XXXXX",
"clientOrderId": "XXXX"
}
}
Fail example:
{
"id": "***",
"event": "cancel_order",
"code": 60009,
"msg": "Cancel Order failed.",
"data": {}
}
code: 200000means ConneX has submitted the cancellation request to the exchange. The order is not yet cancelled at this point. Monitor the Orders push channel fororderState: "CANCELLED"to confirm the order has been fully cancelled.
| Field name | Type | Remarks |
|---|---|---|
| id | String | client request id |
| event | String | Always cancel_order — for both success and failure responses. |
| code | String | 200000= cancellation request accepted. Any other value indicates an error — check msg for the reason. |
| msg | String | "Success" on success, or an error message explaining why the cancellation was rejected. |
| data | Object | Always present. On success: contains order details. On failure: empty object {}. |
| > orderId | String | ConneX-assigned order ID of the order being cancelled. Present on success only. |
| > clientOrderId | String | Your own order ID, if one was assigned. |
| > orderState | String | Order state at the time the cancellation request was received (typically OPEN or PARTIALLY_FILLED). |
| > action | String | CANCEL_PENDING — the cancellation has been submitted to the exchange and is in progress. |
| > actionMsg | String | Additional message about the cancellation. Usually empty. |
