Orders API
The Orders API provides order entry and management capabilities for trading on markets.Base URL
Endpoints
Order Entry
| Method | Endpoint | Description |
|---|---|---|
POST | /v1/orders | Create a new order |
POST | /v1/order/preview | Preview order before submission |
POST | /v1/order/close-position | Close an existing position |
Order Query
| Method | Endpoint | Description |
|---|---|---|
GET | /v1/orders/open | Get all open orders |
GET | /v1/order/{orderId} | Get a specific order by ID |
Order Management
| Method | Endpoint | Description |
|---|---|---|
POST | /v1/order/{orderId}/modify | Modify an existing order |
POST | /v1/order/{orderId}/cancel | Cancel a specific order |
POST | /v1/orders/open/cancel | Cancel all open orders |
Order Types
All enum values are passed as strings in the request body:| Value | Description |
|---|---|
ORDER_TYPE_LIMIT | Limit order at specified price |
ORDER_TYPE_MARKET | Market order executed at best available price |
Order Intent
Orders require an intent indicating position direction. Pass these as string values:| Value | Description |
|---|---|
ORDER_INTENT_BUY_LONG | Buy YES shares (go long on Yes outcome) |
ORDER_INTENT_SELL_LONG | Sell YES shares (close long Yes position) |
ORDER_INTENT_BUY_SHORT | Buy NO shares (go long on No outcome) |
ORDER_INTENT_SELL_SHORT | Sell NO shares (close long No position) |
Order Side
The order side indicates buy or sell direction:| Value | Description |
|---|---|
ORDER_SIDE_BUY | Buy order |
ORDER_SIDE_SELL | Sell order |
Order States
Orders progress through these states:| Value | Description |
|---|---|
ORDER_STATE_PENDING_NEW | Order received, not yet processed by matching engine |
ORDER_STATE_PENDING_REPLACE | Modify request received, not yet processed |
ORDER_STATE_PENDING_CANCEL | Cancel request received, not yet processed |
ORDER_STATE_PENDING_RISK | Order pending risk approval |
ORDER_STATE_PARTIALLY_FILLED | Order partially executed |
ORDER_STATE_FILLED | Order fully executed |
ORDER_STATE_CANCELED | Order canceled |
ORDER_STATE_REPLACED | Order replaced via modify |
ORDER_STATE_REJECTED | Order rejected by exchange |
ORDER_STATE_EXPIRED | Order expired (GTD orders) |
Time in Force
| Value | Description |
|---|---|
TIME_IN_FORCE_GOOD_TILL_CANCEL | GTC - Remains active until filled or canceled |
TIME_IN_FORCE_GOOD_TILL_DATE | GTD - Expires at specified goodTillTime |
TIME_IN_FORCE_IMMEDIATE_OR_CANCEL | IOC - Fills immediately available quantity, cancels rest |
TIME_IN_FORCE_FILL_OR_KILL | FOK - Must fill entirely or cancel completely |
Manual Order Indicator
Required to indicate whether the order is placed by a human or automated system:| Value | Description |
|---|---|
MANUAL_ORDER_INDICATOR_MANUAL | Order placed manually by a user |
MANUAL_ORDER_INDICATOR_AUTOMATIC | Order placed by an automated trading system |
Execution Types
Execution events returned in synchronous order responses:| Value | Description |
|---|---|
EXECUTION_TYPE_PARTIAL_FILL | Order partially filled |
EXECUTION_TYPE_FILL | Order fully filled |
EXECUTION_TYPE_CANCELED | Order canceled |
EXECUTION_TYPE_REPLACE | Order replaced/modified |
EXECUTION_TYPE_REJECTED | Order rejected |
EXECUTION_TYPE_EXPIRED | Order expired |
EXECUTION_TYPE_DONE_FOR_DAY | Order done for the trading day |
Order Reject Reasons
If an order is rejected, the reason will be one of:| Value | Description |
|---|---|
ORD_REJECT_REASON_UNKNOWN_MARKET | Unknown or invalid market |
ORD_REJECT_REASON_EXCHANGE_CLOSED | Exchange/market is closed |
ORD_REJECT_REASON_INCORRECT_QUANTITY | Invalid quantity |
ORD_REJECT_REASON_INVALID_PRICE_INCREMENT | Price not on valid increment |
ORD_REJECT_REASON_INCORRECT_ORDER_TYPE | Invalid order type for market |
ORD_REJECT_REASON_PRICE_OUT_OF_BOUNDS | Price outside valid range |
ORD_REJECT_REASON_NO_LIQUIDITY | No liquidity for market order |
Slippage Tolerance
For market orders or close position orders, you can specify slippage tolerance:| Field | Type | Description |
|---|---|---|
currentPrice | Amount | Reference price for slippage calculation |
bips | integer | Slippage tolerance in basis points (1 bip = 0.01%) |
ticks | integer | Slippage tolerance in price ticks (takes priority over bips) |
Complete Create Order Example
Best Practices
- Use string enum values - All enums are passed as strings (e.g.,
"ORDER_TYPE_LIMIT", not1) - Use WebSocket for updates - Subscribe to order updates instead of polling
- Preview before submit - Use the preview endpoint for order validation
- Handle rejects - Implement proper error handling for rejected orders
- Use synchronous execution - Set
synchronousExecution: trueto wait for order acknowledgment - Specify manual order indicator - Required for regulatory compliance