Bonaventure OgetoBy Bonaventure Ogeto|

Building for the African Stack: M-Pesa, USSD, and WhatsApp Explained

The African Stack refers to three technologies that form the infrastructure of most successful digital products on the continent: M-Pesa (mobile money via Safaricom's Daraja API), USSD (text-based interfaces for feature phones via platforms like Africa's Talking), and WhatsApp Business API (automated messaging and commerce). Developers who know these three systems can build products that reach the vast majority of African consumers, including those without smartphones, bank accounts, or reliable broadband.

What Is the African Stack (and Why It Matters)

Every market has its own technology stack. In Silicon Valley, you build with Stripe for payments, Twilio for messaging, and assume your users have iPhones and fast WiFi. In Africa, none of those assumptions hold.

The African Stack is the set of technologies behind the continent's most successful digital products. Three components form its core:

  • M-Pesa and mobile money for payments. Over $314 billion flows through M-Pesa annually. In Kenya, 96% of adults use it. This is not a niche payment method; it is the payment method.
  • USSD for reaching feature phone users. Over 600 million Africans still use feature phones. A USSD menu works on every phone ever manufactured, with no internet connection required.
  • WhatsApp Business API for communication. WhatsApp is the default messaging app across most of the continent. Businesses use the API for customer support, automated notifications, and entire commerce flows.

Most coding tutorials and bootcamps teach you the Silicon Valley version of the stack. You learn Stripe, SendGrid, push notifications. These tools are useful, but they miss the majority of the African market. A user in Kisumu paying for goods via M-Pesa, checking their balance over USSD, and receiving an order confirmation on WhatsApp is not an edge case. That is the standard experience for hundreds of millions of people.

We built the McTaba Labs curriculum around the African Stack because this is where the real opportunity sits. Developers who can build with these tools are genuinely scarce, and demand for them keeps growing.

M-Pesa and Mobile Money: The Payment Layer

M-Pesa launched in Kenya in 2007 and turned the country into a global leader in mobile payments. The idea was simple: let people send and receive money using their phones, no bank account needed. Nearly two decades later, M-Pesa has over 65 million active users across Kenya, Tanzania, Mozambique, DRC, Lesotho, Ghana, and Egypt.

For developers, the integration point is Safaricom's Daraja API (daraja means "bridge" in Swahili). The key capabilities:

  • STK Push (Lipa Na M-Pesa Online): You send a payment request to a user's phone. They see a prompt, enter their PIN, and the money moves. This is how most e-commerce checkouts work in Kenya.
  • C2B (Customer to Business): The user initiates a payment to your Paybill or Till number. You receive a callback with the transaction details.
  • B2C (Business to Customer): You send money to a user's M-Pesa wallet. Used for refunds, salary disbursements, and payouts.
  • B2B (Business to Business): Transfer funds between business accounts.

The practical reality of working with Daraja is rougher than the documentation suggests. Sandbox behaviour does not always match production. Callbacks can be delayed or duplicated. The OAuth token expires every hour and needs careful caching. These are solvable problems, but they trip up developers who expect Stripe-level polish.

We have a complete M-Pesa Daraja integration guide that walks through the technical details, including working Node.js code. Our M-Pesa Integration for Developers course (KES 9,999) goes deeper, covering production patterns, error handling, and the gotchas that only show up with real money.

Beyond M-Pesa, other mobile money platforms matter too. Airtel Money operates across 14 African countries. MTN Mobile Money dominates in West and Central Africa. Paystack and Flutterwave provide aggregation layers that handle multiple payment rails in a single integration. If you are building for Pan-African markets, you will need to understand more than just Daraja.

USSD: Reaching 600 Million Feature Phones

USSD (Unstructured Supplementary Service Data) is the technology behind those *dial-something-and-press-hash* menus. When you dial *234# to check your Safaricom balance, that is USSD. When M-Pesa users dial *334# to send money, that is USSD. When a farmer in rural Tanzania checks commodity prices on a basic Nokia, that is USSD.

