Exchange Rate API

You can use the exchange rate API to get the latest rate for any currency pair. It can be used on its own or before starting a currency conversion. However, fetching the exchange rate is a prerequisite to initiating a currency conversion transaction.

To get the latest exchange rate for a currency pair, make a POST request to the exchange rate endpoint;

{{baseurl}}/api/v1/conversions/rates

The request body should have the following parameters:

FieldData TypeDescription
from_currencyStringThe currency from which the user is converting. For example, if you wanted to convert Nigerian Naira to US Dollar, the from_currency will be NGN.
to_currencyStringThe currency to which the user wants to convert funds. For example, if you wanted to convert Nigerian Naira to US Dollar, the to_currency will be USD.
amountNumberThe amount to be converted (referring to the from_currency).
referenceStringA string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile the conversion.

Here's an example of a response to the request.

{
  "status": true,
  "message": "Conversion rate retrieved successfully",
  "data": {
    "from_currency": "USD",
    "to_currency": "NGN",
    "from_amount": 10,
    "to_amount": 14400,
    "rate": 1440,
    "reference": "1ccdb7da-e732-4610-a17f-5abfb7617d99",
    "expiry_in_seconds": 25
  }
}