Skip to main content
GET
/
fx
/
rates
/
{id}
Get FX Rate by ID
curl --request GET \
  --url https://api.zuba.com/fx/rates/{id} \
  --header 'Authorization: <authorization>'
{
  "400": {},
  "401": {},
  "404": {},
  "id": "<string>",
  "fromCurrency": "<string>",
  "toCurrency": "<string>",
  "rate": 123,
  "expiresAt": "<string>",
  "createdAt": "<string>"
}
Get details of a specific exchange rate using its unique identifier. This is useful for retrieving rates that were used in past transactions or for locking in a rate from a previous quote.

Authentication

Authorization
string
required
Bearer token for authentication

Path Parameters

id
string
required
Unique identifier (UUID) of the FX rate

Response

id
string
Unique identifier for the rate (UUID)
fromCurrency
string
Source currency code
toCurrency
string
Target currency code
rate
number
Exchange rate (final rate including any markup)
expiresAt
string
ISO 8601 timestamp when this rate expires
createdAt
string
ISO 8601 timestamp when this rate was created

Example Request

curl -X GET "https://api.zuba.com/fx/rates/123e4567-e89b-12d3-a456-426614174000" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "fromCurrency": "EUR",
  "toCurrency": "NGN",
  "rate": 1760.01,
  "expiresAt": "2025-10-30T12:00:00Z",
  "createdAt": "2025-10-29T12:00:00Z"
}

Use Cases

Verifying Rates Used in Payouts

When a payout includes a rateId, you can use this endpoint to verify the exact rate that was used:
// Get payout details
const payout = await getPayout('payout-id');

// Retrieve the rate that was used
if (payout.rateId) {
  const rate = await getRateById(payout.rateId);
  console.log(`This payout used rate: 1 ${rate.fromCurrency} = ${rate.rate} ${rate.toCurrency}`);
}

Checking Rate Expiration

Before using a rate ID from a previous quote, check if it’s still valid:
const rate = await getRateById('rate-id-from-quote');
const now = new Date();
const expiresAt = new Date(rate.expiresAt);

if (now < expiresAt) {
  console.log('Rate is still valid');
} else {
  console.log('Rate has expired, get a new quote');
}

Error Responses

404
error
Rate not found or has expired
401
error
Unauthorized - Invalid or missing API key
400
error
Bad request - Invalid rate ID format