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
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

OrderRequest Schema

Submit a new order using the POST /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_typestringABSOLUTE or PERCENT
reduce_onlybooleanOnly reduce existing position, never increase
post_onlybooleanReject if order would immediately fill (maker only)
hiddenbooleanHide order from order book
oco_group_idstringLink orders as one-cancels-other

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 /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
reject_reasonstring?Rejection reason if status is REJECTED
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