Get an FX Rate (New)
Overview
Fetches real-time market exchange rates and a secure quote token (vfxToken) using the next-generation Exchange Now API schema supporting immediate or deferred payment modes.
HTTP Request
POST /banking/ibans/v2/fx/rate
Authentication
This endpoint requires an active Bearer JWT token in the Authorization header obtained via POST /banking/ibans/v2/users/login:
Authorization: Bearer <your_access_token>
Request Body Fields
| Field | Type | Description |
|---|---|---|
paymentMode | str | Sample value: later |
currencyFrom | object | Sample value: {"currencyName": "NGN"} |
currencyTo | object | Sample value: {"currencyName": "USD"} |
Code Examples
- cURL
- JavaScript (Axios)
- Python (Requests)
curl -X POST "https://api.ahrvo.network/banking/ibans/v2/fx/rate" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_access_token>" \
-d '{
"paymentMode": "later",
"currencyFrom": {
"currencyName": "NGN"
},
"currencyTo": {
"currencyName": "USD"
}
}'
import axios from 'axios';
const response = await axios.post('https://api.ahrvo.network/banking/ibans/v2/fx/rate', {
"paymentMode": "later",
"currencyFrom": {
"currencyName": "NGN"
},
"currencyTo": {
"currencyName": "USD"
}
}, {
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your_access_token>'
}
});
console.log(response.data);
import requests
url = "https://api.ahrvo.network/banking/ibans/v2/fx/rate"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <your_access_token>"
}
payload = {
"paymentMode": "later",
"currencyFrom": {
"currencyName": "NGN"
},
"currencyTo": {
"currencyName": "USD"
}
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Response (200)
{
"rate": 0.00167025,
"vfx_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXJyZW5jeUZyb20iOiJOR04iLCJjdXJyZW5jeUZyb21JZCI6bnVsbCwiY3VycmVuY3lUbyI6IlVTRCIsImN1cnJlbmN5VG9JZCI6bnVsbCwiYnlwYXNzQ2hlY2tzIjpmYWxzZSwiY29tcGFueUlkIjoiNTI1IiwicmF0ZSI6MC4wMDE2NzE3Mzc1LCJzcHJlYWQiOjAuMDAwMDI4MjYyNSwicGF5bWVudE1vZGUiOiJsYXRlciIsImlhdCI6MTcxNTMzNjU0MCwiZXhwIjoxNzE1MzM2NTcwfQ.cDeISzitUdSLeheJE3VYSdCrPoJWJz-eUcwxFWQkNU8",
"expiry": "2024-05-10T10:22:49.994Z",
"success": true
}
Interactive API Explorer
Test this endpoint live against the Ahrvo gateway and Verto sandbox environments: