How UnifiedPay Works

Simple 3-step process to start accepting M-Pesa payments via API.

1

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.

You'll receive:
  • ✓ Consumer Key
  • ✓ Consumer Secret
  • ✓ Shortcode
Example credentials:
ck_2f8a9c3e7b1d4a6f9c2e8b5d7a
cs_9f2e8c7a1b6d3f5e9a2c8b4d7e
2

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;
?>
3

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.

Get Started Free →

No credit card required. Free forever.