One Trading API
REST APIWebSocket API
REST APIWebSocket 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
    • Balances
      GET
    • Fees
      GET
    • Get Orders
      GET
    • Create Order
      POST
    • Get Order by Order ID
      GET
    • Get Order by Client ID
      GET
    • Cancel All Orders
      DELETE
    • Cancel Order by Order ID
      DELETE
    • Cancel Order by Client ID
      DELETE
    • Get Trades for Order
      GET
    • Get Trades
      GET
    • Get Trade by Trade ID
      GET
  • Futures
    • Introduction
    • Funding Rate Methodology
    • Current Funding Rate
      GET
    • Funding Rate History
      GET
    • Futures Portfolio Summary
      GET
    • Get Futures Open Positions
      GET
  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 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.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.onetrading.com/fast/v1/account/orders' \
--header 'Content-Type: application/json' \
--data-raw '{
    "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"
}'
Response Response Example
200 - Success
{
  "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"
}

Request

Authorization
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Body Params application/json
instrument_code
string 
required
The id of the market to create the order on. Use the /instruments endpoint to get the ids of ACTIVE markets to trade on
type
enum<string> 
required
The type of order you wish to create
Allowed value:
LIMIT
side
enum<string> 
required
BUY or SELL
Allowed values:
BUYSELL
amount
string 
required
The amount of currency for this order
price
string 
required
The price at which the order is set to execute
client_id
string <uuid>
optional
Unique client identifier for the order. It is your responsibility for the uniqueness of the client_id, if you create multiple orders with the same client_id, any subsequent operation performed using this client_id will only apply to the latest
time_in_force
enum<string> 
optional
Defines the duration and conditions under which an order is considered valid in the market. Defaults to GOOD_TILL_CANCELLED
Allowed values:
GOOD_TILL_CANCELLEDIMMEDIATE_OR_CANCELLEDFILL_OR_KILLPOST_ONLY
reserve_price
string 
optional
Used for MOVE orders and is the max we can move to
Examples

Responses

🟢200Success
application/json
Body
order_id
string <uuid>
required
client_id
string <uuid>
required
account_id
string <uuid>
required
instrument_code
string <uuid>
required
time
string <date-time>
required
side
enum<string> 
required
Allowed values:
BUYSELL
price
string 
required
amount
string 
required
type
enum<string> 
required
Allowed value:
LIMIT
time_in_force
enum<string> 
required
Allowed values:
GOOD_TILL_CANCELLEDIMMEDIATE_OR_CANCELLEDFILL_OR_KILL
status
string 
required
🟠422Unprocessable
🟠400Bad Request
Previous
Get Orders
Next
Get Order by Order ID
Built with