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
#Unit-rate lookup
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.
Lookup with conversion
Metadata fields
#| Field | Meaning |
|---|---|
| currencyCode | Normalized base currency code from the upstream response. |
| currencyName | Display name for the base currency. |
| currencySymbol | Symbol associated with the base currency. |
| countryName / countryCode | Country metadata tied to the base currency. |
| flagImage | Flag asset URL returned by the upstream provider. |
| ratesDate | Date 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.