The power of USSD is its reach. It works on every phone, smart or feature. It requires no internet connection, just basic cellular signal. It runs over the same protocol as voice calls, so it works even on 2G networks in remote areas. In a continent where over 600 million people still use feature phones and smartphone penetration hovers around 50% in many countries, USSD is not legacy technology. It is infrastructure.

For developers, building USSD applications means working with platforms like Africa's Talking, which provides USSD APIs alongside SMS, voice, and airtime services. The programming model is session-based: the user dials a code, your server receives a request with the input, you respond with the next menu, and the session continues until the user completes the flow or the connection times out (typically after about 3 minutes).

USSD applications tend to be simple in terms of interface (text menus, numbered options) but demanding in terms of design. You have roughly 182 characters per screen, a 3-minute session limit, and users who may be semi-literate. Designing a good USSD flow requires thinking carefully about information hierarchy, error tolerance, and language (many successful USSD apps support Swahili and other local languages).

Common use cases: mobile banking menus, agricultural information services, survey tools, registration flows for users who cannot download apps, and payment collection in areas with no internet.

WhatsApp Business API: The Communication Layer

WhatsApp has over 2 billion users globally, with massive adoption across Africa. In Kenya, Nigeria, South Africa, and most of the continent, WhatsApp is not just a messaging app. It is the primary way people communicate, share information, and increasingly, do business.

The WhatsApp Business API (now called WhatsApp Cloud API) lets developers build automated messaging flows on top of the platform. This is different from the regular WhatsApp Business app. The API allows:

  • Automated notifications: Order confirmations, delivery updates, appointment reminders, payment receipts. These are template messages that you pre-approve through Meta.
  • Interactive chatbots: Customer support bots, FAQ responders, product catalogs, booking systems. The API supports interactive buttons, lists, and quick replies.
  • Commerce flows: Product browsing, cart management, payment integration (often via M-Pesa). Some businesses run their entire sales process through WhatsApp.
  • Broadcast messaging: Send updates to large numbers of opted-in users for marketing, community management, or public health campaigns.

The API is accessed through Meta's Cloud API (hosted by Meta) or through Business Solution Providers (BSPs) like Twilio, MessageBird, or 360dialog. The Cloud API is free for the first 1,000 conversations per month, with charges per conversation beyond that.

Building on WhatsApp is powerful because you meet users where they already are. They do not need to download a new app, create an account, or learn a new interface. You show up in the same app where they talk to their family and friends. For African markets where app download friction is high (data costs, phone storage limits), this is a significant advantage.

How the Three Layers Work Together

The real power of the African Stack comes from combining all three. Here are examples of how they connect in real products:

A restaurant ordering system: A customer messages the restaurant on WhatsApp and browses the menu through an interactive chatbot. They place an order and receive an M-Pesa STK Push to pay. After payment confirmation, they get a WhatsApp message with their order number and estimated delivery time. The kitchen gets the order via an internal dashboard. The customer who does not have a smartphone can dial a USSD code to order and pay instead.

A school fee collection platform: The school sends fee reminders via WhatsApp to parents who have smartphones. Parents without WhatsApp receive an SMS. Payment is collected via M-Pesa (either STK Push or Paybill). Parents on feature phones can check their balance and pay using a USSD menu. The school's admin dashboard shows all payments across all channels in one place.

A savings group (chama) management tool: Members receive contribution reminders on WhatsApp. They contribute via M-Pesa. Monthly reports are sent as WhatsApp messages. Members on feature phones use USSD to check their balance, see the group total, and initiate contributions. The group treasurer sees everything on a web dashboard.

In each case, the product reaches the smartphone user (WhatsApp + M-Pesa), the feature phone user (USSD + M-Pesa), and the admin (web dashboard). No user is excluded because of their device. That is what building for Africa looks like.

