Cancel Order

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"
  }
}
FieldTypeRequiredDescription
idStringNRequest ID. Echoed back in the response so you can match requests to responses.
actionStringYMust be cancel_order.
argsObjectYCancellation parameters.
> orderIdStringNLTP-assigned order ID to cancel. If both orderId and clientOrderId are provided, orderId takes precedence.
> clientOrderIdStringNYour own order ID to cancel. Only supports lowercase letters (a-z) and digits (0-9).

At least one of orderId or clientOrderId must be provided. Only orders in NEW, OPEN, or PARTIALLY_FILLED state 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: 200000 means LTP has submitted the cancellation request to the exchange. The order is not yet cancelled at this point. Monitor the Orders push channel for orderState: "CANCELLED" to confirm the order has been fully cancelled.

FieldTypeDescription
idStringRequest ID.
eventStringcancel_order on success, error on failure.
codeLong200000 = cancellation request accepted. Any other value indicates an error — check msg for the reason.
msgString"Success" on success, or an error message explaining why the cancellation was rejected.
dataObjectPresent on success only.
> orderIdStringLTP-assigned order ID of the order being cancelled.
> clientOrderIdStringYour own order ID, if one was assigned.
> orderStateStringOrder state at the time the cancellation request was received (typically OPEN).
> actionStringCANCEL_PENDING — the cancellation has been submitted to the exchange and is in progress.
> actionMsgStringAdditional message about the cancellation. Usually empty.