curl --request POST \
--url https://api.rolla.xyz/api/v1/external/wallet/fee \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"currency": "NGN",
"transactionType": "withdrawal",
"amount": 5000
}
'import requests
url = "https://api.rolla.xyz/api/v1/external/wallet/fee"
payload = {
"currency": "NGN",
"transactionType": "withdrawal",
"amount": 5000
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({currency: 'NGN', transactionType: 'withdrawal', amount: 5000})
};
fetch('https://api.rolla.xyz/api/v1/external/wallet/fee', 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.rolla.xyz/api/v1/external/wallet/fee",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'currency' => 'NGN',
'transactionType' => 'withdrawal',
'amount' => 5000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.rolla.xyz/api/v1/external/wallet/fee"
payload := strings.NewReader("{\n \"currency\": \"NGN\",\n \"transactionType\": \"withdrawal\",\n \"amount\": 5000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.rolla.xyz/api/v1/external/wallet/fee")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"NGN\",\n \"transactionType\": \"withdrawal\",\n \"amount\": 5000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rolla.xyz/api/v1/external/wallet/fee")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"NGN\",\n \"transactionType\": \"withdrawal\",\n \"amount\": 5000\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"message": "Transaction fee retrieved successfully",
"success": true,
"data": {
"fee": {
"amount": 50,
"currency": "NGN"
}
}
}{
"status": 400,
"message": "Validation failed",
"code": "ACCOUNT_RESTRICTED",
"errors": [
{
"path": [
"amount"
],
"message": "amount must be a whole number of smallest currency units (e.g. cents)"
}
]
}{
"status": 400,
"message": "Validation failed",
"code": "ACCOUNT_RESTRICTED",
"errors": [
{
"path": [
"amount"
],
"message": "amount must be a whole number of smallest currency units (e.g. cents)"
}
]
}Get Transaction Fee
Quotes the fee for a transaction before you execute it. Fees are configured per rail and per destination country, so send the withdrawal_method (or the beneficiaryId) you will actually pay out on.
curl --request POST \
--url https://api.rolla.xyz/api/v1/external/wallet/fee \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"currency": "NGN",
"transactionType": "withdrawal",
"amount": 5000
}
'import requests
url = "https://api.rolla.xyz/api/v1/external/wallet/fee"
payload = {
"currency": "NGN",
"transactionType": "withdrawal",
"amount": 5000
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({currency: 'NGN', transactionType: 'withdrawal', amount: 5000})
};
fetch('https://api.rolla.xyz/api/v1/external/wallet/fee', 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.rolla.xyz/api/v1/external/wallet/fee",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'currency' => 'NGN',
'transactionType' => 'withdrawal',
'amount' => 5000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.rolla.xyz/api/v1/external/wallet/fee"
payload := strings.NewReader("{\n \"currency\": \"NGN\",\n \"transactionType\": \"withdrawal\",\n \"amount\": 5000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.rolla.xyz/api/v1/external/wallet/fee")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"NGN\",\n \"transactionType\": \"withdrawal\",\n \"amount\": 5000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rolla.xyz/api/v1/external/wallet/fee")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"NGN\",\n \"transactionType\": \"withdrawal\",\n \"amount\": 5000\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"message": "Transaction fee retrieved successfully",
"success": true,
"data": {
"fee": {
"amount": 50,
"currency": "NGN"
}
}
}{
"status": 400,
"message": "Validation failed",
"code": "ACCOUNT_RESTRICTED",
"errors": [
{
"path": [
"amount"
],
"message": "amount must be a whole number of smallest currency units (e.g. cents)"
}
]
}{
"status": 400,
"message": "Validation failed",
"code": "ACCOUNT_RESTRICTED",
"errors": [
{
"path": [
"amount"
],
"message": "amount must be a whole number of smallest currency units (e.g. cents)"
}
]
}Example Request
curl -X POST "https://api.rolla.xyz/api/v1/external/wallet/fee" \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"currency": "NGN",
"transactionType": "withdrawal",
"amount": 5000
}'
Example Response
{
"status": 200,
"message": "Transaction fee retrieved successfully",
"success": true,
"data": {
"fee": {
"amount": 50,
"currency": "NGN"
}
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
currency | string | Yes | Code of the wallet being debited (3 or 4 letters, e.g. NGN, USDC) |
transactionType | string | Yes | deposit, withdrawal, swap, card_funding, or payin |
amount | number | Yes | Whole number of the smallest unit (kobo for NGN, cents for USD) |
recipientCurrency | string | No | For FX payouts — the currency the beneficiary receives |
withdrawal_method | string | No | The payout rail to price — see below |
destination_country | string | No | 2-letter country code of the destination bank |
beneficiaryId | string (UUID) | No | Quote a saved beneficiary; the rail and destination country are read from it |
Quoting a specific withdrawal method
Fees are configured per rail, so an ACH and a wire to the same bank are usually priced differently. Passwithdrawal_method to quote the rail you will actually send on:
withdrawal_method | Rail |
|---|---|
ach | Domestic US ACH — settles in business days, cheapest US rail |
domestic_wire | Domestic US wire (Fedwire) — same-day, priced above ACH |
international_wire | Cross-border wire (SWIFT) |
local_transfer | In-country transfer (e.g. NGN bank transfer) |
crypto_usdt / crypto_usdc | Stablecoin payout |
mobile_money | Mobile money payout |
rolla_transfer | Transfer to another Rolla account |
curl -X POST "https://api.rolla.xyz/api/v1/external/wallet/fee" \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"currency": "USD",
"transactionType": "withdrawal",
"amount": 100000,
"withdrawal_method": "ach",
"destination_country": "US"
}'
"ach" for "domestic_wire" or "international_wire" to compare rails before deciding which to send on — everything else in the request stays the same.
withdrawal_method quotes the currency-level fee, which may not be what the withdrawal is charged if a rail-specific fee applies to your account. Always send the rail you intend to use.Quoting a saved beneficiary
If you are paying a saved beneficiary, passbeneficiaryId instead and the rail and destination country are taken from that beneficiary — no need to restate them:
curl -X POST "https://api.rolla.xyz/api/v1/external/wallet/fee" \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"currency": "USD",
"transactionType": "withdrawal",
"amount": 100000,
"beneficiaryId": "c3d4e5f6-a7b8-9012-cdef-123456789012"
}'
destination_country still wins over the beneficiary’s own value when you send it. withdrawal_method does not: a withdrawal always prices off the beneficiary’s saved rail, so sending a withdrawal_method that contradicts it returns a 400 explaining which rail the payout will actually be charged as. Omit it, or update the beneficiary’s withdrawal_method first.
beneficiaryId returns a 400 rather than falling back to a default fee — a quote never silently prices a different rail than the withdrawal will use.FX payouts
For a cross-currency payout, addrecipientCurrency. The response then also carries feeInRecipientCurrency:
curl -X POST "https://api.rolla.xyz/api/v1/external/wallet/fee" \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"currency": "USD",
"transactionType": "withdrawal",
"amount": 100000,
"recipientCurrency": "NGN"
}'
withdrawal_method (or beneficiaryId) you will send to POST /wallet/withdraw so the quote matches the charge.Authorizations
Your Rolla API key
Body
Currency of the wallet being debited. Currency code, 3 or 4 letters, upper-cased by the server (for example NGN, USD, USDC).
3 - 4"NGN"
Type of transaction the fee is quoted for
deposit, withdrawal, swap, card_funding, payin "withdrawal"
Transaction amount, in the smallest unit of currency. Whole number of the smallest currency unit (kobo for NGN, cents for USD). Fractional values and amounts below 1 are rejected with a 400.
x >= 15000
For FX payouts, the currency the beneficiary receives. The response then also carries feeInRecipientCurrency.
3 - 4"NGN"
Two-letter country code of the destination bank, for fees scoped to a corridor. Upper-cased by the server.
2"US"
Payout rail to price. Fees are configured per rail, so an ACH and a wire to the same bank are usually priced differently; send the rail you will actually withdraw on. Omitted, the currency-level fee is quoted. Sending one that contradicts the saved rail of a beneficiaryId is rejected with a 400.
domestic_wire, international_wire, ach, local_transfer, crypto_usdt, crypto_usdc, rolla_transfer, mobile_money "ach"
Quote a saved beneficiary: destination_country and withdrawal_method are read from it when not supplied. The beneficiary must belong to your account, and an id that resolves to nothing returns a 400 rather than a default fee.
"c3d4e5f6-a7b8-9012-cdef-123456789012"