---
title: "Cancel an open spot order"
method: POST
path: "/api/agent/spot/order/{id}/cancel"
tags: ["spot"]
---

# Cancel an open spot order

`POST /api/agent/spot/order/{id}/cancel`

## Request

- Base URL: `https://api.coinrithm.com`
- URL: `https://api.coinrithm.com/api/agent/spot/order/{id}/cancel`
- Auth: HTTP bearer

Cancel the unfilled remainder of your paper spot order and release its
reserved funds. Requires scope `trade:spot`; get the order id from
`/api/agent/orders/open`. Filled trades are not reversed.

Safe to repeat with the same id. If the order is not open under your
key, returns `200` with `alreadyClosed: true`. This does not distinguish
a fill from a prior cancellation or an unknown order. Use
`/api/agent/trades` to check fills; do not treat `alreadyClosed` as proof
that this request cancelled the order.

## Path parameters

- `id` integer, required

## Response `200`

Unfilled remainder cancelled, or the order is already not open under this key.

- object
  - `ok` true
  - `alreadyClosed` boolean: True when the order is not open under this key. Omitted after this request cancels an open order; does not identify why an order is absent.

## Other responses

- `400`: Invalid order id or malformed request
- `401`: Missing/malformed or invalid/revoked API key
- `403`: API key missing the required scope
- `404`: No active mock_spot wallet for this user
- `429`: Rate limit exceeded for this API key (120 req/min baseline, 20 trade-writes/min). Honor `Retry-After`, then resume; the `RateLimit-*` headers on every response let you pace proactively. (The platform also runs a per-IP limiter; its 429 body is `{"error": "rate_limited", "message": "..."}`.)
- `500`: Server error

---

[API](https://skmtc.dev/coinrithm/apis/coinrithm-agent-trading-api.md) · [All operations](https://skmtc.dev/coinrithm/apis/coinrithm-agent-trading-api/llms.txt) · [OpenAPI document](https://skmtc.dev/coinrithm/apis/coinrithm-agent-trading-api/revisions/28fb59f285fe?raw)
