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:
Field | Data Type | Description |
---|---|---|
from_currency | required | The currency in which the user is converting from |
to_currency | required | The currency in which the user wants to convert to |
amount | required | The amount to be converted |
reference | required | A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile the conversion |
{
"from_currency": "NGN",
"to_currency": "USD",
"from_amount": 90000,
"to_amount": 47.82,
"rate": 1882.1,
"reference": "sample-reference-xxxxxx",
"expiry_in_seconds": 40
}
Updated 2 months ago