Skip to Content
Trading

Subscribe to TRADING

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

Send a SUBSCRIBE message naming TRADING. The server answers with a SUBSCRIPTIONS confirmation, or an error. You must authenticate first, with a token that has the Trade permission; otherwise the request is rejected with AUTHENTICATION_REQUIRED. The confirmation carries the account_id of the account your token authenticated.

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.

Code Sample
const payload = {  "type": "SUBSCRIBE",  "channels": [    {      "name": "TRADING"    }  ]};const socket = new WebSocket("wss://streams.fast.onetrading.com/");socket.addEventListener("open", () => {  socket.send(JSON.stringify(payload));});

Messages

Requires a prior successful AUTHENTICATE with a token that has the Trade permission.

application/json
  1. payload
type*string
channels*array<>
Items1 <= items <= 1
trading

Subscribe to the TRADING channel

{  "type": "SUBSCRIBE",  "channels": [    {      "name": "TRADING"    }  ]}

Reply

Receive

Sent back on the same channel.