Cancel Batch Orders
Description
Cancel up to 10 orders in a single request.
HTTP Request
- POST
/api/v3/order/cancel-batch - Supported Products:
spot/linear - Rate Limit: 10 requests per second per UID
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
category | string | Yes | Product type: either "spot" (spot trading) or "linear" (linear futures). The same product type must be used within a batch. |
request | array | Yes | List of orders to be canceled. The product type is specified by the top-level category. |
request[].symbol | string | Yes | Trading pairs, such as BTCUSDT (linear) or btc_usdt (spot). |
request[].orderId | string | Conditionally required | System order ID. For each order specified by either orderId or orderLinkId, choose one. |
request[].orderLinkId | string | Conditionally required | Custom order ID. For each order, specify either orderId or orderLinkId. Choose one. |
Response Parameters
| Field | Type | Description |
|---|---|---|
data.list | array | List of individual order cancellation results. Please check the code and message for each item. |
data.list[].category | string | Product type, supports spot (spot trading) and linear (linear futures). |
data.list[].symbol | string | trading pair, for example BTCUSDT. |
data.list[].orderId | string | System order ID. May be empty if the order processing fails |
data.list[].orderLinkId | string | Custom order ID. May be empty if not set. |
data.list[].code | integer | Processing status for this order. 200 indicates success. |
data.list[].message | string | processing information for this order. Error message is returned if the order fails |
Request Example
POST /api/v3/order/cancel-batch HTTP/1.1
Host: openapi.lbank.com
Content-Type: application/json
ex-api-key: <your_api_key>
ex-timestamp: <current_unix_timestamp_ns>
ex-nonce: <unique_random_hex>
ex-signature: <your_signature>
ex-client-type: API
{
"category": "linear",
"request": [
{
"symbol": "BTCUSDT",
"orderId": "<existing_order_id_1>"
},
{
"symbol": "BTCUSDT",
"orderId": "<existing_order_id_2>"
}
]
}
Response Example
The category for batch requests is at the top level, and the category is not repeated within each request. The response is uniformly formatted as data.list, where each item's code and message indicate the processing result of the corresponding order. Individual checks are required for each order, and only the outermost code should not be relied upon. The following are examples of two successfully executed orders, with order ID, timestamp, and custom order ID as illustrative values. Each item includes symbol, and the pending order can be located using orderId or the existing orderLinkId of the order.
HTTP/1.1 200 OK
Content-Type: application/json
{
"code": 200,
"message": "Success",
"data": {
"list": [
{
"category": "linear",
"symbol": "BTCUSDT",
"orderId": "<existing_order_id_1>",
"orderLinkId": "b320fe1a-478c-4d2e-a219-000000000003",
"code": 200,
"message": "Success"
},
{
"category": "linear",
"symbol": "BTCUSDT",
"orderId": "<existing_order_id_2>",
"orderLinkId": "b320fe1a-478c-4d2e-a219-000000000004",
"code": 200,
"message": "Success"
}
]
},
"extras": null
}