Paysafe.FxRates (Paysafe v1.0.0)

Copy Markdown View Source

FX Rates API — guaranteed exchange rate quotes with expiry timestamps.

Available for Europe & UK merchants. Use to display localised prices in your checkout before the customer confirms payment.

Unverified endpoint shape

Unlike every other module in this library, the exact request/response JSON shape below could not be confirmed against a concrete example in Paysafe's documentation (only marketing-level prose was available at the time this was written). The base path (/fxrates/v1) and the account-scoped URL pattern are consistent with every other Payments API resource, but double-check the field names below against the current API reference before relying on this in production.

Example

{:ok, rate} = Paysafe.FxRates.get_rate(config, %{
  from_currency: "GBP",
  to_currency: "EUR",
  amount: 10000
})

rate.rate    #=> 1.1834
rate.expiry  #=> "2026-07-01T00:00:00Z"

Summary

Functions

Get a specific FX rate by quote ID.

Get a guaranteed FX rate for a currency pair.

Functions

get_quote(config, quote_id, opts \\ [])

@spec get_quote(Paysafe.Config.t(), String.t(), keyword()) ::
  {:ok, Paysafe.Types.FxRate.t()} | {:error, Paysafe.Error.t()}

Get a specific FX rate by quote ID.

get_rate(config, params, opts \\ [])

@spec get_rate(Paysafe.Config.t(), map(), keyword()) ::
  {:ok, Paysafe.Types.FxRate.t()} | {:error, Paysafe.Error.t()}

Get a guaranteed FX rate for a currency pair.

Parameters

  • :from_currency (required) — Source ISO 4217 currency code.
  • :to_currency (required) — Target ISO 4217 currency code.
  • :amount — Amount in minor units of from_currency.