Cancel spot order
cancel_spot_orderCancel a paper spot order's unfilled remainder and free reserved funds using its orderId. Safe to retry; use get_my_trades to confirm fills.
Instructions
Cancel the unfilled remainder of your paper spot order and release its reserved funds. Requires trade:spot scope; get orderId from list_open_orders. Does not reverse filled trades. Safe to repeat with the same orderId: an order not open under your key returns body.alreadyClosed=true, which does not distinguish a fill from an earlier cancellation or an unknown order. Use get_my_trades to check fills. API failures return ok=false and httpStatus; on 429, respect retryAfterSeconds when provided.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderId | Yes | Your paper spot order id from list_open_orders. | |
| agentTrace | No | Optional private trace metadata stored in the caller's ledger. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | True when CoinRithm returned a successful 2xx response. | |
| body | No | Parsed CoinRithm response body, or raw text when the response is not JSON. | |
| httpStatus | Yes | HTTP status returned by CoinRithm, or 0 for network errors. | |
| ledgerStatus | No | Ledger write status header returned by CoinRithm, when present. | |
| ledgerEventId | No | Private AgentActionEvent id returned by /api/agent/*, when present. |