curl --request GET \
--url https://sandbox.api.afriex.com/api/v1/transaction/quote \
--header 'x-api-key: <api-key>'import requests
url = "https://sandbox.api.afriex.com/api/v1/transaction/quote"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://sandbox.api.afriex.com/api/v1/transaction/quote', 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://sandbox.api.afriex.com/api/v1/transaction/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://sandbox.api.afriex.com/api/v1/transaction/quote"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.api.afriex.com/api/v1/transaction/quote")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.afriex.com/api/v1/transaction/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"anchor": "source",
"sourceAmount": "100000",
"sourceCurrency": "NGN",
"destinationAmount": "65.76696108",
"destinationCurrency": "USD",
"rate": "0.0006576696108"
}
}Quote a Withdrawal
Returns what a withdrawal would cost, priced by the same code that charges it, without creating anything. Type exactly one of sourceAmount (what you send) or destinationAmount (what the recipient receives); the other is derived from it. The side you type is returned as anchor.
rate, fee and the amounts mean exactly what they mean on the transaction a create returns, so a create with the same inputs charges the quoted amounts. A quote does not check limits or customer verification and does not need an idempotency key or reference; those apply when you create the transaction, so a quote can succeed where the create is refused. Quotes are not reserved: rates and promotions can change before you create.
Name the destination either with destinationId (a saved payment method) or with destinationChannel and destinationCountry (when the customer has no account to send to yet), not both. destinationCountry can be left out for SWIFT and CRYPTO. A quote priced from a channel alone comes back with indicative: true: the account is not known, so the processor that would carry the payout, and any fee that depends on it, may differ when you create. customerId is optional; without it the quote is priced for the business owner, so a fee or promotion that depends on the customer’s country can differ when you create.
curl --request GET \
--url https://sandbox.api.afriex.com/api/v1/transaction/quote \
--header 'x-api-key: <api-key>'import requests
url = "https://sandbox.api.afriex.com/api/v1/transaction/quote"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://sandbox.api.afriex.com/api/v1/transaction/quote', 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://sandbox.api.afriex.com/api/v1/transaction/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://sandbox.api.afriex.com/api/v1/transaction/quote"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.api.afriex.com/api/v1/transaction/quote")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.afriex.com/api/v1/transaction/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"anchor": "source",
"sourceAmount": "100000",
"sourceCurrency": "NGN",
"destinationAmount": "65.76696108",
"destinationCurrency": "USD",
"rate": "0.0006576696108"
}
}TRANSACTION.WITHDRAW.CREATE key permission. See Permissions.How to use it
Choose the side you type
sourceAmount (what you send) or destinationAmount (what the recipient receives). The API derives the other side. The response anchor tells you which side is exact: source or destination.Name the destination
destinationId (a saved payment method) or destinationChannel plus destinationCountry (when the customer has no account to send to yet), never both. destinationCountry can be left out for SWIFT and CRYPTO.Optionally pass the customer
customerId is optional. Without it, the quote is priced for the business owner.Example
curl -G "https://sandbox.api.afriex.com/api/v1/transaction/quote" \
-H "x-api-key: YOUR_API_KEY" \
--data-urlencode "sourceCurrency=NGN" \
--data-urlencode "destinationCurrency=USD" \
--data-urlencode "sourceAmount=100000" \
--data-urlencode "destinationId=PAYMENT_METHOD_ID"
{
"data": {
"anchor": "source",
"sourceAmount": "100000",
"sourceCurrency": "NGN",
"destinationAmount": "65.76696108",
"destinationCurrency": "USD",
"rate": "0.0006576696108"
}
}
rate reads as 1 sourceCurrency = rate destinationCurrency. fee is in sourceCurrency and is left out when no fee applies.
Things to know
- Quotes are not reserved. Rates and promotions can change before you create, so quote again close to the send if the price matters.
- A quote can succeed where the create is refused. A quote does not check limits or customer verification, and it needs no idempotency key or reference. Those apply when you create the transaction.
indicative: true. When you price fromdestinationChannelalone, the account is not known yet, so the payout route and any fee that depends on it can differ when you create. The response carriesindicative: trueto tell you so.- Pass
customerIdfor an exact price. A fee or promotion that depends on the customer’s country can differ from a business-owner quote.
Errors
A422 means the request is invalid: you sent both amounts or neither, both destinationId and destinationChannel or neither, or a required parameter is missing.Authorizations
Static business API key issued from the dashboard. A business can provision multiple API keys, each scoped to a configurable set of permissions (e.g. read transactions, create deposits, etc). Permissions are chosen per key at creation time in the dashboard and may be revoked by deleting the key. Manage your keys and their permissions under Developer → API keys in the dashboard.
A request whose key does not carry the permission the target
endpoint requires is rejected with 401 Unauthorized, the same
response an unrecognised, malformed, revoked or disabled key
returns. The API does not distinguish the two cases on the wire.
See the Permissions reference for the permission each endpoint requires.
Headers
API version in ISO 8601 format. The only supported version is 2026-05-18, which is also the default when the header is omitted. Any other value is rejected with a 400 Bad Request.
Query Parameters
The customer the withdrawal is for. Omit it to price the quote for the business owner.
The destination payment method the funds would be sent to. Send this or destinationChannel, not both.
The channel the funds would be sent over, when there is no saved payment method yet. Send this or destinationId, not both.
"BANK_ACCOUNT"
The destination country (ISO 3166-1 alpha-2), required with destinationChannel except for SWIFT and CRYPTO.
"NG"
The currency debited from your wallet.
"NGN"
The currency the recipient receives.
"USD"
The amount you send. Send this or destinationAmount, not both.
"100000"
The amount the recipient receives. Send this or sourceAmount, not both.
"65.77"
Response
The quote.
Show child attributes
Show child attributes
