Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.dubupay.com/llms.txt

Use this file to discover all available pages before exploring further.

Exchange rates represent the current conversion price between Nigerian Naira and stablecoins. Before you create a TEMPORARY virtual account or an NGN payout offramp, you should fetch the latest rate and supply the returned rate_id in your request body to lock in a guaranteed conversion price. Rates are live market quotes with a short validity window — always fetch fresh before use.

Authentication

All endpoints require either a Bearer token or an API key.
Authorization: Bearer <access_token>
X-Api-Key: dubu_sk_live_...

Get exchange rates

GET https://api.dubupay.com/api/v1/payments/rates Returns the current exchange rates for NGN conversions. You can filter by currency pair and side (buy or sell).

Query parameters

from
string
Source currency (e.g., NGN).
to
string
Target currency (e.g., USDT or USDC).
side
string
Trade direction. Typically buy or sell.

Response

data
array
List of rate objects for all available pairs (or the filtered pair if query params are provided).

Example — fetch all rates

curl "https://api.dubupay.com/api/v1/payments/rates" \
  -H "X-Api-Key: dubu_sk_live_..."

Example — fetch NGN/USDT rate only

curl "https://api.dubupay.com/api/v1/payments/rates?from=NGN&to=USDT" \
  -H "X-Api-Key: dubu_sk_live_..."

Example response

{
  "success": true,
  "data": [
    {
      "id": "rate_abc123",
      "pair": "NGN/USDT",
      "rate": "0.00063",
      "side": "buy",
      "expires_at": "2024-01-15T10:35:00.000Z",
      "timestamp": "2024-01-15T10:30:00.000Z"
    },
    {
      "id": "rate_def456",
      "pair": "NGN/USDC",
      "rate": "0.00063",
      "side": "buy",
      "expires_at": "2024-01-15T10:35:00.000Z",
      "timestamp": "2024-01-15T10:30:00.000Z"
    }
  ]
}

How rates are used

TEMPORARY onramps — locked rate

When you create a TEMPORARY onramp, you pass the rate_id from this endpoint. The rate is locked for the 25-minute lifetime of the virtual account. If a deposit arrives within the window, the conversion happens at the locked rate — even if the market has moved.
{
  "type": "TEMPORARY",
  "amount": 50000,
  "rate_id": "rate_abc123",
  "settlement": {
    "mode": "ONCHAIN",
    "asset": "USDT",
    "chain": "TRON",
    "destination_address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"
  }
}

PERMANENT onramps — floating rate

PERMANENT onramps do not lock a rate at creation time. Instead, the prevailing market rate at the moment a deposit arrives is used for conversion. This gives customers a reusable account without requiring you to refresh rate IDs.

NGN payout offramps — locked rate required

When you create an offramp with settlement.mode set to NGN_PAYOUT, you must supply a rate_id. This locks the USDT→NGN rate for the payout so the recipient receives a predictable amount.

Rate freshness

Rate IDs expire quickly. Always call GET /payments/rates immediately before creating a TEMPORARY onramp or an NGN payout offramp — do not cache rate IDs across sessions or reuse them across multiple requests. Use the expires_at field to confirm the rate is still valid before submitting.