curl --request GET \
--url https://api.stablepay.ai/v1/fx/convert \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.stablepay.ai/v1/fx/convert"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.stablepay.ai/v1/fx/convert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stablepay.ai/v1/fx/convert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.stablepay.ai/v1/fx/convert"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.stablepay.ai/v1/fx/convert")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stablepay.ai/v1/fx/convert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"convertedAmount": "10.680",
"exchangeRate": "128.218000",
"paymentFee": "20",
"expiresAt": "2024-01-15T10:31:30.000Z",
"rateId": "RATE_ROXX01ARZ3NDEKTSV4RRFFQ69G5FAV"
}FX Rate
Returns an exchange rate and fee breakdown.
curl --request GET \
--url https://api.stablepay.ai/v1/fx/convert \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.stablepay.ai/v1/fx/convert"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.stablepay.ai/v1/fx/convert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stablepay.ai/v1/fx/convert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.stablepay.ai/v1/fx/convert"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.stablepay.ai/v1/fx/convert")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stablepay.ai/v1/fx/convert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"convertedAmount": "10.680",
"exchangeRate": "128.218000",
"paymentFee": "20",
"expiresAt": "2024-01-15T10:31:30.000Z",
"rateId": "RATE_ROXX01ARZ3NDEKTSV4RRFFQ69G5FAV"
}Authorizations
Stablepay API key. Include as Authorization: Bearer <key>.
Query Parameters
Amount to convert.
1000
The currency to convert from (fiat or stablecoin).
CDF, GHS, KES, NGN, TZS, UGX, XAF, XOF, ZAR, ZMW, USDC The currency to convert to.
USDC, CDF, GHS, KES, NGN, TZS, UGX, XAF, XOF, ZAR, ZMW MOMO, BANK, OPAY, PAYBILL, TILL payout: issuer sends stablecoin → recipient receives fiat. payin: customer pays fiat → issuer receives stablecoin.
payout, payin YES, NO For XOF payments, the recipient country must be specified.
BJ, BF, CD, CI, SN Response
Indicative FX rate and fee breakdown for the requested corridor.
Total converted amount in the destination currency (inclusive of network fee, optional issuer fee and payment fee).
"10.680"
Market exchange rate sourced from local liquidity partners (inclusive of network fee and optional issuer fee)
"128.218000"
The fee comprises the mobile network operator or bank processing fee.
"20"
Unix timestamp (seconds) after which this rate expires.
1750334460
Identifier for the quoted rate. Locked for 1 hour.
"RATE_ROXX01ARZ3NDEKTSV4RRFFQ69G5FAV"

