{
  "currency": "usdc",
  "fiat": "kes",
  "base_rate": 144.97,
  "marked_up_rate": 148.59,
  "markup_percentage": 2.5,
  "last_updated": "2024-01-15T10:30:00Z",
  "expires_at": "2024-01-15T10:35:00Z"
}

Exchange Rates

Get real-time conversion rates between supported cryptocurrencies and fiat currencies.
Endpoint: GET /ratesAuthentication: Required (x-api-key header)

Quick Examples

curl -X GET "https://staging.elementpay.net/api/v1/rates?currency=usdc" \
  -H "x-api-key: YOUR_API_KEY"

Query Parameters

currency
string
default:"usdc"
Token symbol to get rates for. Supported: usdc, eth, wxm, usdt_lisk
fiat
string
default:"kes"
Fiat currency code. Supported: kes, ugx, tzs, ngn, ghs
amount
number
Optional amount to calculate conversion for (returns converted amount)

Response Format

{
  "currency": "usdc",
  "fiat": "kes",
  "base_rate": 144.97,
  "marked_up_rate": 148.59,
  "markup_percentage": 2.5,
  "last_updated": "2024-01-15T10:30:00Z",
  "expires_at": "2024-01-15T10:35:00Z"
}

Response Fields

base_rate
number
Raw market rate without markup
marked_up_rate
number
Final rate including platform markup (use this for calculations)
markup_percentage
number
Platform fee percentage applied to the base rate
expires_at
string
When this rate quote expires (ISO 8601 format)

Rate Calculation Examples

Rate Validity

Rate Expiration: Rates are valid for 5 minutes. Always fetch fresh rates before creating orders.Slippage Protection: Rates may change between fetching and order creation. Consider adding slippage tolerance.

Supported Token Pairs

TokenNetworksFiat Currencies
USDCBase, Arbitrum, Ethereum, ScrollKES, UGX, TZS, NGN, GHS
USDTLisk, Tron, BNB Chain, PolygonKES, UGX, TZS, NGN, GHS
ETHEthereumKES, UGX, TZS, NGN, GHS
WXMArbitrumKES, UGX, TZS, NGN, GHS
CUSDCeloKES, UGX, TZS, NGN, GHS
CNGNCeloNGN

Error Handling

{
  "status": "error",
  "message": "Unsupported currency pair",
  "code": "UNSUPPORTED_PAIR",
  "details": {
    "currency": "btc",
    "fiat": "kes",
    "supported_currencies": ["usdc", "eth", "wxm", "usdt_lisk"]
  }
}

Next Steps