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

# Currencies & amounts

> The currencies in the Broco specification and how to write amounts as integers in minor units.

## Supported currency codes

The specification defines four currencies, identified by their ISO 4217 code.

| Code | Currency | Decimal places | 100 units in the API |
| - | - | - | - |
| `DZD` | Algerian dinar | 2 | `10000` |
| `MAD` | Moroccan dirham | 2 | `10000` |
| `TND` | Tunisian dinar | 3 | `100000` |
| `XOF` | West African CFA franc | 0 | `100` |

This list describes the specification. It does not say in which countries a service is available. See [Integration access](/get-started/integration-access).

## Amounts in minor units

Every `amount` field is a positive integer in the minor unit of its `currency`. Multiply the displayed amount by 10 to the power of the currency's decimal places.

| Displayed amount | `currency` | `amount` |
| - | - | - |
| 12 500 DZD | `DZD` | `1250000` |
| 250.50 MAD | `MAD` | `25050` |
| 48.750 TND | `TND` | `48750` |
| 15 000 XOF | `XOF` | `15000` |

The guides use `DZD` in every example. The rules are the same for the other three currencies.

```json Request body (MAD) theme={null}
{
  "amount": 25050,
  "currency": "MAD"
}
```

```json Request body (XOF) theme={null}
{
  "amount": 15000,
  "currency": "XOF"
}
```

## Validation rules

| Rule | Error when broken |
| - | - |
| `amount` is a positive integer | `invalid_amount` |
| `amount` has no fractional part, including for `XOF` | `invalid_amount` |
| `currency` is `DZD`, `MAD`, `TND` or `XOF` | `unsupported_currency` |
| `currency` can be used with the Broco accounts involved | `currency_mismatch` |

## One currency per operation

* For transfers between two Broco balances (Broco Pay and supplier payments), the balance debited and the balance credited are in the currency of the operation.
* For cash payments and collections, the payer hands over cash and does not need a Broco balance. The balance credited is in the currency of the operation.
* Each payment, cash payment, supplier payment and collection uses one currency from creation to settlement.
* Fees and net amounts use the same currency as the gross amount.
* Broco does not convert between currencies in these flows.

## Displaying amounts

Convert minor units back for display with the same number of decimal places, and keep the currency code next to the amount.

```javascript Format an amount theme={null}
const DECIMALS = { DZD: 2, MAD: 2, TND: 3, XOF: 0 };

function toDisplay(amount, currency) {
  const digits = DECIMALS[currency];
  return `${(amount / 10 ** digits).toFixed(digits)} ${currency}`;
}

toDisplay(1250000, "DZD"); // "12500.00 DZD"
toDisplay(48750, "TND");   // "48.750 TND"
toDisplay(15000, "XOF");   // "15000 XOF"
```

## Next step

<Card title="Reconciliation" href="/developer/reconciliation" horizontal>
  Match amounts, currencies and references with your records.
</Card>


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