Skip to main content
The fx namespace serves currency exchange: latest rates, pair conversions, enriched pairs, and history, plus the ISO 4217 currency catalog. Use it to resolve prices into a traveler’s currency and to keep an FX rate set for pricing. FX requires the data:fx:read scope.
import { createVoyantDataClient } from "@voyant-travel/data-sdk";

const client = createVoyantDataClient({ apiKey: process.env.VOYANT_API_KEY! });

Rates and conversions

// Latest rates for a base currency
const latest = await client.fx.latest("USD");

// Convert an amount between two currencies
const converted = await client.fx.pair("EUR", "USD", 100);

// Enriched pair detail
const enriched = await client.fx.enriched("EUR", "USD");

// Historical rate for a specific day
const historical = await client.fx.history({
  base: "EUR",
  year: 2026,
  month: 1,
  day: 15,
  amount: 100,
});

Catalog and quota

const codes = await client.fx.codes();   // supported currency codes
const quota = await client.fx.quota();    // your remaining FX quota

Types

Key types: FxLatestResponse, FxPairResponse, FxEnrichedResponse, FxHistoryResponse, FxCodesResponse, FxQuotaResponse, CurrencyEntry.
Keep money in integer minor units paired with a currency, as the rest of the platform does, and use FX only to present or convert. See Data model.