Skip to main content
Three endpoints close orders. The first two take order IDs. close_all/ closes everything, or only the orders on one sport or one event. Closing an order cancels its unmatched remainder. Anything already matched stays matched: a fill cannot be undone. To exit a matched position, place an order on the opposite side of the same selection. The app calls this Trade out: see Closing a position.

Always look first

Close one

Closing an already-closed order returns 400 order_closed, which is distinct from 404 not_found. close_many/ does not return these errors. It answers 200 with closed and not_found lists instead.

Close a specific set

Close everything

close_all with no body closes every open order on the account, across every key and every strategy. Send sport, or sport and event_id, to narrow it. For any other selection, list the orders and use close_many/.

In the CLI

Heartbeats close too

If a heartbeat expires, the server closes every open order on the account, including orders placed through other keys and sessions. See Safety.