Order Types

This reference documents all order-related types in the Trading API, including order types, statuses, and the schemas for submitting and receiving orders.

Enums

OrderType

The type of order determines how and when it executes.

ValueDescription
MARKETExecute immediately at the best available price
LIMITExecute at the specified price or better
STOPTrigger a market order when price reaches stop_price
STOP_LIMITTrigger a limit order when price reaches stop_price
TRAILING_STOPStop price trails the market by a fixed distance

OrderStatus

The current state of an order in its lifecycle.

ValueDescription
PENDINGOrder submitted but not yet acknowledged by provider
PENDING_CANCELCancel request submitted but not yet confirmed by provider
OPENOrder is active and waiting to be filled
PARTIALLY_FILLEDSome quantity has been filled, remainder is still open
FILLEDOrder completely filled
CANCELLEDOrder cancelled (by user or system)
REJECTEDOrder rejected by provider (see reject_reason)
EXPIREDOrder expired based on time_in_force

Side

The direction of the order.

ValueDescription
BUYPurchase the asset (go long)
SELLSell the asset (go short or close long)

TimeInForce

How long the order remains active before expiring.

ValueDescription
GTCGood Till Cancelled - remains active until filled or cancelled
DAYExpires at end of trading day
IOCImmediate Or Cancel - fill immediately or cancel unfilled portion
FOKFill Or Kill - fill entire quantity immediately or cancel completely

RejectReason

Returned on Order.reject_reason when status == REJECTED.

ValueDescription
INSUFFICIENT_MARGINAccount has insufficient margin to open the position
INSUFFICIENT_BALANCEAccount has insufficient free balance for the order
INVALID_QUANTITYQuantity is zero, negative, or below the broker's minimum
INVALID_PRICEPrice is malformed or outside the broker's accepted range
SYMBOL_NOT_TRADEABLESymbol is not tradeable on this broker or account
MARKET_CLOSEDMarket is closed for this symbol
REDUCE_ONLY_VIOLATEDOrder would increase (not reduce) an existing position
POST_ONLY_VIOLATEDPost-only order would have matched an existing order immediately
RATE_LIMITEDBroker rejected the order for exceeding rate limits
UNKNOWNBroker-specific rejection that does not map to a typed reason

MarginMode

Margin mode for leveraged trading. Used in OrderRequest.margin_mode and Position.margin_mode.

ValueDescription
CROSSPosition shares margin with the rest of the account
ISOLATEDPosition has dedicated margin; losses are capped at the isolated allocation

TrailingType

How trailing_distance is interpreted on TRAILING_STOP orders.

ValueDescription
ABSOLUTEDistance is an absolute price offset (e.g., "0.25" USD)
PERCENTDistance is a percentage of the reference price (e.g., "1.5" for 1.5%)

OrderRequest Schema

Submit a new order using the POST /v1/orders endpoint.

Required Fields

FieldTypeDescription
symbolstringSymbol in canonical format (e.g., "AAPL", "EUR/USD", "BTC/USD")
sideSideBUY or SELL
quantitystringOrder quantity in base units (decimal string)
order_typeOrderTypeType of order

Optional Fields

FieldTypeDescription
limit_pricestringRequired for LIMIT and STOP_LIMIT orders
stop_pricestringRequired for STOP and STOP_LIMIT orders
time_in_forceTimeInForceDefault: GTC
client_order_idstringYour unique ID for idempotency and tracking
stop_lossstringStop loss price for bracket orders
take_profitstringTake profit price for bracket orders
trailing_distancestringDistance for TRAILING_STOP orders
trailing_typeTrailingTypeInterpretation of trailing_distanceABSOLUTE or PERCENT
reduce_onlybooleanOnly reduce existing position, never increase
post_onlybooleanReject if order would immediately fill (maker only)
hiddenbooleanHide order from order book
display_quantitystringVisible quantity for iceberg orders (remainder is hidden)
oco_group_idstringLink orders as one-cancels-other
position_idstringTarget position ID on hedging accounts
leveragestringLeverage multiplier (decimal string, e.g., "5")
margin_modeMarginModeMargin mode for leveraged positions — CROSS or ISOLATED

Examples

Market Order

{
  "symbol": "AAPL",
  "side": "BUY",
  "quantity": "100",
  "order_type": "MARKET"
}

Limit Order with Stop Loss

{
  "symbol": "EUR/USD",
  "side": "BUY",
  "quantity": "10000",
  "order_type": "LIMIT",
  "limit_price": "1.0850",
  "time_in_force": "GTC",
  "stop_loss": "1.0800",
  "take_profit": "1.0950"
}

Stop Limit Order

{
  "symbol": "BTC/USD",
  "side": "SELL",
  "quantity": "0.5",
  "order_type": "STOP_LIMIT",
  "stop_price": "40000",
  "limit_price": "39950",
  "reduce_only": true
}

Order Response Schema

Orders returned from GET /v1/orders or via WebSocket events.

Fields

FieldTypeDescription
idstringServer-assigned order ID
symbolstringTrading symbol
sideSideOrder side
order_typeOrderTypeOrder type
quantitystringOriginal order quantity
filled_quantitystringQuantity filled so far
remaining_quantitystringQuantity remaining to fill
average_fill_pricestring?Weighted average fill price (null if unfilled)
statusOrderStatusCurrent order status
time_in_forceTimeInForceTime in force
limit_pricestring?Limit price (for LIMIT orders)
stop_pricestring?Stop price (for STOP orders)
stop_lossstring?Stop loss price
take_profitstring?Take profit price
client_order_idstring?Client-provided order ID
correlation_idstring?Gateway-assigned correlation ID for tracing the order through its lifecycle
reject_reasonRejectReason?Rejection reason if status is REJECTED
trailing_distancestring?Trailing distance for TRAILING_STOP orders
trailing_typeTrailingType?Interpretation of trailing_distanceABSOLUTE or PERCENT
display_quantitystring?Visible quantity for iceberg orders
oco_group_idstring?OCO group ID if this order is part of a one-cancels-other pair
position_idstring?Associated position ID on hedging accounts
reduce_onlyboolean?Whether this is a reduce-only order
post_onlyboolean?Whether this is a post-only (maker-only) order
hiddenboolean?Whether this is a hidden order
created_atdatetimeWhen the order was created
updated_atdatetimeWhen the order was last updated

Example Response

{
  "id": "ord_abc123",
  "symbol": "AAPL",
  "side": "BUY",
  "order_type": "LIMIT",
  "quantity": "100",
  "filled_quantity": "60",
  "remaining_quantity": "40",
  "average_fill_price": "150.25",
  "status": "PARTIALLY_FILLED",
  "time_in_force": "GTC",
  "limit_price": "150.50",
  "client_order_id": "my-order-001",
  "created_at": "2025-01-15T10:30:00Z",
  "updated_at": "2025-01-15T10:30:05Z"
}

Related Types