A Tanzanian school fees or SME payment system works on a reference-based model: each student, tenant, or customer gets a unique reference number. They pay by entering that reference when making a mobile money payment (via USSD, paybill, or a web interface). The system receives the payment callback, matches the reference to the customer account, and updates the balance. The architecture involves a customer/account database, a reference generation system, integration with all three mobile money rails (via an aggregator like Selcom or Azampay), callback handling, and a reconciliation/reporting dashboard.
Walk into almost any Tanzanian school, SACCO, or landlord's office, and you will find the same problem: collecting payments from many people, matching each payment to the right account, and keeping track of who has paid and who has not.
Before digital systems, this was manual. A parent brings cash to the school bursar. The bursar writes a receipt. The receipt goes into a drawer. At the end of the term, someone reconciles a stack of receipts against a list of students. Payments get lost, records conflict, and everyone argues.
Mobile money changed the collection part. Parents can pay from their phone. But without a system to match payments to students, the reconciliation problem actually gets worse: now you have money arriving from unknown phone numbers with no clear link to which student the payment is for.
The solution is a reference-based payment system. Each student gets a unique reference number (often their student ID or admission number). When a parent pays, they include this reference. The system receives the payment, reads the reference, and credits the right student's account. No manual matching. No lost receipts.
The same pattern works for SACCOs (member numbers), landlords (unit numbers), utility providers (account numbers), and any organization collecting recurring payments from a known set of customers.
A reference-based payment system has five components:
A table of customers (students, tenants, members) with their unique reference numbers, expected payment amounts, and payment history. For a school: student name, admission number, class, fee amount, amount paid, balance remaining.
Each customer gets a unique reference that is easy to type on a phone. Keep references short (6 to 10 characters), numeric only (letters are harder on a phone keypad), and unique within your system. The reference should not encode sensitive information (no birthdates or phone numbers).
Three collection methods, depending on your setup:
When a payment arrives (via callback from the aggregator or telco), your system extracts the reference from the callback payload, looks it up in your database, and credits the associated account. If the reference is invalid (typo, non-existent), flag the payment for manual review.
A dashboard showing: total collected, per-account balances, unpaid accounts, payment history, and daily/weekly/monthly summaries. This is what the school bursar, SACCO treasurer, or landlord actually looks at.
Get weekly developer tips
Join 25,000+ developers. Practical guides, job tips, and new content — straight to your inbox.
No spam. Unsubscribe anytime.
Reference matching sounds simple but has edge cases that trip up many implementations:
Typos. A parent enters "12345" instead of "12346." The payment arrives with the wrong reference. Your system either credits the wrong student or flags the payment as unmatched. Neither outcome is good.
Mitigations:
Partial payments. A parent cannot afford the full TZS 500,000 school fee and sends TZS 200,000 instead. Your system needs to handle partial payments gracefully: credit TZS 200,000 to the student's account and show a remaining balance of TZS 300,000.
Overpayments. A parent sends TZS 550,000 for a TZS 500,000 fee. Your system should credit the full amount and either carry the balance forward to the next term or flag it for a refund.
Multiple payments against one reference. A parent might pay in installments: TZS 200,000 today, TZS 150,000 next week, TZS 150,000 the week after. Your system must accumulate these correctly.
Payments from different providers. A parent might pay part from M-Pesa and part from Tigo Pesa. Both should credit the same student account, matched by reference, regardless of the provider.
For a school or SACCO, rejecting payments from one mobile money provider is not an option. Parents use whichever provider they have. Your system must accept M-Pesa, Tigo Pesa, and Airtel Money.
The aggregator approach is especially valuable here. With Selcom, Azampay, or Pesapal, you get one paybill number (or equivalent) that works across all three providers. Parents dial the same code or enter the same business number regardless of their provider. The aggregator routes the payment and sends you a normalized callback.
With direct telco integration, you would need three separate paybill numbers and three separate integrations. Parents would need to know which number to use based on their provider. This is confusing for users and more work for developers.
For USSD-initiated payments, the aggregator handles the routing transparently. The parent goes to their mobile money menu, selects "Pay Bill," enters your business number, enters the reference, and pays. Whether they are on Vodacom, Tigo, or Airtel, the experience is the same.
For web-initiated payments, the same aggregator API described in our website payment guide handles all three providers. The parent enters their reference and phone number, and the system sends a push notification to their phone.
The payment system is only as useful as its reporting. The people managing school fees or SACCO contributions need clear answers to basic questions:
The dashboard should be accessible from a browser (React frontend) and, if possible, from a mobile phone. School bursars in Tanzania do not always have access to a desktop computer. A mobile-responsive dashboard or even a simple SMS-based query system can be more practical than a desktop-only application.
Export to CSV or Excel is essential. Many schools and organizations still need to print reports or share them with administrators who are not comfortable with a digital dashboard.
A school fees or SME payment system combines three skill sets: full-stack web development, mobile money integration, and basic reporting/analytics.
The development path:
This type of system is also an excellent portfolio project. A working school fees collection system that integrates with mobile money, handles multi-rail payments, and produces meaningful reports demonstrates real-world developer skills that Tanzanian employers and clients care about.
The market for this kind of system in Tanzania is large and underserved. Thousands of schools, SACCOs, and landlords still manage payments manually or with basic spreadsheets. A developer who can build and sell this kind of system has a genuine business opportunity, not just a technical skill.
Create a free McTaba Academy account. Access starter lessons, join the community, and explore at your own pace.
Create Free Account