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.
| Value | Description |
|---|---|
MARKET | Execute immediately at the best available price |
LIMIT | Execute at the specified price or better |
STOP | Trigger a market order when price reaches stop_price |
STOP_LIMIT | Trigger a limit order when price reaches stop_price |
TRAILING_STOP | Stop price trails the market by a fixed distance |
OrderStatus
The current state of an order in its lifecycle.
| Value | Description |
|---|---|
PENDING | Order submitted but not yet acknowledged by provider |
OPEN | Order is active and waiting to be filled |
PARTIALLY_FILLED | Some quantity has been filled, remainder is still open |
FILLED | Order completely filled |
CANCELLED | Order cancelled (by user or system) |
REJECTED | Order rejected by provider (see reject_reason) |
EXPIRED | Order expired based on time_in_force |
Side
The direction of the order.
| Value | Description |
|---|---|
BUY | Purchase the asset (go long) |
SELL | Sell the asset (go short or close long) |
TimeInForce
How long the order remains active before expiring.
| Value | Description |
|---|---|
GTC | Good Till Cancelled - remains active until filled or cancelled |
DAY | Expires at end of trading day |
IOC | Immediate Or Cancel - fill immediately or cancel unfilled portion |
FOK | Fill Or Kill - fill entire quantity immediately or cancel completely |
OrderRequest Schema
Submit a new order using the POST /orders endpoint.
Required Fields
| Field | Type | Description |
|---|---|---|
symbol | string | Symbol in canonical format (e.g., "AAPL", "EUR/USD", "BTC/USD") |
side | Side | BUY or SELL |
quantity | string | Order quantity in base units (decimal string) |
order_type | OrderType | Type of order |
Optional Fields
| Field | Type | Description |
|---|---|---|
limit_price | string | Required for LIMIT and STOP_LIMIT orders |
stop_price | string | Required for STOP and STOP_LIMIT orders |
time_in_force | TimeInForce | Default: GTC |
client_order_id | string | Your unique ID for idempotency and tracking |
stop_loss | string | Stop loss price for bracket orders |
take_profit | string | Take profit price for bracket orders |
trailing_distance | string | Distance for TRAILING_STOP orders |
trailing_type | string | ABSOLUTE or PERCENT |
reduce_only | boolean | Only reduce existing position, never increase |
post_only | boolean | Reject if order would immediately fill (maker only) |
hidden | boolean | Hide order from order book |
oco_group_id | string | Link 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
| Field | Type | Description |
|---|---|---|
id | string | Server-assigned order ID |
symbol | string | Trading symbol |
side | Side | Order side |
order_type | OrderType | Order type |
quantity | string | Original order quantity |
filled_quantity | string | Quantity filled so far |
remaining_quantity | string | Quantity remaining to fill |
average_fill_price | string? | Weighted average fill price (null if unfilled) |
status | OrderStatus | Current order status |
time_in_force | TimeInForce | Time in force |
limit_price | string? | Limit price (for LIMIT orders) |
stop_price | string? | Stop price (for STOP orders) |
stop_loss | string? | Stop loss price |
take_profit | string? | Take profit price |
client_order_id | string? | Client-provided order ID |
reject_reason | string? | Rejection reason if status is REJECTED |
created_at | datetime | When the order was created |
updated_at | datetime | When 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
- Position Types - Track your holdings
- Event Types - Handle order update events