Get Exchange Rate
curl --request GET \
--url https://api.vellosim.com/api/settings/exchange-rate \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.vellosim.com/api/settings/exchange-rate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.vellosim.com/api/settings/exchange-rate"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vellosim.com/api/settings/exchange-rate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vellosim.com/api/settings/exchange-rate"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Settings
Get Exchange Rate
Retrieve the current USD to NGN exchange rate
GET
/
api
/
settings
/
exchange-rate
Get Exchange Rate
curl --request GET \
--url https://api.vellosim.com/api/settings/exchange-rate \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.vellosim.com/api/settings/exchange-rate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.vellosim.com/api/settings/exchange-rate"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vellosim.com/api/settings/exchange-rate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vellosim.com/api/settings/exchange-rate"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Endpoint
GET /api/settings/exchange-rate
Description
Returns the current USD to NGN exchange rate used by Vellosim. Use this to convert USD package prices to NGN for display purposes. This is a public endpoint — no authentication required.Request
Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | No |
Parameters
This endpoint does not require any parameters.Response
Success Response (200 OK)
{
"success": true,
"message": "Exchange rate retrieved successfully",
"data": {
"rate": 1600,
"baseCurrency": "USD",
"currency": "NGN"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
rate | number | Current exchange rate. 1 USD = rate NGN |
baseCurrency | string | Base currency — always USD |
currency | string | Target currency — always NGN |
Code Examples
const response = await fetch('https://api.vellosim.com/api/settings/exchange-rate');
const { data } = await response.json();
console.log(`Exchange rate: 1 USD = ${data.rate} NGN`);
import requests
response = requests.get('https://api.vellosim.com/api/settings/exchange-rate')
data = response.json()['data']
print(f"Exchange rate: 1 USD = {data['rate']} NGN")
curl -X GET https://api.vellosim.com/api/settings/exchange-rate
Converting Prices
Use the rate to convert USD package prices to NGN:const packagePriceUSD = 4.50;
const ngnPrice = Math.round(packagePriceUSD * data.rate * 100) / 100;
// e.g. 4.50 * 1600 = ₦7,200.00
This endpoint is public and does not require an API key. The rate is updated periodically and may change between when you fetch it and when a purchase is made.
