Skip to Content
Trading

Cancel order

Send
/
Serverwss://streams.fast.onetrading.com

Send CANCEL_ORDER with either client_id or order_id, and optionally the order's instrument_code. If you have created multiple orders with the same client_id, only the most recent is cancelled.

Nothing is sent in reply to an accepted request itself: the outcome arrives as an Order Closed event on the TRADING channel. An error from the exchange names the order by the order_id or client_id you sent. Before the request reaches the exchange, it can be refused with AUTHENTICATION_REQUIRED, NOT_SUBSCRIBED_TO_TRADING_CHANNEL, RATE_LIMITED, or CLIENT_ID_ERROR / ORDER_ID_ERROR for an identifier that is not a UUID; if it cannot be passed on, it is answered with INTERNAL_ERROR.

Private. Create, move and cancel orders, and receive a feed of order updates based on the trading activity in your account. You must be authenticated (token with the Trade permission) and subscribed to this channel to send trading messages. Order requests share one rate limit per account (see Rate limits).

Authorization

apiToken
headerAuthorizationBearer <token>

API token sent in the AUTHENTICATE message (not as a header). Generate it in the One Trading UI with the Trade permission; a valid token authorises all private channels for the connection.

const payload = {  "type": "CANCEL_ORDER",  "client_id": "8fd80590-4679-4e7d-9ef9-4346dadb5c8f"};const socket = new WebSocket("wss://streams.fast.onetrading.com/");socket.addEventListener("open", () => {  socket.send(JSON.stringify(payload));});

Messages

Reply

Receive

Sent back on the same channel.