Concepts · Concepts

Amounts & currency formatting

rafiqPay accepts and returns all monetary amounts at the JSON API boundary as exact decimal Naira strings (e.g. "35000.00") while storing and posting integer kobo internally.

Naira strings at the boundary, integer kobo inside

Floating-point numbers in JavaScript and JSON silently corrupt kobo values (for example, 19.99 * 100 evaluates to 1998.9999999999998). So send every amount as a string in naira, such as "35000.00", and read amounts back the same way. Many objects also carry the exact amount in kobo as an integer string (amountKobo).

Inside the core engine and double-entry ledger, every amount is converted to a 64-bit integer in kobo (BIGINT) before validation or posting.