Skip to content
ABUNA
DocsAmounts, currencies and timestamps

Getting started

Amounts, currencies and timestamps

How the API writes money, currencies, and times.

The API writes money as whole numbers with a currency code, and times as Unix seconds.

Amounts

An amount is an integer in the currency's smallest unit. XAF and XOF have no smaller unit, so 5000 means FCFA 5,000.

A price's amount
{
  "amount": 5000,
  "currency": "XAF"
}

A price's amount must be greater than 0. An amount of 0 or less returns 422 with code invalid. A decimal like 5000.5 or a string like "5000" returns 400 with code invalid_json.

Each invoice keeps the amount and currency its price had when the invoice was issued. The amount a customer pays is on the invoice.

Currencies

Abuna supports two currencies: XAF (Central African CFA franc) and XOF (West African CFA franc). You can send the code in any case. The API stores and returns it in uppercase. Any other code returns 422 with code currency_unsupported.

Each app has a base_currency, which you choose when you create the app. Each price has its own currency, which can be either one.

In Live mode, each mobile money network takes one currency. A payment on a network that doesn't take the invoice's currency returns 422 with code payment_unavailable.

Timestamps

Every time in the API is an integer count of seconds since the Unix epoch, in UTC. A time that hasn't happened yet is null, such as activated_at before the first payment.

Times in a subscription
{
  "starts_at": 1727600000,
  "activated_at": null,
  "canceled_at": null,
  "created_at": 1727600000
}

Billing periods count from the subscription's start. A monthly subscription that starts on 31 January renews on the last day of February, then on 31 March. Periods keep the start's time of day.

Next steps