> ## 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.

# Order and bet life cycle - Statuses and versions

> The statuses an Apexium order and its bets go through, from placement to settlement, and how to detect changes with the version number.

An **order** is your instruction. Its **bets** are the parts of the stake placed at each bookmaker. The order's status is derived from its bets, so you can follow an order by reading it alone.

## Order statuses

| Status | Meaning | Final |
| - | - | - |
| `PENDING` | Sent to the bookmakers, nothing filled yet | No |
| `PARTIALLY_FILLED` | Part of the stake is filled, and some is still being worked | No |
| `FILLED` | The whole stake is filled, or what the order accepted to fill is | Yes |
| `EXPIRED` | `expiresAt` passed before the whole stake filled. `filledStake` shows what did. | Yes |
| `CANCELLED` | Cancelled before it completed, by you or by a bookmaker. `filledStake` shows what filled before. | Yes |
| `REJECTED` | Nothing filled: every bet was declined | Yes |

`PENDING` and `PARTIALLY_FILLED` are the **working** statuses: those orders can still change, and [cancellation](https://docs.apexiumbet.com/guides/cancellation.md) applies to them.

`FILLED` covers partial fills too. An immediate-or-cancel order (`acceptPartialStake: true`, no `expiresAt`) that filled 120 of 200 is `FILLED` with `filledStake` 120.00. Compare `filledStake` with `requestedStake` to know how much filled.

## Bet statuses

| Status | Meaning |
| - | - |
| `PENDING` | Sent to the bookmaker, no answer yet |
| `WAITING` | Received by the bookmaker, not confirmed yet, for example during an in-play delay |
| `PARTIALLY_PLACED` | Part of the bet's stake is accepted, for example on an exchange |
| `PLACED` | Accepted by the bookmaker |
| `REJECTED` | Declined by the bookmaker; `declineReason` says why |
| `CANCELLED` | Cancelled, or expired at the bookmaker, before it was accepted |
| `SETTLED` | Graded by the bookmaker; see `settlement` |

A placed bet then settles. Its `settlement.status` is `UNSETTLED` until then, and one of `WON`, `LOST`, `VOID`, `HALF_WON`, `HALF_LOST`, `PUSH`, `CASHOUT` after. `settlement.amount` is your profit or loss on the bet.

## Following changes

Every order has a `version` that goes up by one at each change of the order or of one of its bets. To follow an order, read it and compare `version` with the last one you saw; when it moved, something changed.

* **One order.** `GET /v1/orders/{id}` or `GET /v1/orders/by-client-id/{clientOrderId}`.
* **Working orders.** `GET /v1/orders?status=PENDING&status=PARTIALLY_FILLED`.
* **Settlements.** `GET /v1/bets?settledFrom=…` lists the bets settled since a time.

## Amounts on an order

| Field | Meaning |
| - | - |
| `requestedStake` | The stake you asked for |
| `filledStake` | The stake accepted by the bookmakers so far |
| `remainingStake` | The stake still being worked; `0.00` once the order is final |
| `averageFilledPrice` | The stake-weighted price of the filled bets, `null` while nothing filled |


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