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

# Settlements & reconciliation

> How Safariat invoices the net amounts you owe, monthly

SafarAPI never touches card data. Your bank collects the customer's payment;
Safariat invoices you **monthly** for the aggregate **net** amount (the
`net_amount` frozen in each [quote](/concepts/quotes)). This page is the money
model your finance team needs.

## The cycle

1. Throughout the month you create bookings; each carries a `paid_amount_net`.
2. At month end Safariat aggregates your bookings, refunds, and adjustments into
   one settlement.
3. The settlement moves to `ISSUED`; a `settlement.issued`
   [webhook](/api-concepts/webhooks) fires and a PDF invoice becomes available.
4. You pay the `net_due` by bank transfer before `due_at`.
5. A Safariat admin marks it `PAID` once the transfer is received.

A booking's `settlement_id` is `null` until it is invoiced, then points at the
settlement that included it.

## Amounts

```
net_due = bookings_total − refunds_total + adjustments_total
```

All values follow the [Money](/api-concepts/money) shape (`MAD`, 2-decimal
string). `SettlementDetail` exposes the per-line breakdown:

| `line_type`  | Sign     | Meaning                                                  |
| ------------ | -------- | -------------------------------------------------------- |
| `BOOKING`    | positive | Net amount of one booking.                               |
| `REFUND`     | negative | Reversal of a cancelled booking (per its tier).          |
| `ADJUSTMENT` | ±        | Manual correction by Safariat (rare, always documented). |

## Status lifecycle

| Status      | Meaning                                                         |
| ----------- | --------------------------------------------------------------- |
| `DRAFT`     | Generated, under Safariat admin review. **Not visible to you.** |
| `ISSUED`    | Issued; PDF invoice available; payment expected.                |
| `PAID`      | Transfer received, marked by a Safariat admin.                  |
| `OVERDUE`   | Past `due_at` without payment.                                  |
| `DISPUTED`  | You disputed it; blocks future issuances until resolved.        |
| `CANCELLED` | Administrative cancellation (exception).                        |

## Endpoints

* `GET /settlements` — list (paginated; `DRAFT` is never returned).
* `GET /settlements/{id}` — detail with `lines`.
* `GET /settlements/{id}/invoice.pdf` — redirect to the pre-signed invoice PDF.

<Note>
  Sandbox (`sk_test_*`) never issues a settlement — bookings are flagged
  `test_mode=true`. Use the [response examples](/api-reference/openapi) to model
  your reconciliation logic, and validate it end to end only against production.
</Note>
