Create a collection account
curl --request POST \
--url https://api-partner.onecluster.co/api/v1/collections/accounts \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: <x-idempotency-key>' \
--data '
{
"partnerId": "9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
"accountType": "STATIC"
}
'import requests
url = "https://api-partner.onecluster.co/api/v1/collections/accounts"
payload = {
"partnerId": "9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
"accountType": "STATIC"
}
headers = {
"X-Idempotency-Key": "<x-idempotency-key>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Idempotency-Key': '<x-idempotency-key>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({partnerId: '9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d', accountType: 'STATIC'})
};
fetch('https://api-partner.onecluster.co/api/v1/collections/accounts', 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-partner.onecluster.co/api/v1/collections/accounts",
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([
'partnerId' => '9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d',
'accountType' => 'STATIC'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"X-Idempotency-Key: <x-idempotency-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-partner.onecluster.co/api/v1/collections/accounts"
payload := strings.NewReader("{\n \"partnerId\": \"9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d\",\n \"accountType\": \"STATIC\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Idempotency-Key", "<x-idempotency-key>")
req.Header.Add("Authorization", "<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-partner.onecluster.co/api/v1/collections/accounts")
.header("X-Idempotency-Key", "<x-idempotency-key>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"partnerId\": \"9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d\",\n \"accountType\": \"STATIC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-partner.onecluster.co/api/v1/collections/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Idempotency-Key"] = '<x-idempotency-key>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"partnerId\": \"9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d\",\n \"accountType\": \"STATIC\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"responseCode": "00",
"message": "Collection account created",
"data": {
"accountNumber": "9876543210",
"bankCode": "032",
"bankName": "Union Bank of Nigeria",
"accountType": "STATIC"
}
}{
"type": "https://api.onecluster.co/errors/insufficient-funds",
"title": "Insufficient Funds",
"status": 422,
"detail": "The account balance is ₦0.00. You need at least ₦50,000.00 to complete this transfer.",
"instance": "/api/v1/payments/transfer",
"correlationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "INSUFFICIENT_FUNDS"
}Collections Endpoints
Create Collection Account
Creates a virtual account specifically for receiving money (collections).
When someone sends money to this account number, you receive a webhook notification with the payment details in real time.
Use cases:
- Assign each customer their own unique receiving account (STATIC)
- Generate a payment link that expires after a set time (DYNAMIC)
POST
/
api
/
v1
/
collections
/
accounts
Create a collection account
curl --request POST \
--url https://api-partner.onecluster.co/api/v1/collections/accounts \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: <x-idempotency-key>' \
--data '
{
"partnerId": "9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
"accountType": "STATIC"
}
'import requests
url = "https://api-partner.onecluster.co/api/v1/collections/accounts"
payload = {
"partnerId": "9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
"accountType": "STATIC"
}
headers = {
"X-Idempotency-Key": "<x-idempotency-key>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Idempotency-Key': '<x-idempotency-key>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({partnerId: '9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d', accountType: 'STATIC'})
};
fetch('https://api-partner.onecluster.co/api/v1/collections/accounts', 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-partner.onecluster.co/api/v1/collections/accounts",
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([
'partnerId' => '9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d',
'accountType' => 'STATIC'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"X-Idempotency-Key: <x-idempotency-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-partner.onecluster.co/api/v1/collections/accounts"
payload := strings.NewReader("{\n \"partnerId\": \"9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d\",\n \"accountType\": \"STATIC\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Idempotency-Key", "<x-idempotency-key>")
req.Header.Add("Authorization", "<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-partner.onecluster.co/api/v1/collections/accounts")
.header("X-Idempotency-Key", "<x-idempotency-key>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"partnerId\": \"9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d\",\n \"accountType\": \"STATIC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-partner.onecluster.co/api/v1/collections/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Idempotency-Key"] = '<x-idempotency-key>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"partnerId\": \"9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d\",\n \"accountType\": \"STATIC\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"responseCode": "00",
"message": "Collection account created",
"data": {
"accountNumber": "9876543210",
"bankCode": "032",
"bankName": "Union Bank of Nigeria",
"accountType": "STATIC"
}
}{
"type": "https://api.onecluster.co/errors/insufficient-funds",
"title": "Insufficient Funds",
"status": 422,
"detail": "The account balance is ₦0.00. You need at least ₦50,000.00 to complete this transfer.",
"instance": "/api/v1/payments/transfer",
"correlationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "INSUFFICIENT_FUNDS"
}Authorizations
Headers
Body
application/json
Response
Collection account created
Standard response wrapper for all successful API calls

