Developer Portal

New OrderPOST

Creates a new trading order for the authenticated user's account

View as Markdown
POST
/accounts/{account_id}/orders

Authorization

AuthorizationRequiredBearer <token>

JWT token obtained from the login endpoint

In: header

Request Body

application/jsonRequired
client_order_idstring

Client-provided order identifier

symbol_idRequiredstring

Trading symbol identifier

sideRequiredstring

Order side (buy/sell)

Value in: "TRADE_SIDE_UNSPECIFIED" | "TRADE_SIDE_BUY" | "TRADE_SIDE_SELL"
typeRequiredstring

Order type

Value in: "ORDER_TYPE_UNSPECIFIED" | "ORDER_TYPE_MARKET" | "ORDER_TYPE_LIMIT" | "ORDER_TYPE_STOP" | "ORDER_TYPE_STOP_LIMIT" | "ORDER_TYPE_TRAILING_STOP"
time_in_forceRequiredstring

Time in force

Value in: "TIF_UNSPECIFIED" | "TIF_GTC" | "TIF_DAY" | "TIF_IOC" | "TIF_FOK" | "TIF_GTD"
volumeRequirednumber

Trading volume in lots

Minimum: 0.01Format: "double"
pricenumber

Seen bid/ask price for market orders

Format: "double"
stop_loss_pointsinteger

Stop loss distance in points for market orders

Minimum: 0Format: "int64"
take_profit_pointsinteger

Take profit distance in points for market orders

Minimum: 0Format: "int64"
limit_pricenumber

Limit price for limit orders

Format: "double"
stop_pricenumber

Stop price for stop orders

Format: "double"
stop_loss_pricenumber

Stop loss price for limit/stop orders

Format: "double"
take_profit_pricenumber

Take profit price for limit/stop orders

Format: "double"
expire_timestring

Order expiration time

Format: "date-time"
good_till_datestring

Expiry datetime for GTD (Good Till Date) orders (ISO 8601 / RFC 3339). Required when time_in_force is TIF_GTD; ignored for all other time_in_force values.

Format: "date-time"

Path Parameters

account_idRequiredstring

The account ID where order to create belongs

curl -X POST "http://localhost:8081/api/v1/accounts/<string>/orders" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "client_order_id": "client_123",
    "symbol_id": "EURUSD",
    "side": "TRADE_SIDE_BUY",
    "type": "ORDER_TYPE_LIMIT",
    "time_in_force": "TIF_GTC",
    "volume": 1,
    "price": 1.08525,
    "stop_loss_points": 50,
    "take_profit_points": 100,
    "limit_price": 1.085,
    "stop_price": 1.084,
    "stop_loss_price": 1.083,
    "take_profit_price": 1.087,
    "expire_time": "2025-01-02T12:00:00Z",
    "good_till_date": "2025-01-02T12:00:00Z"
  }'

Order created successfully

{
  "order_id": "ord_123456"
}