Skip to Content
Trading

Cancel Order by Client ID

DELETE
/v1/account/orders/client/{client_id}

Submits a request to cancel an open order by providing a valid client_id and the instrument_code of the order.

A client_id is unique per instrument, not per account, so instrument_code is required.

Note: If you have created multiple orders with the same client_id on an instrument, only the most recent will be cancelled with this request. It is your responsibility to ensure uniqueness in your client_ids.

The call waits for the exchange to confirm the cancellation (up to 2 seconds). client_id must be a standard (RFC 9562) UUID.

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

client_id*string
Formatuuid

Query Parameters

instrument_code*string

The instrument the order is on. Required: a client_id is unique per instrument, not per account.

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/client/?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"}