# Balances, fees and payouts

What a payment brings in after our fee, how it waits as pending, and how each payout to your bank is recorded and announced.

A payment that succeeds adds its **net** to your balance: its amount, less our fee. In live mode, our
licensed payment partner holds that money until it pays it to your bank account. The dashboard
follows each payment from its success to its payout, under **Balances** and **Payouts**.

## Our fee

* **One fee per payment, by payment method**: a percentage of the amount plus a fixed amount, card
  and cash each with their own. It is rounded to the nearest centime, and never more than the
  payment itself.
* **Fixed when the payment starts**: when your customer opens the card page or receives the cash
  code. A change of your rates applies to payments started after it; a payment already started
  keeps its rate, paid or not yet.
* **The same rates in test mode and in live mode**, so your test balance moves like a live one.
* **Shown on each payment.** A payment's page in the dashboard shows its fee and its net, and the
  payment keeps the rate they were computed with, as `feeRate`: the percentage and the fixed amount.
* **Kept on a refund.** A refund gives your customer the amount back and takes it from your
  balance; our fee is not given back. See [Refunds](https://pay-docs.adpromax.com/en/payments/refunds).

## How your money moves

|                    | Test mode                                                                  | Live mode                                                                                      |
| ------------------ | -------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| A payment succeeds | Its net is **pending**                                                     | Its net is **pending**                                                                         |
| Then               | It becomes **available** 120 seconds later, and stays in your test balance | It stays pending, with no fixed delay, until our licensed payment partner pays it to your bank |
| Paid to your bank  | Never: no money moves                                                      | In a **payout**, which our team records from the partner's settlement report                   |

When our team records a payout, each payment it covers is **settled**:

* on the **Balances** page, the payment's line reads *Settled on* and the day the partner paid it
  (`settledOn`, a Morocco day), with its payout; the payment's own page says the same;
* a **Payout** line for the same payment (type `payout`, negative) takes what was paid to your bank
  out of your balance. A settled payment is in neither your pending nor your available balance.

A refund made **before** a payment is settled lowers what is paid for it: a payment of 500.00 MAD
refunded by 100.00 MAD settles for 400.00 MAD, less our fee. A refund made **after** it was settled
takes its amount from your available balance, which can then go below zero.

The **Balances** page lists every line that moved your balance, newest first: payments, refunds and
payouts. Filter it by **Type** to see the payouts alone; its export, a CSV file, holds the same
lines.

## Payouts

A **payout** (`po_…`) is what our licensed payment partner paid to your bank account for one payment
method on one day, as our team recorded it. Payouts exist in live mode only: test mode pays nothing
out.

**Payouts**, in the dashboard's Money group, lists them, the latest day first, filtered by method
and day. A payout's page shows the day it was paid, its method, how many payments it covers and when
our team recorded it, then each payment with its amount, our fee, what was refunded before it was
settled, and the amount settled.

* **A payout is `paid`**: it records money already paid to your bank, never money promised.
* **A payout never changes** once it is listed. A payment recorded later for the same day comes in a
  payout of its own, so one day can show two payouts.
* **Who sees them**: the Owner, Administrators, Finance and Analysts, as for balances. See
  [Team and roles](https://pay-docs.adpromax.com/en/account/team-and-roles).

## Events

In live mode, each payout sends two events, once, when our team records it:

| Event               | Its object                                                                                                                                                                                           |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `payout.paid`       | The payout: `id`, `amount`, `currency`, `status` (`paid`), `method` (`card` or `cash`), `arrival_date` (the day it was paid, `YYYY-MM-DD`, Morocco time), `payment_count`, `livemode` and `created`. |
| `balance.available` | Your balance once the payout is recorded: `pending` and `available`, `currency` and `livemode`. Either amount can be below zero.                                                                     |

Amounts are in centimes, as everywhere in the API. A payout's payments are not in its event: read
them on its page in the dashboard. Subscribe a live webhook endpoint to these events like any other:
see [Webhooks](https://pay-docs.adpromax.com/en/webhooks).
