Initiate mobile money collection
curl --request POST \
--url https://api.usebila.com/api/v1/bila/collections/mobile-money \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": 100.5,
"reference": "collection-001",
"phone": "0977433571",
"operator": "airtel",
"country": "zm",
"walletId": "68f11209-451f-4a15-bfcd-d916eb8b09f4",
"bearer": "customer",
"narration": "Payment for subscription",
"customerName": "John Doe"
}
'import requests
url = "https://api.usebila.com/api/v1/bila/collections/mobile-money"
payload = {
"amount": 100.5,
"reference": "collection-001",
"phone": "0977433571",
"operator": "airtel",
"country": "zm",
"walletId": "68f11209-451f-4a15-bfcd-d916eb8b09f4",
"bearer": "customer",
"narration": "Payment for subscription",
"customerName": "John Doe"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 100.5,
reference: 'collection-001',
phone: '0977433571',
operator: 'airtel',
country: 'zm',
walletId: '68f11209-451f-4a15-bfcd-d916eb8b09f4',
bearer: 'customer',
narration: 'Payment for subscription',
customerName: 'John Doe'
})
};
fetch('https://api.usebila.com/api/v1/bila/collections/mobile-money', 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.usebila.com/api/v1/bila/collections/mobile-money",
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' => 100.5,
'reference' => 'collection-001',
'phone' => '0977433571',
'operator' => 'airtel',
'country' => 'zm',
'walletId' => '68f11209-451f-4a15-bfcd-d916eb8b09f4',
'bearer' => 'customer',
'narration' => 'Payment for subscription',
'customerName' => 'John Doe'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-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.usebila.com/api/v1/bila/collections/mobile-money"
payload := strings.NewReader("{\n \"amount\": 100.5,\n \"reference\": \"collection-001\",\n \"phone\": \"0977433571\",\n \"operator\": \"airtel\",\n \"country\": \"zm\",\n \"walletId\": \"68f11209-451f-4a15-bfcd-d916eb8b09f4\",\n \"bearer\": \"customer\",\n \"narration\": \"Payment for subscription\",\n \"customerName\": \"John Doe\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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.usebila.com/api/v1/bila/collections/mobile-money")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 100.5,\n \"reference\": \"collection-001\",\n \"phone\": \"0977433571\",\n \"operator\": \"airtel\",\n \"country\": \"zm\",\n \"walletId\": \"68f11209-451f-4a15-bfcd-d916eb8b09f4\",\n \"bearer\": \"customer\",\n \"narration\": \"Payment for subscription\",\n \"customerName\": \"John Doe\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usebila.com/api/v1/bila/collections/mobile-money")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 100.5,\n \"reference\": \"collection-001\",\n \"phone\": \"0977433571\",\n \"operator\": \"airtel\",\n \"country\": \"zm\",\n \"walletId\": \"68f11209-451f-4a15-bfcd-d916eb8b09f4\",\n \"bearer\": \"customer\",\n \"narration\": \"Payment for subscription\",\n \"customerName\": \"John Doe\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Operation completed successfully",
"data": {
"id": "col-001",
"reference": "order-12345",
"status": "successful",
"amount": 100,
"currency": "ZMW",
"customer": {
"phone": "0977123456",
"name": "JOHN DOE",
"operator": "airtel"
},
"createdAt": "2024-01-15T10:30:00Z",
"narration": "Payment for Order #12345",
"completedAt": "2024-01-15T10:31:00Z"
}
}Collections
Initiate mobile money collection
Initiate a payment collection from a mobile money account. Creates a transaction record in your dashboard.
POST
/
api
/
v1
/
bila
/
collections
/
mobile-money
Initiate mobile money collection
curl --request POST \
--url https://api.usebila.com/api/v1/bila/collections/mobile-money \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": 100.5,
"reference": "collection-001",
"phone": "0977433571",
"operator": "airtel",
"country": "zm",
"walletId": "68f11209-451f-4a15-bfcd-d916eb8b09f4",
"bearer": "customer",
"narration": "Payment for subscription",
"customerName": "John Doe"
}
'import requests
url = "https://api.usebila.com/api/v1/bila/collections/mobile-money"
payload = {
"amount": 100.5,
"reference": "collection-001",
"phone": "0977433571",
"operator": "airtel",
"country": "zm",
"walletId": "68f11209-451f-4a15-bfcd-d916eb8b09f4",
"bearer": "customer",
"narration": "Payment for subscription",
"customerName": "John Doe"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 100.5,
reference: 'collection-001',
phone: '0977433571',
operator: 'airtel',
country: 'zm',
walletId: '68f11209-451f-4a15-bfcd-d916eb8b09f4',
bearer: 'customer',
narration: 'Payment for subscription',
customerName: 'John Doe'
})
};
fetch('https://api.usebila.com/api/v1/bila/collections/mobile-money', 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.usebila.com/api/v1/bila/collections/mobile-money",
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' => 100.5,
'reference' => 'collection-001',
'phone' => '0977433571',
'operator' => 'airtel',
'country' => 'zm',
'walletId' => '68f11209-451f-4a15-bfcd-d916eb8b09f4',
'bearer' => 'customer',
'narration' => 'Payment for subscription',
'customerName' => 'John Doe'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-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.usebila.com/api/v1/bila/collections/mobile-money"
payload := strings.NewReader("{\n \"amount\": 100.5,\n \"reference\": \"collection-001\",\n \"phone\": \"0977433571\",\n \"operator\": \"airtel\",\n \"country\": \"zm\",\n \"walletId\": \"68f11209-451f-4a15-bfcd-d916eb8b09f4\",\n \"bearer\": \"customer\",\n \"narration\": \"Payment for subscription\",\n \"customerName\": \"John Doe\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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.usebila.com/api/v1/bila/collections/mobile-money")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 100.5,\n \"reference\": \"collection-001\",\n \"phone\": \"0977433571\",\n \"operator\": \"airtel\",\n \"country\": \"zm\",\n \"walletId\": \"68f11209-451f-4a15-bfcd-d916eb8b09f4\",\n \"bearer\": \"customer\",\n \"narration\": \"Payment for subscription\",\n \"customerName\": \"John Doe\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usebila.com/api/v1/bila/collections/mobile-money")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 100.5,\n \"reference\": \"collection-001\",\n \"phone\": \"0977433571\",\n \"operator\": \"airtel\",\n \"country\": \"zm\",\n \"walletId\": \"68f11209-451f-4a15-bfcd-d916eb8b09f4\",\n \"bearer\": \"customer\",\n \"narration\": \"Payment for subscription\",\n \"customerName\": \"John Doe\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Operation completed successfully",
"data": {
"id": "col-001",
"reference": "order-12345",
"status": "successful",
"amount": 100,
"currency": "ZMW",
"customer": {
"phone": "0977123456",
"name": "JOHN DOE",
"operator": "airtel"
},
"createdAt": "2024-01-15T10:30:00Z",
"narration": "Payment for Order #12345",
"completedAt": "2024-01-15T10:31:00Z"
}
}Authorizations
Merchant API key (e.g., sk_live_xxx or sk_test_xxx)
Body
application/json
Collection amount
Required range:
x >= 0.01Example:
100.5
Unique client reference
Pattern:
^[a-zA-Z0-9._-]+$Example:
"collection-001"
Customer phone number
Example:
"0977433571"
Mobile money operator
Available options:
airtel, mtn, zamtel, vodacom Example:
"airtel"
Country code
Available options:
zm, ng Example:
"zm"
Target wallet ID to credit
Example:
"68f11209-451f-4a15-bfcd-d916eb8b09f4"
Who bears the transaction fee
Available options:
merchant, customer Example:
"customer"
Collection narration
Maximum string length:
100Example:
"Payment for subscription"
Customer name for the transaction record
Maximum string length:
100Example:
"John Doe"
Was this page helpful?
⌘I
