Fetch Exchange Rate

The first step is to retrieve the exchange rate using the get FX rate endpoint. Retrieving the exchange rate is easy and requires passing in the currency you want to convert from (currencyFrom) and currency you want to convert to (currencyTo).

//currencyFrom
{
    "paymentMode": "immediate",
    "currencyFrom": {
        "currencyName": "USD"
    },
    "currencyTo": {
        "currencyName": "KES"
    }
}

Initiating the request will return the rate. The rate typically expires within 30 seconds. For payment type, please specify immediate as you typically want value instantly for remittance.

//response

{
  "rate": 0.00167025,
  "vfx_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXJyZW5jeUZyb20iOiJOR04iLCJjdXJyZW5jeUZyb21JZCI6bnVsbCwiY3VycmVuY3lUbyI6IlVTRCIsImN1cnJlbmN5VG9JZCI6bnVsbCwiYnlwYXNzQ2hlY2tzIjpmYWxzZSwiY29tcGFueUlkIjoiNTI1IiwicmF0ZSI6MC4wMDE2NzE3Mzc1LCJzcHJlYWQiOjAuMDAwMDI4MjYyNSwicGF5bWVudE1vZGUiOiJsYXRlciIsImlhdCI6MTcxNTMzNjU0MCwiZXhwIjoxNzE1MzM2NTcwfQ.cDeISzitUdSLeheJE3VYSdCrPoJWJz-eUcwxFWQkNU8",
  "expiry": "2024-05-10T10:22:49.994Z",
  "success": true
}

Please keep the vfx token as it will be used during conversion.