curl --request POST \
--url https://sandbox.users.niobi.co/api/v3/payment-link-api/create \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "K1PoY1WYricSpXh6Wm24twnk6ecPJOWrHGsqiKJr",
"salt": "justrandomstring",
"sender": "John.co",
"params": {
"business_name": "my business",
"item_name": "item name",
"callback_url": "https://webhook.site/unique-id",
"redirection_url": "https://webhook.site/unique-id",
"currency": "KES",
"amount": "5000",
"logo": "This is brand logo. Use the base64 format to upload a file of maximum 2MB size.",
"country_id": "This is integer value. You can get country id from supported country table attached here.",
"currency_country_id": "This is integer value which represent country user is making deposit from and corresponds to the selected currency. You can get country id from supported country table attached here.",
"first_name": "KES",
"last_name": "KES",
"email": "KES",
"phone": "KES"
},
"timestamp": 1709363033,
"signature": "2193d01d50d4bd5da234ac0e0add5d4ccb40907a1b1ab27a12d2c1d88a5d5807"
}
'import requests
url = "https://sandbox.users.niobi.co/api/v3/payment-link-api/create"
payload = {
"client_id": "K1PoY1WYricSpXh6Wm24twnk6ecPJOWrHGsqiKJr",
"salt": "justrandomstring",
"sender": "John.co",
"params": {
"business_name": "my business",
"item_name": "item name",
"callback_url": "https://webhook.site/unique-id",
"redirection_url": "https://webhook.site/unique-id",
"currency": "KES",
"amount": "5000",
"logo": "This is brand logo. Use the base64 format to upload a file of maximum 2MB size.",
"country_id": "This is integer value. You can get country id from supported country table attached here.",
"currency_country_id": "This is integer value which represent country user is making deposit from and corresponds to the selected currency. You can get country id from supported country table attached here.",
"first_name": "KES",
"last_name": "KES",
"email": "KES",
"phone": "KES"
},
"timestamp": 1709363033,
"signature": "2193d01d50d4bd5da234ac0e0add5d4ccb40907a1b1ab27a12d2c1d88a5d5807"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
client_id: 'K1PoY1WYricSpXh6Wm24twnk6ecPJOWrHGsqiKJr',
salt: 'justrandomstring',
sender: 'John.co',
params: {
business_name: 'my business',
item_name: 'item name',
callback_url: 'https://webhook.site/unique-id',
redirection_url: 'https://webhook.site/unique-id',
currency: 'KES',
amount: '5000',
logo: 'This is brand logo. Use the base64 format to upload a file of maximum 2MB size.',
country_id: 'This is integer value. You can get country id from supported country table attached here.',
currency_country_id: 'This is integer value which represent country user is making deposit from and corresponds to the selected currency. You can get country id from supported country table attached here.',
first_name: 'KES',
last_name: 'KES',
email: 'KES',
phone: 'KES'
},
timestamp: 1709363033,
signature: '2193d01d50d4bd5da234ac0e0add5d4ccb40907a1b1ab27a12d2c1d88a5d5807'
})
};
fetch('https://sandbox.users.niobi.co/api/v3/payment-link-api/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://sandbox.users.niobi.co/api/v3/payment-link-api/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([
'client_id' => 'K1PoY1WYricSpXh6Wm24twnk6ecPJOWrHGsqiKJr',
'salt' => 'justrandomstring',
'sender' => 'John.co',
'params' => [
'business_name' => 'my business',
'item_name' => 'item name',
'callback_url' => 'https://webhook.site/unique-id',
'redirection_url' => 'https://webhook.site/unique-id',
'currency' => 'KES',
'amount' => '5000',
'logo' => 'This is brand logo. Use the base64 format to upload a file of maximum 2MB size.',
'country_id' => 'This is integer value. You can get country id from supported country table attached here.',
'currency_country_id' => 'This is integer value which represent country user is making deposit from and corresponds to the selected currency. You can get country id from supported country table attached here.',
'first_name' => 'KES',
'last_name' => 'KES',
'email' => 'KES',
'phone' => 'KES'
],
'timestamp' => 1709363033,
'signature' => '2193d01d50d4bd5da234ac0e0add5d4ccb40907a1b1ab27a12d2c1d88a5d5807'
]),
CURLOPT_HTTPHEADER => [
"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://sandbox.users.niobi.co/api/v3/payment-link-api/create"
payload := strings.NewReader("{\n \"client_id\": \"K1PoY1WYricSpXh6Wm24twnk6ecPJOWrHGsqiKJr\",\n \"salt\": \"justrandomstring\",\n \"sender\": \"John.co\",\n \"params\": {\n \"business_name\": \"my business\",\n \"item_name\": \"item name\",\n \"callback_url\": \"https://webhook.site/unique-id\",\n \"redirection_url\": \"https://webhook.site/unique-id\",\n \"currency\": \"KES\",\n \"amount\": \"5000\",\n \"logo\": \"This is brand logo. Use the base64 format to upload a file of maximum 2MB size.\",\n \"country_id\": \"This is integer value. You can get country id from supported country table attached here.\",\n \"currency_country_id\": \"This is integer value which represent country user is making deposit from and corresponds to the selected currency. You can get country id from supported country table attached here.\",\n \"first_name\": \"KES\",\n \"last_name\": \"KES\",\n \"email\": \"KES\",\n \"phone\": \"KES\"\n },\n \"timestamp\": 1709363033,\n \"signature\": \"2193d01d50d4bd5da234ac0e0add5d4ccb40907a1b1ab27a12d2c1d88a5d5807\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://sandbox.users.niobi.co/api/v3/payment-link-api/create")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"K1PoY1WYricSpXh6Wm24twnk6ecPJOWrHGsqiKJr\",\n \"salt\": \"justrandomstring\",\n \"sender\": \"John.co\",\n \"params\": {\n \"business_name\": \"my business\",\n \"item_name\": \"item name\",\n \"callback_url\": \"https://webhook.site/unique-id\",\n \"redirection_url\": \"https://webhook.site/unique-id\",\n \"currency\": \"KES\",\n \"amount\": \"5000\",\n \"logo\": \"This is brand logo. Use the base64 format to upload a file of maximum 2MB size.\",\n \"country_id\": \"This is integer value. You can get country id from supported country table attached here.\",\n \"currency_country_id\": \"This is integer value which represent country user is making deposit from and corresponds to the selected currency. You can get country id from supported country table attached here.\",\n \"first_name\": \"KES\",\n \"last_name\": \"KES\",\n \"email\": \"KES\",\n \"phone\": \"KES\"\n },\n \"timestamp\": 1709363033,\n \"signature\": \"2193d01d50d4bd5da234ac0e0add5d4ccb40907a1b1ab27a12d2c1d88a5d5807\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.users.niobi.co/api/v3/payment-link-api/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_id\": \"K1PoY1WYricSpXh6Wm24twnk6ecPJOWrHGsqiKJr\",\n \"salt\": \"justrandomstring\",\n \"sender\": \"John.co\",\n \"params\": {\n \"business_name\": \"my business\",\n \"item_name\": \"item name\",\n \"callback_url\": \"https://webhook.site/unique-id\",\n \"redirection_url\": \"https://webhook.site/unique-id\",\n \"currency\": \"KES\",\n \"amount\": \"5000\",\n \"logo\": \"This is brand logo. Use the base64 format to upload a file of maximum 2MB size.\",\n \"country_id\": \"This is integer value. You can get country id from supported country table attached here.\",\n \"currency_country_id\": \"This is integer value which represent country user is making deposit from and corresponds to the selected currency. You can get country id from supported country table attached here.\",\n \"first_name\": \"KES\",\n \"last_name\": \"KES\",\n \"email\": \"KES\",\n \"phone\": \"KES\"\n },\n \"timestamp\": 1709363033,\n \"signature\": \"2193d01d50d4bd5da234ac0e0add5d4ccb40907a1b1ab27a12d2c1d88a5d5807\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Payment link created successfully.",
"data": {}
}{
"success": false,
"message": "Payment link was not created."
}{
"success": false,
"message": "Entity integration record not found."
}Create Payment Link v3
The new version of the Create Payment Link API allows you to pass customer details -such as name, email, or phone number - so that the generated payment link is prefilled with this information.
curl --request POST \
--url https://sandbox.users.niobi.co/api/v3/payment-link-api/create \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "K1PoY1WYricSpXh6Wm24twnk6ecPJOWrHGsqiKJr",
"salt": "justrandomstring",
"sender": "John.co",
"params": {
"business_name": "my business",
"item_name": "item name",
"callback_url": "https://webhook.site/unique-id",
"redirection_url": "https://webhook.site/unique-id",
"currency": "KES",
"amount": "5000",
"logo": "This is brand logo. Use the base64 format to upload a file of maximum 2MB size.",
"country_id": "This is integer value. You can get country id from supported country table attached here.",
"currency_country_id": "This is integer value which represent country user is making deposit from and corresponds to the selected currency. You can get country id from supported country table attached here.",
"first_name": "KES",
"last_name": "KES",
"email": "KES",
"phone": "KES"
},
"timestamp": 1709363033,
"signature": "2193d01d50d4bd5da234ac0e0add5d4ccb40907a1b1ab27a12d2c1d88a5d5807"
}
'import requests
url = "https://sandbox.users.niobi.co/api/v3/payment-link-api/create"
payload = {
"client_id": "K1PoY1WYricSpXh6Wm24twnk6ecPJOWrHGsqiKJr",
"salt": "justrandomstring",
"sender": "John.co",
"params": {
"business_name": "my business",
"item_name": "item name",
"callback_url": "https://webhook.site/unique-id",
"redirection_url": "https://webhook.site/unique-id",
"currency": "KES",
"amount": "5000",
"logo": "This is brand logo. Use the base64 format to upload a file of maximum 2MB size.",
"country_id": "This is integer value. You can get country id from supported country table attached here.",
"currency_country_id": "This is integer value which represent country user is making deposit from and corresponds to the selected currency. You can get country id from supported country table attached here.",
"first_name": "KES",
"last_name": "KES",
"email": "KES",
"phone": "KES"
},
"timestamp": 1709363033,
"signature": "2193d01d50d4bd5da234ac0e0add5d4ccb40907a1b1ab27a12d2c1d88a5d5807"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
client_id: 'K1PoY1WYricSpXh6Wm24twnk6ecPJOWrHGsqiKJr',
salt: 'justrandomstring',
sender: 'John.co',
params: {
business_name: 'my business',
item_name: 'item name',
callback_url: 'https://webhook.site/unique-id',
redirection_url: 'https://webhook.site/unique-id',
currency: 'KES',
amount: '5000',
logo: 'This is brand logo. Use the base64 format to upload a file of maximum 2MB size.',
country_id: 'This is integer value. You can get country id from supported country table attached here.',
currency_country_id: 'This is integer value which represent country user is making deposit from and corresponds to the selected currency. You can get country id from supported country table attached here.',
first_name: 'KES',
last_name: 'KES',
email: 'KES',
phone: 'KES'
},
timestamp: 1709363033,
signature: '2193d01d50d4bd5da234ac0e0add5d4ccb40907a1b1ab27a12d2c1d88a5d5807'
})
};
fetch('https://sandbox.users.niobi.co/api/v3/payment-link-api/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://sandbox.users.niobi.co/api/v3/payment-link-api/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([
'client_id' => 'K1PoY1WYricSpXh6Wm24twnk6ecPJOWrHGsqiKJr',
'salt' => 'justrandomstring',
'sender' => 'John.co',
'params' => [
'business_name' => 'my business',
'item_name' => 'item name',
'callback_url' => 'https://webhook.site/unique-id',
'redirection_url' => 'https://webhook.site/unique-id',
'currency' => 'KES',
'amount' => '5000',
'logo' => 'This is brand logo. Use the base64 format to upload a file of maximum 2MB size.',
'country_id' => 'This is integer value. You can get country id from supported country table attached here.',
'currency_country_id' => 'This is integer value which represent country user is making deposit from and corresponds to the selected currency. You can get country id from supported country table attached here.',
'first_name' => 'KES',
'last_name' => 'KES',
'email' => 'KES',
'phone' => 'KES'
],
'timestamp' => 1709363033,
'signature' => '2193d01d50d4bd5da234ac0e0add5d4ccb40907a1b1ab27a12d2c1d88a5d5807'
]),
CURLOPT_HTTPHEADER => [
"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://sandbox.users.niobi.co/api/v3/payment-link-api/create"
payload := strings.NewReader("{\n \"client_id\": \"K1PoY1WYricSpXh6Wm24twnk6ecPJOWrHGsqiKJr\",\n \"salt\": \"justrandomstring\",\n \"sender\": \"John.co\",\n \"params\": {\n \"business_name\": \"my business\",\n \"item_name\": \"item name\",\n \"callback_url\": \"https://webhook.site/unique-id\",\n \"redirection_url\": \"https://webhook.site/unique-id\",\n \"currency\": \"KES\",\n \"amount\": \"5000\",\n \"logo\": \"This is brand logo. Use the base64 format to upload a file of maximum 2MB size.\",\n \"country_id\": \"This is integer value. You can get country id from supported country table attached here.\",\n \"currency_country_id\": \"This is integer value which represent country user is making deposit from and corresponds to the selected currency. You can get country id from supported country table attached here.\",\n \"first_name\": \"KES\",\n \"last_name\": \"KES\",\n \"email\": \"KES\",\n \"phone\": \"KES\"\n },\n \"timestamp\": 1709363033,\n \"signature\": \"2193d01d50d4bd5da234ac0e0add5d4ccb40907a1b1ab27a12d2c1d88a5d5807\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://sandbox.users.niobi.co/api/v3/payment-link-api/create")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"K1PoY1WYricSpXh6Wm24twnk6ecPJOWrHGsqiKJr\",\n \"salt\": \"justrandomstring\",\n \"sender\": \"John.co\",\n \"params\": {\n \"business_name\": \"my business\",\n \"item_name\": \"item name\",\n \"callback_url\": \"https://webhook.site/unique-id\",\n \"redirection_url\": \"https://webhook.site/unique-id\",\n \"currency\": \"KES\",\n \"amount\": \"5000\",\n \"logo\": \"This is brand logo. Use the base64 format to upload a file of maximum 2MB size.\",\n \"country_id\": \"This is integer value. You can get country id from supported country table attached here.\",\n \"currency_country_id\": \"This is integer value which represent country user is making deposit from and corresponds to the selected currency. You can get country id from supported country table attached here.\",\n \"first_name\": \"KES\",\n \"last_name\": \"KES\",\n \"email\": \"KES\",\n \"phone\": \"KES\"\n },\n \"timestamp\": 1709363033,\n \"signature\": \"2193d01d50d4bd5da234ac0e0add5d4ccb40907a1b1ab27a12d2c1d88a5d5807\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.users.niobi.co/api/v3/payment-link-api/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_id\": \"K1PoY1WYricSpXh6Wm24twnk6ecPJOWrHGsqiKJr\",\n \"salt\": \"justrandomstring\",\n \"sender\": \"John.co\",\n \"params\": {\n \"business_name\": \"my business\",\n \"item_name\": \"item name\",\n \"callback_url\": \"https://webhook.site/unique-id\",\n \"redirection_url\": \"https://webhook.site/unique-id\",\n \"currency\": \"KES\",\n \"amount\": \"5000\",\n \"logo\": \"This is brand logo. Use the base64 format to upload a file of maximum 2MB size.\",\n \"country_id\": \"This is integer value. You can get country id from supported country table attached here.\",\n \"currency_country_id\": \"This is integer value which represent country user is making deposit from and corresponds to the selected currency. You can get country id from supported country table attached here.\",\n \"first_name\": \"KES\",\n \"last_name\": \"KES\",\n \"email\": \"KES\",\n \"phone\": \"KES\"\n },\n \"timestamp\": 1709363033,\n \"signature\": \"2193d01d50d4bd5da234ac0e0add5d4ccb40907a1b1ab27a12d2c1d88a5d5807\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Payment link created successfully.",
"data": {}
}{
"success": false,
"message": "Payment link was not created."
}{
"success": false,
"message": "Entity integration record not found."
}signature whenever you are creating a new balance request.Currency Country ID (Optional)
currency_country_id identifies the country of the payer (customer), based on the selected currency. It is used to support multi-country currency scenarios and ensures payments are routed correctly depending on the payer’s location.
For backward compatibility, this field is optional; if omitted the system will infer the country from currency and country_id where possible.List of Supported Countries
| Country Id | Country | Country Code | Currency | Payment Method type | Required Fields |
|---|---|---|---|---|---|
| 1 | Kenya | 254 | KES | till number, pay bill, pesalink, send money | country_id, currency |
| 2 | Benin | 229 | XOF | mtn | country_id, currency |
| 3 | Cote D’Ivoire | 225 | XOF | mtn, Orange | country_id, currency |
| 4 | Cameroon | 237 | XAF | mtn, Orange | country_id, currency |
| 9 | Senegal | 221 | XOF | Orange, Free | country_id, currency |
| 10 | Tanzania | 255 | TZS | Airtel, Halotel, Tigo | country_id, currency |
| 11 | Uganda | 256 | UGX | mtn, Airtel | country_id, currency |
| 12 | Zambia | 260 | ZMW | Zamtel, mtn | country_id, currency |
| 13 | Sierra Leone | 232 | SLE | Orange | country_id, currency |
| 16 | Ghana | 233 | GHS | mtn, AT, Vodafone | country_id, currency |
| 17 | Nigeria | 234 | NGN | bank | country_id, currency |
Body
Payload for creating a payment link for API
The Client id is your public key which is generated when you are creating a new API integration from our app.
"K1PoY1WYricSpXh6Wm24twnk6ecPJOWrHGsqiKJr"
Salt is used for security purposes. This is a random string and can be unique value for each request or always the same.
"justrandomstring"
The Sender is the title of the API Integration which was created through our app. you can just copy this title and use it whenever making a new signature
"John.co"
Show child attributes
Show child attributes
this is the current timestamp when the request is being made
1709363033
"2193d01d50d4bd5da234ac0e0add5d4ccb40907a1b1ab27a12d2c1d88a5d5807"

