Cancel All Orders
API Description
This interface allows users to cancel all unfilled orders for a specified instrument.
Note: Cancel all orders is only available via RESTful API.
Precautions
None
Authentication
This is a private interface and requires authentication. For details on using the RESTful API, refer to Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface.
Request Method
POST
Endpoint
/api/v1/private?command=cancelAllOrder
Frequency Limit
The frequency limit for this interface is 30 requests/2s per user ID. In addition to this per-interface limit, a global rate limit is also enforced.
For detailed information on Global rate limits and API Rate Limiting Policy, please refer to the "Frequency Limit" section at click here
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| currencyPair | False | String | Trading instrument, i.e., BTC_USDT |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| msg | string | success |
Request Example
The following Python code shows how to cancel all unfilled orders for BTC_USDT.
Note: For a complete code example, please refer to Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface.
api_url = "/api/v1/private?command=cancelAllOrder"
method = "post"
params = {
"currencyPair" :"BTC_USDT"
}
SpotRestfulPrivate(host, api_url, method, api_key, params, secret_key) # function SpotRestfulPrivate() is defined in section (Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface)
Note: For a complete Java code example, please refer to Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface.
Response Example
The following is an example response returned by the above Python request:
{'code': '200', 'data': {}, 'msg': 'SUCCESS', 'success': True, 'failed': False}