How UnifiedPay Works
Simple 3-step process to start accepting M-Pesa payments via API.
Sign Up & Link Payment Method
Create a free account – no activation required. Then log in to your dashboard and link your Paybill, Till Number, or Bank Account. The system instantly generates your unique API credentials.
- ✓ Consumer Key
- ✓ Consumer Secret
- ✓ Shortcode
cs_9f2e8c7a1b6d3f5e9a2c8b4d7e
Integrate the API Endpoints
Use our three simple REST endpoints to manage payments. No complex Daraja setup – we handle the heavy lifting.
Validate
Check credentials
/auth/cred/.../url
STK Push
Prompt payment
/sendstk
Status
Check payment
/sendstatus
Here's a minimal PHP example to initiate a payment:
<?php
$url = 'https://unifiedpay.co.ke/auth/cred/YOUR_KEY/YOUR_SECRET/sendstk';
$data = ['amount' => 100, 'msisdn' => '254712345678', 'reference' => 'Order #123'];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Receive Payment & Confirm
The customer receives an STK push on their phone. Once they enter their PIN, the payment is processed. You can query the status using the transaction ID returned in step 2.
Customer Phone
UnifiedPay API
M-Pesa
Payment Done
Optionally, set a webhook URL in your dashboard to receive real-time payment confirmations.
No credit card required. Free forever.