Create order
Requires authentication and a TRADING subscription. A request that fails validation is answered with an error echoing the payload. A request that passes validation is booked (Order Booked), or may subsequently be rejected (Order Rejected).
Nothing is sent in reply to an accepted request itself: the outcome arrives as events on the TRADING channel. Before the request reaches the exchange, it can be refused with AUTHENTICATION_REQUIRED, NOT_SUBSCRIBED_TO_TRADING_CHANNEL or RATE_LIMITED; 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).
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": "CREATE_ORDER", "order": { "instrument_code": "BTC_EUR", "amount": "0.1", "side": "SELL", "type": "LIMIT", "price": "85000", "time_in_force": "GOOD_TILL_CANCELLED" }};const socket = new WebSocket("wss://streams.fast.onetrading.com/");socket.addEventListener("open", () => { socket.send(JSON.stringify(payload));});- payload
type*stringorder*Limit sell, good till cancelled
{ "type": "CREATE_ORDER", "order": { "instrument_code": "BTC_EUR", "amount": "0.1", "side": "SELL", "type": "LIMIT", "price": "85000", "time_in_force": "GOOD_TILL_CANCELLED" }}Reply
Sent back on the same channel.