Skip to Content
Trading

Cancel Order by Order ID

DELETE
/v1/account/orders/{order_id}

Submits a request to close an open order by providing a valid order_id. Optionally pass the order's instrument_code.

The call waits for the exchange to confirm the cancellation (up to 2 seconds).

Requires an API key with the TRADE scope. This endpoint is not rate-limited.

Authorization

bearerAuth
headerAuthorizationBearer <token>

API key created in the One Trading UI, sent as Authorization: Bearer <token>. Each endpoint lists the key permission it needs.

Path Parameters

order_id*string

The order ID of the order to cancel

Formatuuid

Query Parameters

instrument_code?string

Optional. The instrument the order is on; the exchange then looks for the order on this instrument only, and an order on another instrument is not found (404).

Response Body

OK

application/json
  1. response
order_id*string
Formatuuid
client_id*string
Formatuuid
account_id*string
Formatuuid
instrument_code*string
time*string
Formatdate-time
side*string
price*string
amount*string
type*"LIMIT"

Always LIMIT

Value in"LIMIT"
status*string

Status of the first event the exchange sends for the order after the cancel request. Usually CANCELLED, but it can be another status, e.g. a fill, when the order was matching as the cancel arrived; check the order before relying on it.

Example Request
curl -X DELETE 'https://api.onetrading.com/fast/v1/account/orders/?instrument_code=BTC_USDC'
Example Response
{  "order_id": "e4cc5059-b6dd-4e7e-9d22-2d3576333fab",  "client_id": "316d076d-76f7-49c6-beb1-7831e0f93a9e",  "account_id": "726288e6-a463-4f88-9068-024ae8f97a34",  "instrument_code": "SOL_EUR",  "time": "2024-11-14T15:56:37.417Z",  "side": "SELL",  "price": "150",  "amount": "1",  "type": "LIMIT",  "status": "CANCELLED"}