Create beneficiary
curl --request POST \
--url https://api.onswitch.xyz/beneficiary/create \
--header 'Content-Type: application/json' \
--header 'x-service-key: <api-key>' \
--data '
{
"direction": "OFFRAMP",
"country": "NG",
"currency": "NGN",
"channel": "BANK",
"beneficiary": {
"holder_type": "INDIVIDUAL",
"holder_name": "Chinonso Adeyemi",
"account_number": "3048915627",
"bank_code": "058"
}
}
'import requests
url = "https://api.onswitch.xyz/beneficiary/create"
payload = {
"direction": "OFFRAMP",
"country": "NG",
"currency": "NGN",
"channel": "BANK",
"beneficiary": {
"holder_type": "INDIVIDUAL",
"holder_name": "Chinonso Adeyemi",
"account_number": "3048915627",
"bank_code": "058"
}
}
headers = {
"x-service-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-service-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
direction: 'OFFRAMP',
country: 'NG',
currency: 'NGN',
channel: 'BANK',
beneficiary: {
holder_type: 'INDIVIDUAL',
holder_name: 'Chinonso Adeyemi',
account_number: '3048915627',
bank_code: '058'
}
})
};
fetch('https://api.onswitch.xyz/beneficiary/create', 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.onswitch.xyz/beneficiary/create",
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([
'direction' => 'OFFRAMP',
'country' => 'NG',
'currency' => 'NGN',
'channel' => 'BANK',
'beneficiary' => [
'holder_type' => 'INDIVIDUAL',
'holder_name' => 'Chinonso Adeyemi',
'account_number' => '3048915627',
'bank_code' => '058'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-service-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.onswitch.xyz/beneficiary/create"
payload := strings.NewReader("{\n \"direction\": \"OFFRAMP\",\n \"country\": \"NG\",\n \"currency\": \"NGN\",\n \"channel\": \"BANK\",\n \"beneficiary\": {\n \"holder_type\": \"INDIVIDUAL\",\n \"holder_name\": \"Chinonso Adeyemi\",\n \"account_number\": \"3048915627\",\n \"bank_code\": \"058\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-service-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.onswitch.xyz/beneficiary/create")
.header("x-service-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"direction\": \"OFFRAMP\",\n \"country\": \"NG\",\n \"currency\": \"NGN\",\n \"channel\": \"BANK\",\n \"beneficiary\": {\n \"holder_type\": \"INDIVIDUAL\",\n \"holder_name\": \"Chinonso Adeyemi\",\n \"account_number\": \"3048915627\",\n \"bank_code\": \"058\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onswitch.xyz/beneficiary/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-service-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"direction\": \"OFFRAMP\",\n \"country\": \"NG\",\n \"currency\": \"NGN\",\n \"channel\": \"BANK\",\n \"beneficiary\": {\n \"holder_type\": \"INDIVIDUAL\",\n \"holder_name\": \"Chinonso Adeyemi\",\n \"account_number\": \"3048915627\",\n \"bank_code\": \"058\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"data": {
"id": "<string>"
}
}{
"success": false,
"message": "amount must be greater than 0 for the selected corridor",
"timestamp": "2026-04-18T14:22:08.631Z",
"data": null
}Create beneficiary
Create and save a beneficiary details for future payments.
POST
/
beneficiary
/
create
Create beneficiary
curl --request POST \
--url https://api.onswitch.xyz/beneficiary/create \
--header 'Content-Type: application/json' \
--header 'x-service-key: <api-key>' \
--data '
{
"direction": "OFFRAMP",
"country": "NG",
"currency": "NGN",
"channel": "BANK",
"beneficiary": {
"holder_type": "INDIVIDUAL",
"holder_name": "Chinonso Adeyemi",
"account_number": "3048915627",
"bank_code": "058"
}
}
'import requests
url = "https://api.onswitch.xyz/beneficiary/create"
payload = {
"direction": "OFFRAMP",
"country": "NG",
"currency": "NGN",
"channel": "BANK",
"beneficiary": {
"holder_type": "INDIVIDUAL",
"holder_name": "Chinonso Adeyemi",
"account_number": "3048915627",
"bank_code": "058"
}
}
headers = {
"x-service-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-service-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
direction: 'OFFRAMP',
country: 'NG',
currency: 'NGN',
channel: 'BANK',
beneficiary: {
holder_type: 'INDIVIDUAL',
holder_name: 'Chinonso Adeyemi',
account_number: '3048915627',
bank_code: '058'
}
})
};
fetch('https://api.onswitch.xyz/beneficiary/create', 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.onswitch.xyz/beneficiary/create",
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([
'direction' => 'OFFRAMP',
'country' => 'NG',
'currency' => 'NGN',
'channel' => 'BANK',
'beneficiary' => [
'holder_type' => 'INDIVIDUAL',
'holder_name' => 'Chinonso Adeyemi',
'account_number' => '3048915627',
'bank_code' => '058'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-service-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.onswitch.xyz/beneficiary/create"
payload := strings.NewReader("{\n \"direction\": \"OFFRAMP\",\n \"country\": \"NG\",\n \"currency\": \"NGN\",\n \"channel\": \"BANK\",\n \"beneficiary\": {\n \"holder_type\": \"INDIVIDUAL\",\n \"holder_name\": \"Chinonso Adeyemi\",\n \"account_number\": \"3048915627\",\n \"bank_code\": \"058\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-service-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.onswitch.xyz/beneficiary/create")
.header("x-service-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"direction\": \"OFFRAMP\",\n \"country\": \"NG\",\n \"currency\": \"NGN\",\n \"channel\": \"BANK\",\n \"beneficiary\": {\n \"holder_type\": \"INDIVIDUAL\",\n \"holder_name\": \"Chinonso Adeyemi\",\n \"account_number\": \"3048915627\",\n \"bank_code\": \"058\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onswitch.xyz/beneficiary/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-service-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"direction\": \"OFFRAMP\",\n \"country\": \"NG\",\n \"currency\": \"NGN\",\n \"channel\": \"BANK\",\n \"beneficiary\": {\n \"holder_type\": \"INDIVIDUAL\",\n \"holder_name\": \"Chinonso Adeyemi\",\n \"account_number\": \"3048915627\",\n \"bank_code\": \"058\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"data": {
"id": "<string>"
}
}{
"success": false,
"message": "amount must be greater than 0 for the selected corridor",
"timestamp": "2026-04-18T14:22:08.631Z",
"data": null
}Authorizations
Service key for API authentication
Body
application/json
Available options:
OFFRAMP, ONRAMP Available options:
BJ, CD, CI, CM, ET, GA, GH, GM, GN, KE, LR, ML, MW, NG, RW, SL, SN, TZ, UG, ZA, ZM Beneficiary details.
- Receive to saved beneficiary
- Receive to NGN bank account
- Receive to GHS mobile money
- Receive to other destinations
- Receive to external wallet
Hide child attributes
Hide child attributes
Unique identifier for the beneficiary
Pattern:
^[a-f0-9]{24}$Available options:
CDF, ETB, GHS, GMD, GNF, KES, LRD, MWK, NGN, RWF, SLE, TZS, UGX, USD, XAF, XOF, ZAR, ZMW Available options:
BANK, MOBILEMONEY ⌘I