Multi-Currency API: Show Prices in USD, AED, EUR and 150+ Currencies with OtpGet
Your customers do not all think in the same currency. A reseller in Dubai wants AED, one in Europe wants EUR, a developer in the US wants USD. OtpGet's API handles that for you, so you never write an exchange-rate updater of your own.
The currency parameter
Add ¤cy=CODE to supported requests and every amount in the reply is converted to that currency:
https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalance¤cy=USDhttps://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getRentalPricing¤cy=AED
- Codes are case-insensitive, so
usdandUSDboth work. - If you leave the parameter out, amounts stay in the site's base currency, exactly as before. Existing integrations do not break.
- An unsupported code returns
BAD_CURRENCY.
getCurrencies: the list of supported codes
https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getCurrencies
Returns every currency code you can pass. Use it to build a currency selector in your own app and validate input before calling the API.
Where it helps
- Reseller panels that show customers their balance and prices in a local currency.
- Dashboards that report spending in the finance team's reporting currency.
- Price tables for customers in many countries from one codebase.
A note about rounding
Converted amounts are display values calculated from current rates. Charges are always made in the account's base currency, so a small rounding difference between display and ledger is normal. For accounting, store the original base-currency amount.
Start building with OtpGet
Create a free account at otpget.com, copy your API key from the dashboard and open the API documentation. Our support team is available 24/7 if you get stuck.