Amounts and currencies
All amounts in the API are integers in the currency’s smallest unit: kobo for naira, cents for dollars. Integers avoid the rounding errors that floating-point numbers cause with money.
| You mean | Send |
|---|---|
| ₦1,500.00 | 150000 with "currency": "NGN" |
| $15.00 | 1500 with "currency": "USD" |
| ¥1,500 | 1500 with "currency": "JPY" (no minor unit) |
Converting
Section titled “Converting”// From what you display to what you sendconst minor = Math.round(1500.0 * 100); // 150000
// From what you receive to what you displaynew Intl.NumberFormat('en-NG', { style: 'currency', currency: 'NGN' }).format(150000 / 100); // "₦1,500.00"Zero-decimal currencies (JPY, KRW, XAF, XOF, UGX, RWF and others) are already whole units: don’t
multiply or divide by 100.
Supported currencies
Section titled “Supported currencies”Any three-letter ISO 4217 code with zero or two decimal places, such as NGN, USD, GBP, EUR, GHS, KES
and ZAR. Three-decimal currencies (KWD, BHD, JOD, OMR, TND, IQD, LYD) aren’t supported yet.
How totals are calculated
Section titled “How totals are calculated”subtotal = sum of (quantity × unit_amount)tax_amount = subtotal × tax_percent / 100, rounded to the nearest unitdiscount_amount = subtotal × discount_percent / 100, rounded to the nearest unittotal = subtotal + tax_amount − discount_amountEvery amount in the response is already rounded, and they always add up exactly.