Orders

The orders API contains private endpoints for querying historical and working orders. Both require a base64-encoded SHA256 HMAC signature as defined in Authentication.

Querying Order State

HTTP MethodEndpoint
GET/orders

GET /orders queries order history and supports the following query parameters:

ParameterOptionalityNotes
symboloptionalFilter orders by product symbol
product_idoptionalFilter orders by product ID
product_typeoptionalFilter orders by product type
clearing_member_codeoptionalFilter orders by FCM short name
account_idoptionalFilter orders by account code
connection_idoptionalFilter orders by connection ID
dayoptionalGet range for day, overrides begin_time and end_time
limitoptionalLimit number of orders per page
begin_timeoptionalBegin time for order time range, see Time for more details
end_timeoptionalEnd time for order time range, see Time for more details
orderoptionalPage order, either asc or desc
cursoroptionalCursor string returned by a historical orders query

Working Orders

HTTP MethodEndpoint
GET/orders/working

GET /orders/working returns authorized resting orders, including orders opened before today and partially filled orders that remain on the book. It uses the same account authorization and order response fields as /orders.

The endpoint supports the following query parameters:

ParameterOptionalityNotes
symboloptionalFilter orders by product symbol
product_idoptionalFilter orders by product ID
product_typeoptionalFilter orders by product type
clearing_member_codeoptionalFilter orders by FCM short name
account_idoptionalFilter orders by account code
connection_idoptionalFilter orders by connection ID

The response is a JSON array ordered by order time and exchange order ID, both descending. Each request reads the current order book. The endpoint does not support pagination or the day, begin_time, and end_time parameters.

Up to 10,000 matching orders are returned. If more than 10,000 orders match, the request fails with HTTP 400 and the message More than 10000 working orders match; narrow the request by account or product. Use account or product filters to narrow the request. Results are never truncated.

Price and quantities come from the live order book. Newly accepted orders may be briefly omitted until their order metadata has persisted. Average price and last-modified time come from persisted events and may lag the live book.

Response

GET /orders returns Pagination<Order, CursorInfo>; see Pagination. GET /orders/working returns Order[], with [] when no orders match. Order is defined as follows:

export interface Order {
  symbol: string;
  time: string;
  last_modified: string;
  product_id: number;
  product_type: ProductType;
  id: string;
  connection_id: string;
  clearing_firm_code: string;
  account_id: string;
  open_ack_id: string;
  side: Side;
  price: number;
  avg_price: number | null;
  quantity_requested: number;
  quantity_filled: number;
  status: OrderStatus;
  time_in_force: TimeInForce;
}

export type ProductType = "Future" | "Spread" | "Option";

export type Side = 'Bid' | 'Ask';

export type OrderStatus = 'Working' | 'Closed';

export type TimeInForce = 'IOC' | 'Day' | 'GTC';

Start Trading

Leveraged spot, perpetuals, futures, options, and prediction markets, all on one CFTC-regulated exchange with crypto margin and settlement.