Skip to main content

Cancel Order

Cancel an open spot order.

HTTP

MethodDELETE
Endpoint/trade/api/v2/order

Request Parameters

ParameterTypeMandatoryDescription
order_idstringYesThe order_id to cancel.

Example

import requests

body = {"order_id": "698ed406-8ef5-4664-9779-f7978702a447"}
headers, path = sign_request("DELETE", "/trade/api/v2/order")
response = requests.delete(BASE_URL + path, headers=headers, json=body)
print(response.json())

Response

{
"data": {
"order_id": "698ed406-8ef5-4664-9779-f7978702a447",
"symbol": "BTC/INR",
"price": 2300000,
"average_price": 0,
"orig_qty": 0.00005,
"executed_qty": 0,
"status": "CANCELLED",
"side": "SELL",
"exchange": "coinswitchx",
"order_source": "API_TRADING",
"created_time": 1689661638000,
"updated_time": 1689661639000
}
}

The response shape is the same as Create Order. The cancelled order's status will be CANCELLED once the exchange confirms, or CANCELLATION_RAISED while the cancel is still in flight at the exchange. See Order Lifecycle for the full state machine.

When cancellation isn't possible

  • The order has already filled or expired (status is terminal).
  • The exchange is in a CANCELLATION_RAISED window for the order — you must wait for confirmation.
  • The order is in a brief processing state (e.g. just placed but not yet acknowledged by the exchange).

In all cases, retry after a few hundred milliseconds and check the order's current status with Get Order.