Skip to main content

Documentation Index

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

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

Multicurrency

Khaime converts prices in real-time and routes payments to the optimal gateway for each currency.

How It Works

  1. Merchant sets a baseline currency (e.g., USD) — all products are priced in this currency
  2. Customer’s currency is detected via IP geolocation (or manual selection)
  3. Prices are converted using live exchange rates
  4. Payment is processed in the customer’s currency via the appropriate gateway
  5. Merchant receives payout in their baseline currency

Supported Currencies

CurrencyCodeSymbol
US DollarUSD$
EuroEUR
British PoundGBP£
Canadian DollarCADC$
Australian DollarAUDA$
Nigerian NairaNGN
Ghanaian CediGHSGH₵
Kenyan ShillingKESKSh
South African RandZARR
Rwandan FrancRWFRF
Tanzanian ShillingTZSTSh
Ugandan ShillingUGXUSh
West African CFAXOFCFA

Exchange Rates

  • Source: Live mid-market rates
  • Caching: Rates are cached with volatility-aware TTLs
    • Stable currencies (USD/EUR): 60 minutes
    • Volatile currencies (USD/NGN): 15 minutes
  • Tolerance: 5% drift tolerance for cross-currency payment validation

API Usage

Get converted pricing

curl "https://api.khaime.com/api/v1/partner/pricing/calculate?amount=10000&target_currency=NGN" \
  -H "X-API-Key: pk_sandbox_your_key"

Charge in customer’s currency

# Step 1: get the converted amount
curl "https://api.khaime.com/api/v1/partner/pricing/calculate?amount=10000&target_currency=NGN" \
  -H "X-API-Key: pk_sandbox_your_key"
# Returns: { "local": { "amount": 14501000, "currency": "NGN" } }

# Step 2: create the charge
curl -X POST https://api.khaime.com/api/v1/partner/payments/charge \
  -H "X-API-Key: pk_sandbox_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 14501000,
    "currency": "NGN",
    "total_amount": 10000,
    "total_currency": "USD",
    "converted_total_amount": 14501000,
    "converted_total_currency": "NGN",
    "customer": {
      "email": "customer@example.com",
      "country": "NG"
    }
  }'
  • amount / currency — what the customer pays (already converted)
  • total_amount / total_currency — the merchant’s original pricing, inclusive of all fees (shipping, etc.)
  • converted_total_amount / converted_total_currency — your pre-computed conversion result; Khaime cross-validates this against its own calculation (1% tolerance)