Cancel an open order, this api is asynchronous. Returning success only means that the request is successful. The final result needs to be confirmed through websocket subscription and order query.
Permission
- Applies to both primary user and trading portfolio's API Key.
- Permission: TRADE.
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 body
Send a JSON object with Content-Type: application/json.
| Name | Type | Mandatory | Description |
|---|---|---|---|
| orderId | String | N | Order ID |
| clientOrderId | String | N | Customer-defined order ID |
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
| Field name | Type | Remarks |
|---|---|---|
| orderId | String | Order ID |
| clientOrderId | String | Customer-defined order ID |
| orderState | String | Order State |
| action | String | CANCEL_PENDING CANCEL_COMPLETE CANCEL_FAILED |
| actionMsg | String | actionMsg |
Example Request
{
"orderId": "2106591138643265"
}
Example Response
{
"code": 200000,
"message": "Success",
"data": {
"orderId": "1234567890123456",
"clientOrderId": "my-order-001",
"orderState": "OPEN",
"action": "CANCEL_PENDING",
"actionMsg": ""
}
}
