> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apexiumbet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancellation - Outcomes of cancelling an order

> What cancelling an Apexium order does to each of its bets and to its expiry remainder, how to read the outcome, and how to cancel many orders at once.

Cancelling stops what is still working on an order. It cannot undo what a bookmaker already accepted.

## Cancelling one order

```bash theme={null}
curl -X POST https://api.apexiumbet.com/v1/orders/4f0c2b1e-8d4a-4f7e-9a51-2c1f0b7e9d10/cancel \
  -H "x-api-key: apx_live_…"
```

The answer is the order after cancellation, with two more fields that tell you what happened.

### The remainder

`remainder` is about the unfilled stake that an order with `expiresAt` keeps working:

| `remainder` | Meaning |
| - | - |
| `cancelled` | The remainder was being worked and is now stopped |
| `alreadyTerminal` | The remainder had already ended: filled, expired or cancelled |
| `none` | The order has no expiry, so there is no remainder |

### Each bet

Each bet carries a `cancellation`:

| `cancellation` | Meaning |
| - | - |
| `cancelled` | The bet was cancelled before the bookmaker accepted it |
| `alreadyTerminal` | The bet had already ended: rejected or settled |
| `notRecallable` | The bookmaker accepted the bet; it stands and will settle |

`filledStake` after cancellation is what you keep at risk.

### Cancelling again

Cancelling is safe to repeat. Cancelling an order that is already final returns the same outcomes again, and changes nothing.

`409 ORDER_BUSY` means the order is being worked on at that moment, for example by its expiry remainder. Retry after a short delay.

## Cancelling many orders

`POST /v1/orders/cancel-all` cancels orders in one of three scopes:

| Body | Scope |
| - | - |
| `{}` | Every working order (`PENDING`, `PARTIALLY_FILLED`) of the account |
| `{ "fixtureId": "id1000001761300868" }` | The working orders on one fixture |
| `{ "orderIds": ["…", "…"] }` | The listed orders, at most 200, whatever their status. A final order comes back with its outcomes, unchanged. |

The answer has four lists:

| Field | Meaning |
| - | - |
| `orders` | The cancelled orders, each with `remainder` and per-bet `cancellation` as above |
| `notFound` | Listed ids that match no order of the account (or not on `fixtureId` when you gave one) |
| `busy` | Orders that were being worked on; cancel them again shortly |
| `nextCursor` | Not `null` when there are more than 200 orders: call again with `{ "cursor": "…" }`, and the same `fixtureId` if you gave one |

```bash theme={null}
curl -X POST https://api.apexiumbet.com/v1/orders/cancel-all \
  -H "x-api-key: apx_live_…" \
  -H "content-type: application/json" \
  -d '{ "fixtureId": "id1000001761300868" }'
```

`cursor` cannot be combined with `orderIds`. Cancellations count against the order budget of your key; see [Limits](https://docs.apexiumbet.com/api-reference/limits.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.