Skip to content
Endpoint
GET/api/exchange/{base}

Return unit rates or converted totals from the same endpoint.

The currency route looks up metadata and rate tables for a base currency, then optionally multiplies those rates by an amount query parameter.

The path parameter identifies the base currency. Add ?amount=value when you also want precomputed convertedRates in the response.

Input type

Path + query

Extended output

convertedRates

Primary risk

Upstream freshness

Success payload without amount

JSONUnit-rate lookup
{  "currencyCode": "aoa",  "currencyName": "Angolan kwanza",  "currencySymbol": "Kz",  "countryName": "Angola",  "countryCode": "AO",  "flagImage": "https://example.com/flags/ao.png",  "ratesDate": "2026-03-22",  "baseCurrency": "AOA",  "unitRates": {    "usd": 0.0011,    "eur": 0.0010  }}

Success payload with amount

  • amount is parsed as a number and must be zero or greater.
  • convertedRates mirrors the keys from unitRates and multiplies each value by amount.
  • baseCurrency is normalized to uppercase in the response even though the route accepts lowercase input.
JSONLookup with conversion
{  "baseCurrency": "AOA",  "amount": 1000000,  "unitRates": {    "usd": 0.0011  },  "convertedRates": {    "usd": 1100  }}

Metadata fields

FieldMeaning
currencyCodeNormalized base currency code from the upstream response.
currencyNameDisplay name for the base currency.
currencySymbolSymbol associated with the base currency.
countryName / countryCodeCountry metadata tied to the base currency.
flagImageFlag asset URL returned by the upstream provider.
ratesDateDate attached to the upstream rate snapshot.

Implementation guidance

  • Use unitRates when you need full control over formatting, rounding, or downstream business calculations.
  • Use convertedRates when the endpoint is feeding UI directly and you want to avoid duplicate math across clients.
  • Guard against missing currencies in your UI because the upstream provider may not include every code in every snapshot.
  • If you persist converted totals, also persist the ratesDate so reports remain auditable.