DEV Community

brian ambeyi
brian ambeyi

Posted on

Building PropTech for East Africa: M-Pesa Rent Automation

The Problem

In Kenya, over 90% of rent payments happen via M-Pesa (mobile money). But most landlords still reconcile these payments manually — downloading M-Pesa statements, matching transactions to tenants in Excel, and spending 8-12 hours/month on what should be automated.

I'm building HomeManager to solve this.

The Technical Stack

  • Backend: Django + Django REST Framework
  • Frontend: React (web) + React Native (mobile)
  • Payments: Safaricom M-Pesa Daraja API (STK Push + C2B)
  • Infrastructure: AWS (ECS, RDS, S3, CloudFront)
  • Task Queue: Celery + Redis
  • AI: Claude API + AWS Bedrock for natural language queries

M-Pesa Integration Architecture

The most interesting technical challenge: automatic payment reconciliation.

When a tenant pays rent via M-Pesa Paybill:

  1. Safaricom sends a C2B callback to our API
  2. We extract the account number from the transaction
  3. Match it to a tenant's unit
  4. Apply payment to their oldest unpaid invoice
  5. Send SMS receipt instantly
  6. Update the dashboard in real-time

The tricky part? Account numbers. Tenants type them inconsistently — "A12", "a12", "A 12", "Apt 12" should all match to the same unit. We built fuzzy matching logic that handles this.

Automated Invoice Generation

Every 1st of the month, a Celery beat task:

  • Queries all active leases
  • Generates invoices with rent + utilities (water, garbage)
  • Calculates water charges from meter readings
  • Applies any carried-forward balances
  • Sends SMS/email notifications to tenants

Late Fee Automation

The system:

  • Checks daily for invoices past grace period
  • Calculates fee (percentage, fixed, or both)
  • Adds as a line item on the invoice
  • Respects configurable caps (tenant protection)
  • Won't double-charge (idempotent)

This removes the landlord from the "bad guy" equation — it's the system enforcing what the lease says.

Lessons Building SaaS in East Africa

  1. SMS > Email. Most tenant communication is SMS. Email open rates are <20% in this market.
  2. Mobile-first everything. Property managers do meter readings on-site from phones.
  3. Offline matters. Internet isn't always reliable. Cache critical data.
  4. M-Pesa is not Stripe. Powerful API but inconsistent documentation.
  5. Multi-currency from day one. We support KES, UGX, TZS, RWF.

What's Next

  • WhatsApp Business API integration
  • Smart meter reading via OCR
  • Predictive analytics for vacancy forecasting

If you're building fintech or proptech for emerging markets, I'd love to connect.


Platform: homemanager.buniva.co.ke
Company: buniva.co.ke
Full comparison of property management software in Kenya: buniva.co.ke/blog/best-property-management-software-kenya.html

Top comments (0)