Order API

The Order API provides endpoints for managing orders, including placing, updating, canceling, and previewing orders.

View API Changelog

Authentication 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 ID
  • symbol: Trading symbol
  • quantity: 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