Create A Subaccount
curl --request POST \
--url https://api.payaza.africa/live/payaza-account/api/v1/subaccounts/merchant \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'X-TenantID: <api-key>' \
--data '
{
"mainAccountPayazaReference": "100000000",
"name": "Test Sub Account",
"currency": "NGN",
"country": "NGA"
}
'import requests
url = "https://api.payaza.africa/live/payaza-account/api/v1/subaccounts/merchant"
payload = {
"mainAccountPayazaReference": "100000000",
"name": "Test Sub Account",
"currency": "NGN",
"country": "NGA"
}
headers = {
"Authorization": "<api-key>",
"X-TenantID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'X-TenantID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
mainAccountPayazaReference: '100000000',
name: 'Test Sub Account',
currency: 'NGN',
country: 'NGA'
})
};
fetch('https://api.payaza.africa/live/payaza-account/api/v1/subaccounts/merchant', 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.payaza.africa/live/payaza-account/api/v1/subaccounts/merchant",
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([
'mainAccountPayazaReference' => '100000000',
'name' => 'Test Sub Account',
'currency' => 'NGN',
'country' => 'NGA'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"X-TenantID: <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.payaza.africa/live/payaza-account/api/v1/subaccounts/merchant"
payload := strings.NewReader("{\n \"mainAccountPayazaReference\": \"100000000\",\n \"name\": \"Test Sub Account\",\n \"currency\": \"NGN\",\n \"country\": \"NGA\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("X-TenantID", "<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.payaza.africa/live/payaza-account/api/v1/subaccounts/merchant")
.header("Authorization", "<api-key>")
.header("X-TenantID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mainAccountPayazaReference\": \"100000000\",\n \"name\": \"Test Sub Account\",\n \"currency\": \"NGN\",\n \"country\": \"NGA\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.payaza.africa/live/payaza-account/api/v1/subaccounts/merchant")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["X-TenantID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mainAccountPayazaReference\": \"100000000\",\n \"name\": \"Test Sub Account\",\n \"currency\": \"NGN\",\n \"country\": \"NGA\"\n}"
response = http.request(request)
puts response.read_body{
"message": "New account created",
"status": true,
"data": [
{
"id": 1110,
"accountName": "Test Sub Account",
"accountStatus": "ACTIVE",
"accountBalance": 0,
"escrowBalance": 0,
"businessFk": 11407,
"currency": "NGN",
"owner": "PAYAZA",
"country": "NGA",
"creationReference": "DC625576B5BF426A94CB6B1D868C0",
"actionStatus": "ACTIVE",
"payazaAccountReference": "2010000120",
"pnc": false,
"pnd": false,
"virtualAccounts": [
{
"accountNumber": "9977719429",
"accountName": "MERCHANT(Test Sub Account)",
"bankCode": "000023"
}
]
}
]
}Sub Accounts
Create A Subaccount
This endpoint is used to create a subaccount.
Notes:
- Please be advised that access to this API is available upon request. To initiate this process, kindly send an email to support@payaza.africa. You will be granted access once our team reviews and approves your request.
POST
/
payaza-account
/
api
/
v1
/
subaccounts
/
merchant
Create A Subaccount
curl --request POST \
--url https://api.payaza.africa/live/payaza-account/api/v1/subaccounts/merchant \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'X-TenantID: <api-key>' \
--data '
{
"mainAccountPayazaReference": "100000000",
"name": "Test Sub Account",
"currency": "NGN",
"country": "NGA"
}
'import requests
url = "https://api.payaza.africa/live/payaza-account/api/v1/subaccounts/merchant"
payload = {
"mainAccountPayazaReference": "100000000",
"name": "Test Sub Account",
"currency": "NGN",
"country": "NGA"
}
headers = {
"Authorization": "<api-key>",
"X-TenantID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'X-TenantID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
mainAccountPayazaReference: '100000000',
name: 'Test Sub Account',
currency: 'NGN',
country: 'NGA'
})
};
fetch('https://api.payaza.africa/live/payaza-account/api/v1/subaccounts/merchant', 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.payaza.africa/live/payaza-account/api/v1/subaccounts/merchant",
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([
'mainAccountPayazaReference' => '100000000',
'name' => 'Test Sub Account',
'currency' => 'NGN',
'country' => 'NGA'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"X-TenantID: <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.payaza.africa/live/payaza-account/api/v1/subaccounts/merchant"
payload := strings.NewReader("{\n \"mainAccountPayazaReference\": \"100000000\",\n \"name\": \"Test Sub Account\",\n \"currency\": \"NGN\",\n \"country\": \"NGA\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("X-TenantID", "<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.payaza.africa/live/payaza-account/api/v1/subaccounts/merchant")
.header("Authorization", "<api-key>")
.header("X-TenantID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mainAccountPayazaReference\": \"100000000\",\n \"name\": \"Test Sub Account\",\n \"currency\": \"NGN\",\n \"country\": \"NGA\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.payaza.africa/live/payaza-account/api/v1/subaccounts/merchant")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["X-TenantID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mainAccountPayazaReference\": \"100000000\",\n \"name\": \"Test Sub Account\",\n \"currency\": \"NGN\",\n \"country\": \"NGA\"\n}"
response = http.request(request)
puts response.read_body{
"message": "New account created",
"status": true,
"data": [
{
"id": 1110,
"accountName": "Test Sub Account",
"accountStatus": "ACTIVE",
"accountBalance": 0,
"escrowBalance": 0,
"businessFk": 11407,
"currency": "NGN",
"owner": "PAYAZA",
"country": "NGA",
"creationReference": "DC625576B5BF426A94CB6B1D868C0",
"actionStatus": "ACTIVE",
"payazaAccountReference": "2010000120",
"pnc": false,
"pnd": false,
"virtualAccounts": [
{
"accountNumber": "9977719429",
"accountName": "MERCHANT(Test Sub Account)",
"bankCode": "000023"
}
]
}
]
}Authorizations
Payaza {{Public API Key in Base 64}}
live or test
Body
application/json
The account reference of the main Payaza account.
Example:
"100000000"
The name of the sub-account being created.
Example:
"Test Sub Account"
The currency code.
Example:
"NGN"
The country code in ISO 3166-1 alpha-3 format (e.g., NGA).
Example:
"NGA"
⌘I