Skip to main content

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

ParameterMandatoryTypeDescription
currencyPairFalseStringTrading instrument, i.e., BTC_USDT

Response Parameters

ParameterTypeDescription
msgstringsuccess

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}