Currencies
amount
responses sent across all of Bloc’s APIs are returned in the smallest possible unit of the respective countries/currencies as an integer, not a float value.
Integers and floats are two different kinds of numerical data. An integer (int) is a number without a decimal point, while a float is a number with a decimal point.
Our infrastructure is only available in 🇳🇬 Nigeria currently. This means that the only currency we pass on our API is the Nigerian Naira (NGN). However, all API amount
responses are returned in kobo, not naira.
For example, when an API response, amount
, returns 30000, it is the kobo value that was returned. You can then go ahead to divide this amount by 100 to get the specific naira equivalent, which is ₦300.
The same thing applies to cases when you are sending a request with amount as a variable. It has to be converted to its kobo equivalent (by multiplying by 100), or else you risk receiving an error message.
Updated 6 months ago