Skip to main content

Orders API

The Orders API provides order entry and management capabilities for trading on markets.

Endpoints

Order Entry

MethodEndpointDescription
POST/v1/ordersCreate a new order
POST/v1/order/previewPreview order before submission

Order Query

MethodEndpointDescription
GET/v1/orders/openGet all open orders
GET/v1/order/{orderId}Get a specific order by ID

Order Cancellation

MethodEndpointDescription
POST/v1/order/{orderId}/cancelCancel a specific order
POST/v1/orders/open/cancelCancel all open orders

Order Types

TypeDescription
ORDER_TYPE_LIMITLimit order at specified price
ORDER_TYPE_MARKETMarket order executed at best available price

Order Intent

Orders require an intent indicating position direction:
IntentDescription
ORDER_INTENT_BUY_LONGBuy to open or increase a long position
ORDER_INTENT_SELL_LONGSell to close or reduce a long position
ORDER_INTENT_BUY_SHORTBuy to close or reduce a short position
ORDER_INTENT_SELL_SHORTSell to open or increase a short position

Order States

Orders progress through these states:
PENDING_NEW → PARTIALLY_FILLED → FILLED

                CANCELED / REJECTED / EXPIRED
StateDescription
ORDER_STATE_PENDING_NEWOrder received, not yet processed
ORDER_STATE_PARTIALLY_FILLEDOrder partially executed
ORDER_STATE_FILLEDOrder fully executed
ORDER_STATE_CANCELEDOrder canceled by user
ORDER_STATE_REJECTEDOrder rejected by exchange
ORDER_STATE_EXPIREDOrder expired (GTD orders)

Time in Force

TIFDescription
TIME_IN_FORCE_GOOD_TILL_CANCELGood till canceled
TIME_IN_FORCE_GOOD_TILL_DATEGood till specified date
TIME_IN_FORCE_IMMEDIATE_OR_CANCELImmediate or cancel
TIME_IN_FORCE_FILL_OR_KILLFill completely or cancel
Real-Time Order UpdatesAfter submitting orders via REST, use the WebSocket Private Stream to receive real-time updates on order status, fills, and cancellations.

Best Practices

  1. Use WebSocket for updates - Subscribe to order updates instead of polling
  2. Preview before submit - Use the preview endpoint for order validation
  3. Handle rejects - Implement proper error handling for rejected orders
  4. Use synchronous execution - Set synchronousExecution: true to wait for order acknowledgment