How to Start Learning the African Stack

If you already know the basics of web development (HTML, CSS, JavaScript, a backend framework), adding the African Stack to your skill set is a matter of weeks, not months. Here is a practical order:

Start with M-Pesa. It is the most immediately useful and the most requested by employers. Read our Daraja API guide, set up a sandbox account, and build a simple checkout flow. Our M-Pesa Integration for Developers course (KES 9,999) covers the full journey from sandbox to production, including the Daraja quirks that catch people off guard.

Then add WhatsApp. Set up a test number through the Meta Cloud API, build a simple auto-responder, then add interactive menus. The official documentation is decent, though the webhook verification flow trips up most people the first time.

Then learn USSD. Sign up for Africa's Talking, build a 3-screen USSD menu, and connect it to a backend. The concepts are simple; the art is in the UX constraints.

Then combine them. Build a small project that uses all three: a WhatsApp ordering bot with M-Pesa payment and a USSD fallback. This single project demonstrates the entire African Stack and is far more impressive to employers than ten to-do apps.

At McTaba Labs, the African Stack runs through our entire 6-month marathon. Learners start integrating M-Pesa by week 8, WhatsApp by week 12, and USSD by week 14. By the end, they have shipped multiple production projects that combine all three. If you want structured, mentor-supported learning with a cohort of other developers, that is the fastest path we know.

But you do not need a programme to get started. The APIs are well-documented, sandbox access is free, and the community (particularly Kenya's developer Twitter and the Africa's Talking Slack) is helpful. Pick one, build something, and ship it. The African Stack rewards builders.

Key Takeaways

  • The African Stack is M-Pesa (payments), USSD (feature phone access), and WhatsApp Business API (communication). Together, they reach more Africans than any combination of Western tech.
  • M-Pesa processes over $314 billion annually and has 65+ million active users. For developers in East Africa, Daraja API integration is as fundamental as Stripe is in the US.
  • USSD still matters because over 600 million Africans use feature phones. A USSD interface lets your product reach users who will never download an app.
  • WhatsApp has over 2 billion global users, with massive adoption across Africa. The Business API turns it into a commerce and support platform.
  • Very few developers outside Africa know this stack. That creates a genuine competitive advantage for those who do.

Frequently Asked Questions

Do I need to be in Africa to learn the African Stack?
No. The Daraja sandbox, WhatsApp Cloud API, and Africa's Talking sandbox are all accessible from anywhere. However, going live with M-Pesa production credentials requires a Kenyan business entity. Many diaspora developers learn the stack remotely and partner with local businesses for production deployment.
Is the African Stack only relevant in Kenya?
M-Pesa is strongest in Kenya and Tanzania, but mobile money (MTN, Airtel Money) is the standard across most of Africa. USSD and WhatsApp are universal across the continent. The principles are the same; the specific APIs vary by country. Learning the Kenyan stack (Daraja + Africa's Talking + WhatsApp Cloud API) gives you transferable skills for any African market.
Can I get a job just by knowing the African Stack?
Not by itself. You need solid web development fundamentals (JavaScript/TypeScript, a backend framework, databases, APIs) as the foundation. The African Stack is what differentiates you from other developers who have those same fundamentals. Think of it as a specialisation that commands a salary premium, not a standalone skill.
How does the African Stack relate to global tech?
The African Stack sits on top of the same global technologies everyone uses. Your M-Pesa integration runs on Node.js or Python. Your WhatsApp bot uses webhooks and REST APIs. Your USSD app needs a server, a database, and session management. The difference is the specific integrations and the design constraints (mobile-first, low-bandwidth, feature phone compatible).

Ready to build real-world apps?

Join the McTaba Labs full-stack marathon (4 months full-time · 6 months part-time). Learn M-Pesa, USSD, and WhatsApp engineering while shipping 8 production apps.

Apply to the McTaba Marathon