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.- TypeScript
- Python
- API
Call The method returns an
fetchOrder() on a SecureClient to fetch an order by ID:OpenOrder with normalized token, decimal, and date
values:expiresAt is present when the response includes an expiration; otherwise,
the field is omitted.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.- TypeScript
- Python
- API
Call Pass a filter to narrow the results. Despite its name, Each page contains
listOpenOrders() on a SecureClient to iterate over the account’s
open orders:market takes the
market’s condition ID:OpenOrder items: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.- TypeScript
- Python
- API
Call Pass a filter to narrow the results. Despite its name, Each page contains
listAccountTrades() on a SecureClient to iterate over the
account’s trades:market takes the
market’s condition ID:ClobTrade items: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.- TypeScript
- Python
- API
Call Pass a filter to narrow the results:Each page contains
listBuilderTrades() on a PublicClient or SecureClient to iterate over
trades attributed to your builder code:BuilderTrade items: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.- TypeScript
- Python
- API
Call Call
cancelOrder() on a SecureClient to cancel one order: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.- TypeScript
- Python
- API
Call The
cancelMarketOrders() on a SecureClient with a token ID or condition
ID: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.- TypeScript
- Python
- API
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.- TypeScript
- Python
- API
The TypeScript SDK returns a In this example, one order was canceled and another could not be canceled
because it had already matched:
CancelOrdersResponse:Type
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.- API
- TypeScript
- Python
Send a heartbeat every 5 seconds.
1
Start the Heartbeat
Send an empty Using the signer address and CLOB API credentials from API
Authentication, create a fresh
Save the ID returned in the response:
heartbeat_id to POST /v1/heartbeats. Authenticate the
request with the same CLOB API credentials that own the orders you want to
protect:<clob_request_timestamp> and generate <clob_l2_signature> from the exact
serialized body sent over the wire:2
Continue the Heartbeat
After five seconds, send the latest Create a fresh
heartbeat_id back to the same route.
Each successful response returns a new ID to use for the following
heartbeat:<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.- TypeScript
- Python
- API
Call The method returns the account’s closed-only state as a boolean:
fetchClosedOnlyMode() on a SecureClient: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.- TypeScript
- Python
- API
Call To check the scoring status of several orders in one request, call
The response maps each order ID to its scoring status:
fetchOrderScoring() on a SecureClient with the order ID:fetchOrdersScoring() with their IDs: