Skip to content
HitchPay API Docs

GLOBAL PAYMENT (CROSS-BORDER)

Get Exchange Rate

Fetch the current exchange rate between two currencies for a given amount.

GET /v1/crossborder/rates

⚠️ Rates are live and change frequently. Always fetch a fresh rate immediately before initiating a transfer — never cache or reuse a previous rate.


Request

Query Parameters

Parameter Type Required Description
source_currency string ✅ Currency you are sending from (e.g. USD)
destination_currency string ✅ Currency the recipient receives (e.g. NGN)
amount number ✅ Amount in the source currency

Code Samples

const axios = require("axios");

const response = await axios.get(
  "https://sandbox.hitchpay.ng/v1/crossborder/rates",
  {
    params: {
      source_currency: "USD",
      destination_currency: "NGN",
      amount: 10
    },
    headers: {
      Authorization: `Bearer ${process.env.ACCESS_TOKEN}`
    }
  }
);

console.log(response.data);
<?php

$params = http_build_query([
  "source_currency"      => "USD",
  "destination_currency" => "NGN",
  "amount"               => 10
]);

$ch = curl_init();

curl_setopt_array($ch, [
  CURLOPT_URL => "https://sandbox.hitchpay.ng/v1/crossborder/rates?{$params}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ]
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
import requests

url = "https://sandbox.hitchpay.ng/v1/crossborder/rates"

headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN"
}

params = {
    "source_currency": "USD",
    "destination_currency": "NGN",
    "amount": 10
}

response = requests.get(url, headers=headers, params=params)
print(response.json())

Response

200 — Success

{
  "status": "success",
  "message": "Rate retrieved successfully.",
  "data": {
    "source_currency": "USD",
    "destination_currency": "NGN",
    "source_amount": 10,
    "destination_amount": 16000,
    "exchange_rate": 1600.0,
    "fee": 0.5,
    "fee_currency": "USD"
  }
}

Questions? Email [email protected]. Also on GitBook.