Order API
The Order API provides endpoints for managing orders, including placing, updating, canceling, and previewing orders.
View API ChangelogAuthentication Required
All endpoints require authentication. Use your API key in the X-API-Key
header.
Place Order
Place a new order.
POST/v1/orders
{
"account": "string",
"symbol": "string",
"quantity": "integer",
"orderType": "string", // market, limit, stop, stop_limit
"tradeAction": "string", // buy, sell
"timeInForce": "string", // DAY, GTC, OPG, IOC, FOK, GTD, EXT
"route": "string", // smart
"limitPrice": "decimal", // Required for limit orders
"stopPrice": "decimal", // Required for stop orders
"legs": [
{
"symbol": "string",
"ratioQuantity": "decimal",
"tradeAction": "string", // buy, sell
"positionEffect": "string" // O (open), C (close)
}
]
}
Parameters:
account
: Account IDsymbol
: Trading symbolquantity
: Order quantity (must be > 0)orderType
: Order type (market, limit, stop, stop_limit)tradeAction
: Trade action (buy, sell)timeInForce
: Time in force (DAY, GTC, OPG, IOC, FOK, GTD, EXT)route
: Routing destination (smart)limitPrice
: Limit price (required for limit orders)stopPrice
: Stop price (required for stop orders)legs
: Array of legs for multi-leg orders (required for options)
Update Order
Update an existing order.
PUT/v1/orders
{
"orderId": 12345, // Required
"account": "string",
"symbol": "string",
"quantity": 5,
"orderType": "limit",
"tradeAction": "buy",
"timeInForce": "DAY",
"route": "smart",
"limitPrice": 152.50,
"stopPrice": null,
"legs": []
}
orderId in the request body is required for updates.
Cancel Order
Cancel an existing order.
DELETE/v1/orders
{
"orderId": 12345
}
Preview Order
Preview an order before placing it.
POST/v1/orders/preview
{
"account": "string",
"symbol": "string",
"quantity": 10,
"orderType": "limit",
"tradeAction": "buy",
"timeInForce": "DAY",
"route": "smart",
"limitPrice": 150.00
}
Error Responses
All endpoints may return the following error responses:
400 Bad Request
GET
{
"error": "string",
"message": "string"
}
401 Unauthorized
GET
{
"error": "string",
"message": "string"
}
500 Internal Server Error
GET
{
"error": "string",
"message": "string"
}
Important Notes
Key Considerations
- All endpoints require authentication via
X-API-Key
header. - Quantity must be greater than 0.
- Limit price and stop price must be non-negative.
- For options orders, the
legs
array is required. - Position effect in legs can be: "O" for open, "C" for close.
- Time in force values:
- DAY: Day order
- GTC: Good Till Cancel
- OPG: At the Opening
- IOC: Immediate or Cancel
- FOK: Fill or Kill
- GTD: Good Till Date
- EXT: Extended Hours
- Order types:
- market: Market order
- limit: Limit order
- stop: Stop order
- stop_limit: Stop Limit order