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

# Order Status

> Canonical order status strings used across analytics and payments.

Orders store a single `status` string (Prisma: `String`, default `pending`). There is no separate `paymentStatus` column — the order status doubles as payment lifecycle.

## Common values

| Status       | Typical meaning                                                    |
| ------------ | ------------------------------------------------------------------ |
| `pending`    | Created / awaiting action                                          |
| `processing` | Draft checkout / in progress (checkout start uses this for drafts) |
| `unpaid`     | Explicit unpaid (e.g. some Stripe verify paths)                    |
| `paid`       | Payment settled; fulfillment may still be running                  |
| `completed`  | Paid and fulfilled (keys assigned or non-key delivery complete)    |
| `cancelled`  | Cancelled                                                          |
| `expired`    | Timed out                                                          |

Analytics groupings (`lib/domains/analytics/constants.ts`):

* **Revenue:** `paid`, `completed`
* **Pending:** `pending`, `processing`
* **Cancelled:** `cancelled`, `expired`
* **Fulfilled:** `completed`

`unpaid` appears in notification helpers but is not part of the analytics count keys — treat it as a real status if you see it on an order row.

## Transitions that matter to integrators

```text theme={null}
checkout/start or embed/checkout
  → processing (draft)
  → (buyer pays)
  → paid
  → completed   // when fulfillment succeeds
```

If license-key stock is empty, settlement may leave the order `paid` without `completed`. Checkout UI can call `try-assign-keys` after restock.

## Ticket status (unrelated)

Support tickets use their own `status` (`open` default) on the `Ticket` model. Do not confuse ticket status with order status.
