One Trading API
REST API
WebSocket API
REST API
WebSocket API
  1. Trading
  • Public
    • Currencies
      GET
    • Instruments
      GET
    • Candlesticks
      GET
    • Fee Groups
      GET
    • Order Book
      GET
    • Market Ticker
      GET
    • Market Ticker For Instrument
      GET
    • Time
      GET
  • Trading
    • Get Orders
      GET
    • Create Order
      POST
    • Get Order by Client ID
      GET
    • Get Order by Order ID
      GET
    • Balances
      GET
    • Subaccounts
      GET
    • Fees
      GET
    • Get Trades for Order
      GET
    • Get Trade by Trade ID
      GET
    • Get Trades
      GET
    • Cancel All Orders
      DELETE
    • Cancel Order by Order ID
      DELETE
    • Cancel Order by Client ID
      DELETE
    • Get Exotic Orders (TP/SL)
      GET
    • Create Exotic Order (TP/SL)
      POST
    • Update Exotic Order (TP/SL)
      PATCH
    • Cancel Exotic Order (TP/SL)
      DELETE
  • Futures
    • Introduction
    • Funding Rate Methodology
    • Funding Payments
      GET
    • Get Futures Open Positions
      GET
    • Positions
      GET
    • Position Funding Payments
      GET
    • Futures Portfolio Summary
      GET
    • Current Funding Rate
      GET
    • Funding Rate History
      GET
    • Funding Schedule
      GET
    • Funding Rate Settings
      GET
  • Funding
    • Transfer Subaccount Balance
      POST
    • Get Transactions
      GET
    • Get Deposit Addresses
      GET
    • Create Deposit Address
      POST
  1. Trading

Create Order

POST
https://api.onetrading.com/fast/v1/account/orders

Create a New Order#

Ensure your API key has the TRADE scope. You can generate an API key through the One Trading UI.
This endpoint is rate-limited per account holder (see 429).
This endpoint allows you to create a new order of type LIMIT.

Time in Force Options#

For LIMIT orders, you can specify one of the following time_in_force options:
GOOD_TILL_CANCELLED (default): The order remains open until canceled.
IMMEDIATE_OR_CANCELLED: The order is filled immediately, either in full or partially, with any unfilled portion canceled.
FILL_OR_KILL: The order must be filled in full immediately; otherwise, it is canceled.
POST_ONLY: Ensures the order is added to the order book as a maker order and will be rejected if it would execute immediately as a taker order.
If no time_in_force is specified, GOOD_TILL_CANCELLED is assumed.

Order Size and Precision#

Each order must meet a minimum size requirement. You can retrieve this minimum, along with precision limitations, by querying the /instruments endpoint.
Note: There is a global limit of 200 open orders per user across all markets.

Client ID for Order Tracking#

Optionally, you can set a client_id to track orders without waiting for the assigned order_id.
Important: You are responsible for ensuring the uniqueness of each 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 / Stop Loss#

You can attach a take profit and/or stop loss (TP/SL) to the order. It is held in a separate service, not on the exchange itself, and when the price reaches a level, a reduce-only limit order is placed on the exchange to close for you.
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.
The TP/SL is registered under the order's client_id before the order is placed, and is PENDING until the order fills:
When the order first fills, the TP/SL becomes 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.
If the order is rejected, or is cancelled or closes without a fill, the TP/SL is cancelled with it.
If a level has already been reached when the TP/SL becomes ACTIVE, it could never fire, so it is cancelled instead (VALIDATION_FAILED_AT_ACTIVATION).
Once 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.
A TP/SL is not an exchange order, so it does not appear in Get Orders. Read it back with Get Exotic Orders (TP/SL), change its levels with Update Exotic Order (TP/SL) and cancel it with Cancel Exotic Order (TP/SL): by the order's 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.
A TP/SL that is not accepted rejects the whole request and the order is not placed: see 400, 409, 410 and 503.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json

Examples

Responses

🟢200Success
application/json
Bodyapplication/json

🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🟠409Conflict
🟠410Gone
🟠422Unprocessable
🟠429Too Many Requests
🔴500Server Error
🔴503Service Unavailable
Request Request Example
Shell
JavaScript
Java
Swift
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
}'
Response Response Example
200 - Success Example
{
    "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"
}
Previous
Get Orders
Next
Get Order by Client ID
Built with