curl --request POST \
--url https://sandbox.users.niobi.co/api/payment-link-api/create \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"business_name": "ABC Ltd",
"item_name": "xyz",
"callback_url": "https://your-domain.com/niobi/result",
"redirection_url": "https://your-domain.com/niobi/result",
"logo": "image.png",
"amount": "integer",
"country_id": 123,
"currency": "<string>",
"correspondent": "<string>"
}
'import requests
url = "https://sandbox.users.niobi.co/api/payment-link-api/create"
payload = {
"business_name": "ABC Ltd",
"item_name": "xyz",
"callback_url": "https://your-domain.com/niobi/result",
"redirection_url": "https://your-domain.com/niobi/result",
"logo": "image.png",
"amount": "integer",
"country_id": 123,
"currency": "<string>",
"correspondent": "<string>"
}
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({
business_name: 'ABC Ltd',
item_name: 'xyz',
callback_url: 'https://your-domain.com/niobi/result',
redirection_url: 'https://your-domain.com/niobi/result',
logo: 'image.png',
amount: 'integer',
country_id: 123,
currency: '<string>',
correspondent: '<string>'
})
};
fetch('https://sandbox.users.niobi.co/api/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/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([
'business_name' => 'ABC Ltd',
'item_name' => 'xyz',
'callback_url' => 'https://your-domain.com/niobi/result',
'redirection_url' => 'https://your-domain.com/niobi/result',
'logo' => 'image.png',
'amount' => 'integer',
'country_id' => 123,
'currency' => '<string>',
'correspondent' => '<string>'
]),
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://sandbox.users.niobi.co/api/payment-link-api/create"
payload := strings.NewReader("{\n \"business_name\": \"ABC Ltd\",\n \"item_name\": \"xyz\",\n \"callback_url\": \"https://your-domain.com/niobi/result\",\n \"redirection_url\": \"https://your-domain.com/niobi/result\",\n \"logo\": \"image.png\",\n \"amount\": \"integer\",\n \"country_id\": 123,\n \"currency\": \"<string>\",\n \"correspondent\": \"<string>\"\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://sandbox.users.niobi.co/api/payment-link-api/create")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"business_name\": \"ABC Ltd\",\n \"item_name\": \"xyz\",\n \"callback_url\": \"https://your-domain.com/niobi/result\",\n \"redirection_url\": \"https://your-domain.com/niobi/result\",\n \"logo\": \"image.png\",\n \"amount\": \"integer\",\n \"country_id\": 123,\n \"currency\": \"<string>\",\n \"correspondent\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.users.niobi.co/api/payment-link-api/create")
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 \"business_name\": \"ABC Ltd\",\n \"item_name\": \"xyz\",\n \"callback_url\": \"https://your-domain.com/niobi/result\",\n \"redirection_url\": \"https://your-domain.com/niobi/result\",\n \"logo\": \"image.png\",\n \"amount\": \"integer\",\n \"country_id\": 123,\n \"currency\": \"<string>\",\n \"correspondent\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": "true",
"message": "Verification token was sent to your mobile number. Kindly verify to proceed with payment",
"data": {
"MerchantRequestID": "1234-123456789-1",
"CheckoutRequestID": "ab_XY_*******************",
"ResponseCode": "0",
"ResponseDescription": "Success. Request accepted for processing",
"CustomerMessage": "Success. Request accepted for processing"
}
}{
"success": "false",
"message": "message"
}{
"success": "false",
"message": "message"
}{
"success": "false",
"message": "message"
}{
"success": "false",
"message": "message"
}Niobi create payment-link
Niobi create payment-link
curl --request POST \
--url https://sandbox.users.niobi.co/api/payment-link-api/create \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"business_name": "ABC Ltd",
"item_name": "xyz",
"callback_url": "https://your-domain.com/niobi/result",
"redirection_url": "https://your-domain.com/niobi/result",
"logo": "image.png",
"amount": "integer",
"country_id": 123,
"currency": "<string>",
"correspondent": "<string>"
}
'import requests
url = "https://sandbox.users.niobi.co/api/payment-link-api/create"
payload = {
"business_name": "ABC Ltd",
"item_name": "xyz",
"callback_url": "https://your-domain.com/niobi/result",
"redirection_url": "https://your-domain.com/niobi/result",
"logo": "image.png",
"amount": "integer",
"country_id": 123,
"currency": "<string>",
"correspondent": "<string>"
}
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({
business_name: 'ABC Ltd',
item_name: 'xyz',
callback_url: 'https://your-domain.com/niobi/result',
redirection_url: 'https://your-domain.com/niobi/result',
logo: 'image.png',
amount: 'integer',
country_id: 123,
currency: '<string>',
correspondent: '<string>'
})
};
fetch('https://sandbox.users.niobi.co/api/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/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([
'business_name' => 'ABC Ltd',
'item_name' => 'xyz',
'callback_url' => 'https://your-domain.com/niobi/result',
'redirection_url' => 'https://your-domain.com/niobi/result',
'logo' => 'image.png',
'amount' => 'integer',
'country_id' => 123,
'currency' => '<string>',
'correspondent' => '<string>'
]),
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://sandbox.users.niobi.co/api/payment-link-api/create"
payload := strings.NewReader("{\n \"business_name\": \"ABC Ltd\",\n \"item_name\": \"xyz\",\n \"callback_url\": \"https://your-domain.com/niobi/result\",\n \"redirection_url\": \"https://your-domain.com/niobi/result\",\n \"logo\": \"image.png\",\n \"amount\": \"integer\",\n \"country_id\": 123,\n \"currency\": \"<string>\",\n \"correspondent\": \"<string>\"\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://sandbox.users.niobi.co/api/payment-link-api/create")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"business_name\": \"ABC Ltd\",\n \"item_name\": \"xyz\",\n \"callback_url\": \"https://your-domain.com/niobi/result\",\n \"redirection_url\": \"https://your-domain.com/niobi/result\",\n \"logo\": \"image.png\",\n \"amount\": \"integer\",\n \"country_id\": 123,\n \"currency\": \"<string>\",\n \"correspondent\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.users.niobi.co/api/payment-link-api/create")
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 \"business_name\": \"ABC Ltd\",\n \"item_name\": \"xyz\",\n \"callback_url\": \"https://your-domain.com/niobi/result\",\n \"redirection_url\": \"https://your-domain.com/niobi/result\",\n \"logo\": \"image.png\",\n \"amount\": \"integer\",\n \"country_id\": 123,\n \"currency\": \"<string>\",\n \"correspondent\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": "true",
"message": "Verification token was sent to your mobile number. Kindly verify to proceed with payment",
"data": {
"MerchantRequestID": "1234-123456789-1",
"CheckoutRequestID": "ab_XY_*******************",
"ResponseCode": "0",
"ResponseDescription": "Success. Request accepted for processing",
"CustomerMessage": "Success. Request accepted for processing"
}
}{
"success": "false",
"message": "message"
}{
"success": "false",
"message": "message"
}{
"success": "false",
"message": "message"
}{
"success": "false",
"message": "message"
}Authorizations
Enter token in format (Bearer )
Body
Create payment link.
This is your business name. Example: ABC Ltd
"ABC Ltd"
This is the name of the item billed and to be paid. Example: xyz
"xyz"
This is the callback url where you wish to receive the response. Example: https://your-domain.com/niobi/result
"https://your-domain.com/niobi/result"
This is the redirection url. Example: https://your-domain.com/niobi/result
"https://your-domain.com/niobi/result"
This is brand logo. Use the base64 format to upload a file of maximum 2MB size.
"image.png"
This is the amount of money to be paid by your customer. It should be in unit case i.e. *100 (e.g. Kes 10 should be input as Kes 1000)
"integer"
This is integer value. You can get country list from Niobi get-countries API
This is the currency in which the payment is to be made. Example: KES
This is the correspondent to be used for the payment. Example: MTM_MOMO_UGA

