TRADE scope. You can generate an API key through the One Trading UI.429).time_in_force options:time_in_force is specified, GOOD_TILL_CANCELLED is assumed./instruments endpoint.client_id to track orders without waiting for the assigned order_id.client_id. If multiple orders share the same client_id, only the newest order can be canceled via client_id; older orders will require the specific order_id or use of the "Cancel All Orders" endpoint.take_profit and stop_loss are each { "value": "<price>", "type": "MID" | "BBO" } (type defaults to MID). Send at least one.tpsl_mode is required with them. order closes this order's filled amount. position closes the whole position on the instrument, as it is when the level is reached (futures only).tpsl_force: true, in position mode, replaces the instrument's existing position TP/SL. Without it a second position TP/SL is refused with POSITION_TPSL_EXISTS.tpsl_slippage_bps bounds the price of the close: a limit order at the level less the slippage when selling, or plus it when buying. Defaults to 500 (5%), or the instrument's price collar if that is less.client_id before the order is placed, and is PENDING until the order fills:ACTIVE. A position TP/SL sent with tpsl_force replaces the existing one at that moment, not before: until then the existing one stays ACTIVE.ACTIVE, it could never fire, so it is cancelled instead (VALIDATION_FAILED_AT_ACTIVATION).ACTIVE, the TP/SL no longer depends on the order: cancelling what is left of the order, or Cancel All Orders, leaves it in place. It ends when a level fires, when you cancel it, or when its position is closed or flips.client_id, or for a position TP/SL by instrument_code. To add one to an order or position you already have, use Create Exotic Order (TP/SL). Every change of state is sent on the WebSocket ACCOUNT channel.400, 409, 410 and 503.curl --location 'https://api.onetrading.com/fast/v1/account/orders' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"instrument_code": "string",
"type": "LIMIT",
"side": "BUY",
"amount": "string",
"price": "string",
"client_id": "5b3fa7ba-57d3-4017-a65b-d57dcd2db643",
"time_in_force": "GOOD_TILL_CANCELLED",
"reserve_price": "string",
"take_profit": {
"value": "string",
"type": "MID"
},
"stop_loss": {
"value": "string",
"type": "MID"
},
"tpsl_mode": "order",
"tpsl_force": false,
"tpsl_slippage_bps": 1
}'{
"order_id": "dc3239e2-e808-433a-8875-12ab7c537ce4",
"client_id": "58503f2b-ca87-4816-9338-93c443e6fdde",
"account_id": "726288e6-a463-4f88-9068-024ae8f97a34",
"instrument_code": "SOL_EUR",
"time": "2024-11-14T14:36:36.286Z",
"side": "SELL",
"price": "150",
"amount": "1",
"type": "LIMIT",
"time_in_force": "GOOD_TILL_CANCELLED",
"status": "OPEN"
}