Subscribe to TRADING
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).
apiTokenAuthorizationBearer <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": "SUBSCRIBE", "channels": [ { "name": "TRADING" } ]};const socket = new WebSocket("wss://streams.fast.onetrading.com/");socket.addEventListener("open", () => { socket.send(JSON.stringify(payload));});Requires a prior successful AUTHENTICATE with a token that has the Trade permission.
- payload
type*stringchannels*array<>1 <= items <= 1Subscribe to the TRADING channel
{ "type": "SUBSCRIBE", "channels": [ { "name": "TRADING" } ]}Reply
Sent back on the same channel.