Register a webhook endpoint
curl --request POST \
--url https://api-partner.onecluster.co/api/v1/collections/webhooks \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://yourapp.com/webhooks/ubn",
"events": [
"collection.credit",
"collection.reversal"
]
}
'import requests
url = "https://api-partner.onecluster.co/api/v1/collections/webhooks"
payload = {
"url": "https://yourapp.com/webhooks/ubn",
"events": ["collection.credit", "collection.reversal"]
}
headers = {
"Authorization": "<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>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://yourapp.com/webhooks/ubn',
events: ['collection.credit', 'collection.reversal']
})
};
fetch('https://api-partner.onecluster.co/api/v1/collections/webhooks', 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/webhooks",
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([
'url' => 'https://yourapp.com/webhooks/ubn',
'events' => [
'collection.credit',
'collection.reversal'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://yourapp.com/webhooks/ubn\",\n \"events\": [\n \"collection.credit\",\n \"collection.reversal\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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/webhooks")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://yourapp.com/webhooks/ubn\",\n \"events\": [\n \"collection.credit\",\n \"collection.reversal\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-partner.onecluster.co/api/v1/collections/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://yourapp.com/webhooks/ubn\",\n \"events\": [\n \"collection.credit\",\n \"collection.reversal\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"responseCode": "00",
"message": "Request processed successfully",
"data": {}
}{
"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"
}{
"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"
}{
"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
Register Webhook
Register a URL that we will call when money arrives in any of your collection accounts.
Requirements for your webhook endpoint:
- Must be HTTPS (not HTTP)
- Must return
200 OKwithin 30 seconds of receiving the notification - We test-ping your URL during registration, if it does not respond, registration fails
- Must verify the
X-Signatureheader on incoming webhooks (for security)
Retry behaviour: If your endpoint returns anything other than 200, we retry
with exponential backoff: 5s, 30s, 5min, 30min, 2h, 6h, 24h.
POST
/
api
/
v1
/
collections
/
webhooks
Register a webhook endpoint
curl --request POST \
--url https://api-partner.onecluster.co/api/v1/collections/webhooks \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://yourapp.com/webhooks/ubn",
"events": [
"collection.credit",
"collection.reversal"
]
}
'import requests
url = "https://api-partner.onecluster.co/api/v1/collections/webhooks"
payload = {
"url": "https://yourapp.com/webhooks/ubn",
"events": ["collection.credit", "collection.reversal"]
}
headers = {
"Authorization": "<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>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://yourapp.com/webhooks/ubn',
events: ['collection.credit', 'collection.reversal']
})
};
fetch('https://api-partner.onecluster.co/api/v1/collections/webhooks', 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/webhooks",
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([
'url' => 'https://yourapp.com/webhooks/ubn',
'events' => [
'collection.credit',
'collection.reversal'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://yourapp.com/webhooks/ubn\",\n \"events\": [\n \"collection.credit\",\n \"collection.reversal\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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/webhooks")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://yourapp.com/webhooks/ubn\",\n \"events\": [\n \"collection.credit\",\n \"collection.reversal\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-partner.onecluster.co/api/v1/collections/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://yourapp.com/webhooks/ubn\",\n \"events\": [\n \"collection.credit\",\n \"collection.reversal\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"responseCode": "00",
"message": "Request processed successfully",
"data": {}
}{
"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"
}{
"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"
}{
"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
Webhook registered. Test ping succeeded.
Standard response wrapper for all successful API calls

