Skip to main content
After submitting an order, use authenticated account reads to check its current state, reconcile open orders and resulting trades, and cancel liquidity you no longer want resting on the book.

Fetch an Order

Look up a single order by its ID. Use this to check the current status of an order you already know about, rather than scanning the full list of open orders.
Call fetchOrder() on a SecureClient to fetch an order by ID:
The method returns an OpenOrder with normalized token, decimal, and date values:
expiresAt is present when the response includes an expiration; otherwise, the field is omitted.
See Order Statuses to interpret the returned status.

List Open Orders

Retrieve every resting order on the account, optionally narrowed to one token, one market, or a specific order ID. Use this to reconcile local state with what’s actually live on the book.
Call listOpenOrders() on a SecureClient to iterate over the account’s open orders:
Pass a filter to narrow the results. Despite its name, market takes the market’s condition ID:
Each page contains OpenOrder items:
See Order Statuses to interpret each order’s status.

List Account Trades

Retrieve executed fills for the account, as opposed to orders that are still resting on the book. Use this to reconstruct fill history, compute realized position size, or audit what actually matched.
Call listAccountTrades() on a SecureClient to iterate over the account’s trades:
Pass a filter to narrow the results. Despite its name, market takes the market’s condition ID:
Each page contains ClobTrade items:
See Trade Statuses to follow each trade’s status through settlement.

List Builder Trades

Retrieve matched trades attributed to a builder code across the accounts your application serves. Use this instead of an account trade read when you need to reconcile fills or measure activity for the builder integration as a whole. Orders do not appear here until they match.
Call listBuilderTrades() on a PublicClient or SecureClient to iterate over trades attributed to your builder code:
Pass a filter to narrow the results:
Each page contains BuilderTrade items:
See Builder Programs to learn how attribution works.

Cancel Orders

Cancel only as broadly as needed. Start with known order IDs, use a market or token filter when withdrawing a set of quotes, and reserve account-wide cancellation for exceptional situations. Cancellation remains available while the exchange is in cancel-only mode, when new orders are rejected. For a partially filled order, cancellation removes only its unfilled remainder.

Cancel Orders by ID

Cancel one order when you know its ID. To cancel a known set of orders in one request, submit a batch of up to 3,000 IDs. Duplicate IDs in the batch are ignored.
Call cancelOrder() on a SecureClient to cancel one order:
Call cancelOrders() to cancel several known orders in one request:

Cancel Market Orders

Cancel by token to withdraw orders for one outcome, or by market to withdraw orders for every outcome in the condition. At least one filter is required.
Call cancelMarketOrders() on a SecureClient with a token ID or condition ID:
The market field takes the market’s condition ID.

Cancel All Orders

Use account-wide cancellation when you need to remove every resting order, such as during an emergency shutdown.
This action cancels every open order associated with the authenticated CLOB API credentials.
Call cancelAll() on a SecureClient:

Cancellation Results

A cancellation can succeed for only some of the requested orders. Reconcile the result before retrying: it identifies the orders that were canceled and gives a reason for each order that could not be canceled.
The TypeScript SDK returns a CancelOrdersResponse:
Type
In this example, one order was canceled and another could not be canceled because it had already matched:
Example

Order Heartbeats

Use order heartbeats to cancel resting orders automatically if your trading process stops responding. Once the first heartbeat is accepted, the CLOB expects the account to keep sending them; if a valid heartbeat is not received within 10 seconds, all open orders owned by those CLOB API credentials are canceled. The cancellation check runs every five seconds, so cancellation may occur up to five seconds after the timeout.
Send a heartbeat every 5 seconds.
1

Start the Heartbeat

Send an empty heartbeat_id to POST /v1/heartbeats. Authenticate the request with the same CLOB API credentials that own the orders you want to protect:
Using the signer address and CLOB API credentials from API Authentication, create a fresh <clob_request_timestamp> and generate <clob_l2_signature> from the exact serialized body sent over the wire:
Save the ID returned in the response:
2

Continue the Heartbeat

After five seconds, send the latest heartbeat_id back to the same route. Each successful response returns a new ID to use for the following heartbeat:
Create a fresh <clob_request_timestamp> and <clob_l2_signature> for this request, replacing body in the signing calculation above with the exact serialized body containing the latest ID.If the ID is invalid or expired, the CLOB responds with 400 Bad Request and supplies the expected ID. Sign a new request with that ID and retry:

Check Closed-Only Mode

Closed-only mode is an account-level circuit breaker for a market. When it’s on, the account can only place orders that reduce an existing position, not new opening orders. Check this before placing an order if you want to fail fast instead of waiting for a rejection.
Call fetchClosedOnlyMode() on a SecureClient:
The method returns the account’s closed-only state as a boolean:

Check Order Scoring

An order scores when it is live on a market with liquidity rewards and meets the market’s minimum qualifying size, maximum qualifying spread, and required live duration. Because eligibility changes as the order book moves, treat the result as a point-in-time check.
Call fetchOrderScoring() on a SecureClient with the order ID:
To check the scoring status of several orders in one request, call fetchOrdersScoring() with their IDs:
The response maps each order ID to its scoring status: