Requires authentication.
Methods
| Method | Endpoint | Description |
|---|---|---|
create(params) | POST /v1/orders | Create a new order |
list(params?) | GET /v1/orders/open | Get open orders |
retrieve(order_id) | GET /v1/order/{orderId} | Get order by ID |
cancel(order_id, params) | POST /v1/order/{orderId}/cancel | Cancel an order |
modify(order_id, params) | POST /v1/order/{orderId}/modify | Modify an order |
cancel_all(params?) | POST /v1/orders/open/cancel | Cancel all open orders |
preview(params) | POST /v1/order/preview | Preview order before submission |
close_position(params) | POST /v1/order/close-position | Close an existing position |
create
Create a new order on a market.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
marketSlug | str | Yes | Market to trade |
intent | str | Yes | Order intent (see below) |
type | str | Yes | ORDER_TYPE_LIMIT or ORDER_TYPE_MARKET |
price | Amount | Limit only | Limit price |
quantity | int | Yes | Number of contracts |
tif | str | Yes | Time in force (see below) |
Order Intent
| Value | Description |
|---|---|
ORDER_INTENT_BUY_LONG | Buy YES shares |
ORDER_INTENT_SELL_LONG | Sell YES shares |
ORDER_INTENT_BUY_SHORT | Buy NO shares |
ORDER_INTENT_SELL_SHORT | Sell NO shares |
Time in Force
| Value | Description |
|---|---|
TIME_IN_FORCE_GOOD_TILL_CANCEL | Remains active until filled or canceled |
TIME_IN_FORCE_GOOD_TILL_DATE | Expires at specified time |
TIME_IN_FORCE_IMMEDIATE_OR_CANCEL | Fill immediately available quantity, cancel rest |
TIME_IN_FORCE_FILL_OR_KILL | Fill entirely or cancel completely |
list
Get all open orders.cancel
Cancel a specific order.cancel_all
Cancel all open orders, optionally filtered by market.preview
Preview an order before submitting. Returns estimated fills and costs.close_position
Close an existing position at market price.Slippage Tolerance
For market orders and close position, you can specify slippage tolerance:Order States
Orders progress through these states:| State | Description |
|---|---|
ORDER_STATE_PENDING_NEW | Received, not yet processed |
ORDER_STATE_PARTIALLY_FILLED | Partially executed |
ORDER_STATE_FILLED | Fully executed |
ORDER_STATE_CANCELED | Canceled |
ORDER_STATE_REJECTED | Rejected by exchange |
ORDER_STATE_EXPIRED | Expired (GTD orders) |