Skip to main content
POST /offramp/rate endpoint returns the current exchange rate for converting a supported stablecoin to a local currency. Call this endpoint before creating an actual payment transaction to show users exactly how much they’ll receive.

Example Request

curl -L \
  --request POST \
  --url 'https://api.onswitch.xyz/offramp/rate' \
  --header 'x-service-key: '"$YOUR_SERVICE_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "asset": "base:usdc",
    "country": "NG",
    "currency": "NGN"
  }'

Example Response

{
  "success": true,
  "message": "Offramp rate fetched successfully",
  "timestamp": "2024-01-01T00:00:00.000Z",
  "data": {
    "currency": "NGN",
    "channel": "BANK",
    "rate": 1408.761
  }
}
Rates reflect current market conditions and may change between the time you fetch them and when a transaction is submitted. Always re-fetch the rate immediately before creating a transaction.

Need Help?

Email Support

Send us a message and we’ll get back to you shortly.

Book a Demo

Hop on a call with our team.