API Reference

Cancel Order

Rate Limit: 1200 requests per 60 seconds

Tip:
You can cancel order by websocket after login.

Request

{
  "id": "XXX",
  "action": "cancel_order",  
  "args":  
  {  
    "clientOrderId": "XXXX",  
    "orderId": "XXX"
  }  
}

Field nameTypeNecessaryRemarks
idStringNclient request id
actionStringYcancel_order
argsObjectYrequest params
> orderIdStringNOrder ID
> clientOrderIdStringNCustomer 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

Success example:

{
  "id": "XXXX", // request id
  "event": "cancel_order",  
  "code": "0",  
  "msg": "",
  "data": {
  	"orderId": "XXXXX",
    "clientOrderId": "XXXX"
  }
}

Fail example:

{  
  "id":"***",
  "event": "error",  
  "code": "60009",  
  "msg": "Cancel Order failed."  
}
Field nameTypeRemarks
idStringclient request id
eventStringEvent
codeStringCode
msgStringMsg
dataObjectresponse data
> orderIdStringOrder ID
> clientOrderIdStringCustomer-defined order ID