Skip to main content
Use avraapi.currency() for the four released Currency operations. Every call is asynchronous and resolves to an ApiResponse; retain requestId for support and troubleshooting.
Every Currency operation supports the shared one-request privacy control: avraapi.currency().withPrivacyMode().getCodes(). It sends X-Privacy-Mode: 1 for that request only, then clears automatically.
The SDK trims and uppercases base and target before sending them. They must still be active Currency codes, so retrieve the current set instead of keeping a hard-coded list.

Get supported currency codes

getCodes(): Promise<ApiResponse> returns the active code list, including target-only CBSL codes when available. SDK function
Copy the SDK call
Read the active code list

Response

The list is shortened only for readability. LKR-SELL, LKR-BUY, and LKR-CBSL are target-only CBSL codes, not ordinary base currencies. See CBSL Rates for their meanings.

Get latest rates from one base currency

getLatestRates(base: string): Promise<ApiResponse> returns the available rate map for one base currency. The base is not repeated in data.rates. SDK function
Copy the SDK call
Read a rate map

Response

Treat last_updated as a freshness value, not a binding financial quote. Apply your own pricing, approval, and rounding rules before displaying a price.

Get one currency-pair rate

getPairRate(base: string, target: string): Promise<ApiResponse> returns one rate. A target can be a standard active currency or LKR-SELL, LKR-BUY, or LKR-CBSL for the applicable CBSL rate type. SDK function
Copy the SDK call
Read one pair rate

Response

For CBSL target behaviour, read CBSL Rates.

Convert a currency amount

convert(base: string, target: string, amount: number): Promise<ApiResponse> calculates a current conversion for one positive amount. SDK function
Copy the SDK call
Convert and use a positive amount

Response

The result is an application calculation, not a settlement instruction. See the Currency REST API Reference for the full validation and error contract.

Handle Currency errors

Currency calls reject with typed SDK errors rather than resolving to an error ApiResponse. Use the common pattern in Node.js Overview and setup, and retain an error’s requestId only in backend support records.
Last modified on October 1, 2026