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

# Order status codes in MIOeSIM

> Reference for the integer status codes returned in the status field of MIOeSIM order responses — what each code means and how orders move between states.

Every order response from the MIOeSIM API includes a `status` field containing an integer code that reflects the current state of that order. You will encounter this field in responses from `getOrder`, `queryOrder`, `queryEsimOrder`, and any other endpoint that returns order objects. Use the code to determine what actions are available on the order and what to display to your customers.

## Status codes

| Code | Name                           | Description                                                                                               |
| ---- | ------------------------------ | --------------------------------------------------------------------------------------------------------- |
| `-1` | Not paid                       | The order has been created but payment has not been confirmed. Cards are not yet allocated.               |
| `0`  | Paid / normal                  | The order is paid and active. Cards are allocated and activation details are available.                   |
| `2`  | Cancelled                      | The order was fully cancelled. A refund may have been issued depending on the plan's cancellation policy. |
| `3`  | Invalid / obsolete             | The order is void and no longer valid. No further actions can be taken on it.                             |
| `4`  | Partial refund                 | Some cards in the order were cancelled while others remain active.                                        |
| `5`  | Ended                          | All plans in the order have expired or been fully consumed.                                               |
| `6`  | Unsubscribing                  | A full cancellation request has been submitted and is currently being processed.                          |
| `7`  | Partial unsubscribe in process | A partial cancellation is being processed for some cards in the order.                                    |

## Status transitions

Orders follow a typical path from creation through to expiry:

1. **Created** — an order is placed and enters status `-1` (not paid) until payment is confirmed.
2. **Active** — once payment is confirmed, the order moves to status `0` (paid / normal). Activation codes and QR codes are now available.
3. **Ended** — when all plans in the order expire or data is fully consumed, the order moves to status `5`.

Orders that are cancelled before or during use move to status `2` (fully cancelled) or `4` (partial refund, when only some cards were cancelled). When a cancellation is submitted and is being processed, the order shows status `6` or `7` until the operation completes.

<Note>
  Orders in status `6` (unsubscribing) or `7` (partial unsubscribe in process) are locked while the cancellation is being processed. Do not attempt to renew, cancel, or otherwise modify the order until it settles into a terminal status.
</Note>
