Skip to main content
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>'

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

HeaderValueRequired
Content-Typeapplication/jsonNo

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

FieldTypeDescription
ratenumberCurrent exchange rate. 1 USD = rate NGN
baseCurrencystringBase currency — always USD
currencystringTarget 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`);

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.