If you operate a business, school, Sacco, or build apps in Kenya, you already know the drill: M-Pesa is king, but reconciling payments made to traditional Bank and Private Paybills can be an absolute nightmare.
Normally, when a customer pays a custom paybill via M-Pesa, they have to manually type in the Paybill number, input a long account number, type the amount, wait for the prompt, and then you have to manually check a portal or bank statement to see if it landed.
Pay Hero Kenya completely changes the game. It allows you to trigger an automated STK Push (Lipa Na M-Pesa pop-up) directly to a customer’s phone, routing the money straight into any Bank, Sacco, or School Paybill. The customer just enters their PIN, and Pay Hero provides your system with instant reconciliation.
Whether you want a no-code solution or a robust API integration, here is how to set it up.
1. Setup and Account Configuration
Getting started takes less than five minutes.
- Create an Account: Head over to the Pay Hero Web Portal and sign up for your merchant account.
- Register Your Payment Channel: Once logged in, navigate to the User Interface (UI) to link your payment collection channels. You aren’t limited to just banks—you can register any paybill you own, including:
- Bank Paybills (Equity, KCB, Co-op, etc.)
- Sacco Paybills
- School / Institution Paybills
- Any other custom utility shortcode.
- Top Up Your Service Wallet: Pay Hero charges a tiny float fee for initiating API-driven STK pushes. Pay Hero handles this via a Service Wallet on your dashboard. Top it up with a few shillings to ensure your transactions process smoothly.
2. Choose Your Integration Method
Pay Hero is built for both non-technical business owners and advanced developers. You can collect payments using three distinct methods:
Option A: The No-Code “Lipa Link” (Quickest Way)
If you don’t have a website or app, Pay Hero offers a feature called Lipa Link for easy and quick payments.
- Generate a custom payment link from your portal.
- Share the link with customers via WhatsApp, SMS, or social media.
- Customers click the link, enter their phone number and amount, and an STK push pops up on their screen instantly.
Option B: WooCommerce Plugin for WordPress
If you run an e-commerce store built on WordPress:
- Download and install the official Pay Hero WooCommerce plugin.
- Input your API keys from the portal, and your store will instantly support automated STK Push at checkout, routing funds directly to your linked paybill.
Option C: Developer API Integration
For custom websites and mobile applications, you can use Pay Hero’s REST APIs to fully automate the checkout flow.
Here is an example of how to trigger an STK push via the API using Node.js:
javascript
const axios = require('axios');
async function initiatePaybillStkPush() {
const url = 'https://backend.payhero.co.ke/api/v2/payments/initiate-stk-push';
// Use the API credentials from your Pay Hero portal
const authHeader = Buffer.from('YOUR_USERNAME:YOUR_PASSWORD').toString('base64');
const payload = {
amount: 1500, // Amount in KES
phone_number: '254712345678', // Customer phone format
channel_id: 'YOUR_REGISTERED_CHANNEL_ID', // The ID assigned to your Bank/Sacco/School paybill
provider: 'm-pesa',
external_reference: 'INV-2026-004' // Your internal invoice/order number
};
try {
const response = await axios.post(url, payload, {
headers: {
'Authorization': Basic ${authHeader},
'Content-Type': 'application/json'
}
});
console.log('STK Push Initiated:', response.data);
} catch (error) {
console.error('Error:', error.response ? error.response.data : error.message);
}
}
initiatePaybillStkPush();
3. Webhooks & Technical Documentation
When the customer enters their PIN, Pay Hero handles the processing and sends a secure webhook notification back to your server to confirm the payment. This allows you to automatically activate services, mark invoices as paid, or dispatch orders in real-time.
For detailed request payloads, authentication schemes, and webhook parameters, check out the official Pay Hero Developer Documentation.
Wrapping Up
By offloading the heavy lifting to Pay Hero Kenya, you bypass the painful process of building custom direct integrations for legacy bank infrastructure or complex M-Pesa APIs. You get a unified platform that turns your Bank, Sacco, or School paybill into a modern, automated M-Pesa checkout counter.
Ready to automate your collections? Register your paybill on the Pay Hero Portal today!