Create a Bill Order
curl --request POST \
--url https://pesahub.co/api/v1/payments/billpay \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"payment_number": "<string>",
"payment_mode": {},
"description": "<string>",
"metadata": {
"order_id": "<string>",
"customer_note": "<string>"
}
}
'import requests
url = "https://pesahub.co/api/v1/payments/billpay"
payload = {
"amount": 123,
"payment_number": "<string>",
"payment_mode": {},
"description": "<string>",
"metadata": {
"order_id": "<string>",
"customer_note": "<string>"
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 123,
payment_number: '<string>',
payment_mode: {},
description: '<string>',
metadata: {order_id: '<string>', customer_note: '<string>'}
})
};
fetch('https://pesahub.co/api/v1/payments/billpay', 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://pesahub.co/api/v1/payments/billpay",
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([
'amount' => 123,
'payment_number' => '<string>',
'payment_mode' => [
],
'description' => '<string>',
'metadata' => [
'order_id' => '<string>',
'customer_note' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://pesahub.co/api/v1/payments/billpay"
payload := strings.NewReader("{\n \"amount\": 123,\n \"payment_number\": \"<string>\",\n \"payment_mode\": {},\n \"description\": \"<string>\",\n \"metadata\": {\n \"order_id\": \"<string>\",\n \"customer_note\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://pesahub.co/api/v1/payments/billpay")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"payment_number\": \"<string>\",\n \"payment_mode\": {},\n \"description\": \"<string>\",\n \"metadata\": {\n \"order_id\": \"<string>\",\n \"customer_note\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pesahub.co/api/v1/payments/billpay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"payment_number\": \"<string>\",\n \"payment_mode\": {},\n \"description\": \"<string>\",\n \"metadata\": {\n \"order_id\": \"<string>\",\n \"customer_note\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"transaction_id": "<string>",
"bill": {
"amount": "<string>",
"reference": "<string>",
"mode": "<string>"
}
}Billpay Collection
Create a Bill Order
Create a unique control number that can be paid manually via mobile money or SIM banking.
POST
/
api
/
v1
/
payments
/
billpay
Create a Bill Order
curl --request POST \
--url https://pesahub.co/api/v1/payments/billpay \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"payment_number": "<string>",
"payment_mode": {},
"description": "<string>",
"metadata": {
"order_id": "<string>",
"customer_note": "<string>"
}
}
'import requests
url = "https://pesahub.co/api/v1/payments/billpay"
payload = {
"amount": 123,
"payment_number": "<string>",
"payment_mode": {},
"description": "<string>",
"metadata": {
"order_id": "<string>",
"customer_note": "<string>"
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 123,
payment_number: '<string>',
payment_mode: {},
description: '<string>',
metadata: {order_id: '<string>', customer_note: '<string>'}
})
};
fetch('https://pesahub.co/api/v1/payments/billpay', 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://pesahub.co/api/v1/payments/billpay",
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([
'amount' => 123,
'payment_number' => '<string>',
'payment_mode' => [
],
'description' => '<string>',
'metadata' => [
'order_id' => '<string>',
'customer_note' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://pesahub.co/api/v1/payments/billpay"
payload := strings.NewReader("{\n \"amount\": 123,\n \"payment_number\": \"<string>\",\n \"payment_mode\": {},\n \"description\": \"<string>\",\n \"metadata\": {\n \"order_id\": \"<string>\",\n \"customer_note\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://pesahub.co/api/v1/payments/billpay")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"payment_number\": \"<string>\",\n \"payment_mode\": {},\n \"description\": \"<string>\",\n \"metadata\": {\n \"order_id\": \"<string>\",\n \"customer_note\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pesahub.co/api/v1/payments/billpay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"payment_number\": \"<string>\",\n \"payment_mode\": {},\n \"description\": \"<string>\",\n \"metadata\": {\n \"order_id\": \"<string>\",\n \"customer_note\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"transaction_id": "<string>",
"bill": {
"amount": "<string>",
"reference": "<string>",
"mode": "<string>"
}
}This feature enables you to receive instant payments via unique control numbers using mobile money or SIM banking (e.g. CRDB).
Request Headers
string
required
Bearer token for authentication. Format:
Bearer <token>string
default:"application/json"
Expected response format. Use
application/json.string
default:"application/json"
Format of the request body. Use
application/json.Request
number
required
The payment amount to be billed.
string
required
A unique reference number for the bill (e.g.
FCLORDER12345).enum<string>
default:"exact"
required
The payment mode for the bill.
exact: Locks the bill to the exact amount, user can’t pay below or over the registered amountflexible: Allows partial and over payments. Ideal for installments.
string
required
A short description of what the payment is for (e.g.
Solar Installment).object
Response
boolean
Indicates whether the bill was registered successfully.
string
A human-readable status message.
string
A unique UUID reference for the transaction.