Get Current Rates

The FX Rates API allows users to retrieve the latest indicative exchange rates for supported currency pairs.

This endpoint provides real-time exchange rate data, allowing businesses to convert between currencies. This API supports custom exchange calculations based on a fixed base or quote currency.

First, you need to understand the conversion logic:

Conversion Logic

The API supports two conversion types based on the fixed_side parameter:

  1. Fixed Quote Currency (fixed_side=quote)
    • You specify how much quote currency you need.
    • The API returns how much base currency is required.
    • Example: "How much NGN do I need to get 10,000 USD?"
  2. Fixed Base Currency (fixed_side=base)
    • You specify how much base currency you have.
    • The API returns how much quote currency you will receive.
    • Example: "How much USD will I get for 10,000 NGN?"

Query Parameters

ParameterRequiredDescription
base_currency✅ YesThe source currency for the exchange.
quote_currency✅ YesThe destination currency for the exchange.
amount❌ NoThe amount to be exchanged in either base or quote currency (major currency units).
fixed_side❌ NoRequired if amount is set. Specifies which currency (base or quote) should be fixed for conversion.

Example Request

GET http://api.sandbox.waza.co/lync/rates/current?base_currency=NGN&quote_currency=USD&amount=10000&fixed_side=quote
📘

Explaining the Example:

In the sample request, we are:

  • Fetching the exchange rate for NGN to USD.
  • The quote side is fixed, meaning we want to know how much NGN is needed to receive exactly 10,000 USD.
  • If fixed_side=base, the API would return how much USD we would get for 10,000 NGN.

Example Response

A successful request returns a JSON response containing the latest exchange rates for multiple currency pairs.

{
    "data": {
        "pair": "NGN/USD",
        "timestamp": 1743601175091,
        "base_currency": "NGN",
        "quote_currency": "USD",
        "rate": "1765",
        "conversion": {
            "amount": "10000",
            "fixed_side": "quote",
            "base_amount": "17650000",
            "quote_amount": "10000"
        }
    }
}

** Response Fields**

FieldTypeDescription
pairstringCurrency pair in the format base/quote (e.g., NGN/USD).
timestampintegerEpoch timestamp (milliseconds) when this rate was generated.
base_currencystringThe source currency in the exchange.
quote_currencystringThe destination currency in the exchange.
ratestringThe exchange rate represents how much base currency is needed for 1 quote currency.
conversionobject(Optional) Only present if amount and fixed_side are specified. Contains calculated exchange values.
conversion.amountstringThe requested exchange amount.
conversion.fixed_sidestringThe fixed side of the exchange (base or quote).
conversion.base_amountstringThe amount of base currency required for the conversion.
conversion.quote_amountstringThe amount of quote currency in the conversion.

The API returns an error response with relevant details if the request fails.


🚧

Additional Notes

  • Real-time Data: Exchange rates may fluctuate frequently. Ensure you fetch fresh data before making conversions.
  • Timestamps: Use the timestamp field to track when the rate was generated to prevent outdated conversions.