API Overview & Quickstart
Welcome to the HivePay Developer Documentation. HivePay provides a high-performance RESTful payment infrastructure for businesses operating in Uganda and across East Africa.
Trigger real-time USSD push notifications to MTN & Airtel mobile phones in Uganda.
Accept 3D-Secure Visa & Mastercard checkout sessions from customers worldwide.
Disburse funds directly to mobile wallets with PIN verification and instant failover refunds.
3-Minute Integration Guide
Get Your Merchant Account & API Keys
Sign up for a HivePay account. Verify your 6-digit email OTP, and an Account Number (e.g. HP2609562857) and production API Key are generated instantly.
Send Your First Collection Request
Initiate a mobile money collection via HTTP POST to prompt your customer's phone:
curl -X POST https://hivepay.site/api/v1/collect-money \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "0777123456",
"amount": 50000,
"description": "Order #1001",
"reference": "ORD-1001"
}'
<?php
$payload = json_encode([
'phone_number' => '0777123456',
'amount' => 50000,
'description' => 'Order #1001',
'reference' => 'ORD-1001'
]);
$ch = curl_init('https://hivepay.site/api/v1/collect-money');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: ' . getenv('HIVEPAY_API_KEY'),
'Content-Type: application/json'
]
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
echo "Prompt initiated! Reference: " . $result['gateway_reference'];
const response = await fetch('https://hivepay.site/api/v1/collect-money', {
method: 'POST',
headers: {
'X-API-Key': process.env.HIVEPAY_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
phone_number: '0777123456',
amount: 50000,
description: 'Order #1001',
reference: 'ORD-1001'
})
});
const data = await response.json();
console.log('Collection reference:', data.gateway_reference);
import os, requests
res = requests.post(
'https://hivepay.site/api/v1/collect-money',
json={
'phone_number': '0777123456',
'amount': 50000,
'description': 'Order #1001',
'reference': 'ORD-1001'
},
headers={'X-API-Key': os.getenv('HIVEPAY_API_KEY')}
)
print(res.json())
Listen for Webhook Approvals
When the customer enters their PIN on their phone, HivePay dispatches an instant signed HMAC-SHA256 webhook to your server so you can mark the order as paid without polling. Read the Webhooks Guide →