Cancel Order

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.

NameTypeMandatoryDescription
orderIdStringNOrder ID
clientOrderIdStringNCustomer-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 nameTypeRemarks
orderIdStringOrder ID
clientOrderIdStringCustomer-defined order ID
orderStateStringOrder State
actionStringCANCEL_PENDING
CANCEL_COMPLETE
CANCEL_FAILED
actionMsgStringactionMsg

Example Request

{
  "orderId": "2106591138643265"
}

Example Response

{
  "code": 200000,
  "message": "Success",
  "data": {
    "orderId": "1234567890123456",
    "clientOrderId": "my-order-001",
    "orderState": "OPEN",
    "action": "CANCEL_PENDING",
    "actionMsg": ""
  }
}
Body Params
string

Order ID

string

Customer-defined order ID

Response

Language
LoadingLoading…
Response
Choose an example:
application/json