Cancel a single open order by its order ID or client order ID. The response confirms LTP has accepted the cancellation request — the order is not immediately cancelled. A push message on the Orders channel with orderState: "CANCELLED" confirms the exchange has cancelled it.
Rate Limit: 1200 requests per 60 seconds
Request
Send a cancel_order action and identify the order using either orderId or clientOrderId. If you provide both, orderId takes precedence.
{
"id": "XXX",
"action": "cancel_order",
"args": {
"orderId": "XXX",
"clientOrderId": "XXXX"
}
}
| Field | Type | Required | Description |
|---|---|---|---|
id | String | N | Request ID. Echoed back in the response so you can match requests to responses. |
action | String | Y | Must be cancel_order. |
args | Object | Y | Cancellation parameters. |
> orderId | String | N | LTP-assigned order ID to cancel. If both orderId and clientOrderId are provided, orderId takes precedence. |
> clientOrderId | String | N | Your own order ID to cancel. Only supports lowercase letters (a-z) and digits (0-9). |
At least one of
orderIdorclientOrderIdmust be provided. Only orders inNEW,OPEN, orPARTIALLY_FILLEDstate can be cancelled.
Response
The response is sent immediately after LTP accepts the cancellation request and forwards it to the exchange.
Success:
{
"id": "XXXX",
"event": "cancel_order",
"code": 200000,
"msg": "Success",
"data": {
"orderId": "XXXXX",
"clientOrderId": "XXXX",
"orderState": "OPEN",
"action": "CANCEL_PENDING",
"actionMsg": ""
}
}
Failure:
{
"id": "***",
"event": "error",
"code": "60009",
"msg": "Cancel Order failed."
}
code: 200000means LTP has submitted the cancellation request to the exchange. The order is not yet cancelled at this point. Monitor theOrderspush channel fororderState: "CANCELLED"to confirm the order has been fully cancelled.
| Field | Type | Description |
|---|---|---|
id | String | Request ID. |
event | String | cancel_order on success, error on failure. |
code | Long | 200000 = cancellation request accepted. Any other value indicates an error — check msg for the reason. |
msg | String | "Success" on success, or an error message explaining why the cancellation was rejected. |
data | Object | Present on success only. |
> orderId | String | LTP-assigned order ID of the order being cancelled. |
> clientOrderId | String | Your own order ID, if one was assigned. |
> orderState | String | Order state at the time the cancellation request was received (typically OPEN). |
> action | String | CANCEL_PENDING — the cancellation has been submitted to the exchange and is in progress. |
> actionMsg | String | Additional message about the cancellation. Usually empty. |
