Skip to main content

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​

FieldTypeRequiredDescription
categorystringYesProduct type: either "spot" (spot trading) or "linear" (linear futures). The same product type must be used within a batch.
requestarrayYesList of orders to be canceled. The product type is specified by the top-level category.
request[].symbolstringYesTrading pairs, such as BTCUSDT (linear) or btc_usdt (spot).
request[].orderIdstringConditionally requiredSystem order ID. For each order specified by either orderId or orderLinkId, choose one.
request[].orderLinkIdstringConditionally requiredCustom order ID. For each order, specify either orderId or orderLinkId. Choose one.

Response Parameters​

FieldTypeDescription
data.listarrayList of individual order cancellation results. Please check the code and message for each item.
data.list[].categorystringProduct type, supports spot (spot trading) and linear (linear futures).
data.list[].symbolstringtrading pair, for example BTCUSDT.
data.list[].orderIdstringSystem order ID. May be empty if the order processing fails
data.list[].orderLinkIdstringCustom order ID. May be empty if not set.
data.list[].codeintegerProcessing status for this order. 200 indicates success.
data.list[].messagestringprocessing 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
}