Batch Cancel Orders
Frequency limit:10 times/1s (UID)
Description
Cancel Orders in Batch
- For batch cancellation (simultaneously revoking multiple orders for the same symbol), it is not permitted to mix the use of orderId and clientOid. The identifiers used must be consistent across all orders in the batch. Otherwise, orders that only submit a clientOid will fail to be cancelled.
HTTP Request
- POST /api/v2/spot/trade/batch-cancel-order
Request Example
curl -X POST "https://api.bitget.com/api/v2/spot/trade/batch-cancel-order" \
-H "ACCESS-KEY:*******" \
-H "ACCESS-SIGN:*" \
-H "ACCESS-PASSPHRASE:*" \
-H "ACCESS-TIMESTAMP:1659076670000" \
-H "locale:en-US" \
-H "Content-Type: application/json" \
-d '{
"symbol": "",
"batchMode":"multiple",
"orderList": [
{
"orderId":"121211212122",
"symbol":"BTCUSDT",
"clientOid":"121211212122"
}
]
}'
Request Parameter
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | String | No | Trading pair name, e.g. BTCUSDT |
| batchMode | String | No | Batch order modesingle single currency mode, default single currency modemultiple cross-currency mode. If single mode , the symbol in orderlist will be ingor If multiple mode , the symbol in orderlist is not allow be null, and the symbol in orderlist is required. symbol outside orderlist will be ingor |
| orderList | Array | Yes | Order ID List ,maximum length: 50 |
| >symbol | String | No | Trading pair name, e.g. BTCUSDT |
| > orderId | String | No | Order ID. Either orderId or clientOid is required. |
| > clientOid | String | No | Client Order ID.Either clientOid or orderId is required. |
Response Example
{
"code": "00000",
"msg": "success",
"requestTime": 1695808949356,
"data": {
"successList": [
{
"orderId": "121211212122",
"clientOid": "121211212122"
}
],
"failureList": [
{
"orderId": "121211212122",
"clientOid": "xxx001",
"errorMsg": "duplicate clientOrderId"
}
]
}
}
Response Parameter
| Parameter | Type | Description |
|---|---|---|
| successList | Array | Successful order number |
| >orderId | String | Order ID |
| >clientOid | String | Client Order ID |
| failureList | Array | Failed order number |
| >orderId | String | Order ID |
| >clientOid | String | Client Order ID |
| >errorMsg | String | Error information |
| >errorCode | String | Error code |