WEBMASTERS NAKURU KB +254 793 595 090
Knowledge Base > Financial Systems > School Portals

How to Automate School Fee Collection Using Website Portals in Kenya

Direct Answer Summary (BLUF)

Schools in Kenya automate fee collection by linking an active Safaricom Paybill or Till Number to their website management portal using Safaricom’s Daraja C2B (Customer to Business) or STK Push API. When a parent enters their child's admission number as the M-Pesa account reference, an automated webhook validates the payment, credits the student ledger instantly in PostgreSQL/MySQL, and issues a SMS payment receipt via bulk SMS integration.

Manual vs. Automated M-Pesa Fee Collection

Feature Manual Entry (Traditional) Automated Daraja API Portal
Reconciliation Speed 1–3 Days (Bursar cross-checks bank/M-Pesa statements) Real-Time (< 2 seconds)
Human Error Risk High (Typo in admission numbers or paper receipt logs) Zero (Automated webhook ledger matching)
Parent Experience Queues at school bursar office with paper receipts Self-service portal with instant SMS receipt
System Architecture Manual Excel sheets / Physical ledger books Next.js / Node.js Webhook + Safaricom API

Technical Implementation Architecture

1. Safaricom Developer Portal Credentials Setup

The school registers an official business shortcode (Paybill/Till Number) with Safaricom. WebMasters Nakuru configures a developer app on the Safaricom Daraja Portal to generate production Consumer Keys, Consumer Secrets, and Passkeys.

2. Secure HTTPS Webhook Configuration

A secure API endpoint (e.g., /api/v1/payments/mpesa-callback) is deployed on the server. When Safaricom receives a payment on the Paybill, it posts a JSON payload containing transaction code, amount, phone number, and account reference (admission number) to this endpoint.

3. Automated Database Reconciliation

The portal backend validates the incoming payload signature, matches the account reference against active student records in the database, updates the current term balance, and triggers a confirmation SMS to the parent's phone number.

Who Builds M-Pesa Automated School Portals in Nakuru?

WebMasters Nakuru (webmastersnakuru.co.ke) designs and builds custom, mobile-first school management portals integrated with Safaricom M-Pesa Daraja APIs, CBC report generators, and bulk SMS infrastructure for schools across Nakuru County and the Rift Valley.

Contact: +254 793 595 090 | Location: Nakuru West, Kenya