WhatsApp bots automate business conversations on WhatsApp using the WhatsApp Business API. Kenyan small businesses use them for automated order-taking, payment processing via M-Pesa STK Push, appointment booking, and 24/7 customer support. A bot handles routine queries instantly while routing complex questions to a human. For a developer, building these bots is a real freelance opportunity because demand far exceeds supply.
Picture a juice shop in Westlands. The owner, Grace, gets 50 to 80 WhatsApp messages a day from customers. "What juices do you have?" "How much is a large mango?" "Can you deliver to Kilimani?" "I sent the money, did you get it?" Most of these questions have the same answers every single day. Grace spends 2 to 3 hours typing the same responses instead of making juice.
A WhatsApp bot changes this. When a customer messages Grace's WhatsApp Business number, the bot replies instantly:
Hi! Welcome to Fresh Squeeze Juices.
1. View Menu
2. Place Order
3. Track Order
4. Talk to Grace
The customer taps a button or types a number. The bot shows the menu with prices. The customer selects a juice and size. The bot calculates the total and sends an M-Pesa payment prompt. The customer pays. The bot sends a receipt and an estimated delivery time. Grace sees the order in her system and starts making the juice.
Grace went from 3 hours of typing to 0 hours. The bot handles the routine. Grace only gets involved when someone taps "Talk to Grace" for a custom request.
This is not hypothetical. Food businesses, beauty salons, tutoring services, cleaning companies, and dozens of other small business types in Nairobi, Mombasa, and Kisumu are using WhatsApp bots right now. The businesses that adopt them early get faster response times, fewer missed messages, and more orders than competitors who are still typing replies manually.
1. Automated ordering. Restaurants, juice shops, grocery stores, and meal prep services use bots to take orders. The customer browses a menu in the chat (using WhatsApp's interactive list feature), selects items, confirms the order, and pays via M-Pesa. No phone call needed. No waiting for a reply. Orders come in at 2 AM when the owner is asleep, ready for morning preparation.
2. Appointment booking. Salons, barber shops, clinics, and freelance professionals use bots to manage scheduling. The customer picks a service, sees available time slots, selects one, and gets a confirmation. The bot sends a reminder the day before. Cancellations and rescheduling happen in the chat too. This replaces the paper appointment book that gets lost and the phone calls that interrupt haircuts.
3. FAQ handling. Every business gets the same 10 to 15 questions repeatedly. "Where are you located?" "What are your hours?" "Do you deliver?" "How do I pay?" A bot answers these instantly, 24 hours a day. Only unusual questions get forwarded to a human. This alone saves hours per week for most small businesses.
4. Order tracking. Once an order is placed, the bot sends status updates. "Your order is being prepared." "Your rider is on the way." "Delivered. Rate your experience?" This keeps customers informed without the business owner sending manual messages for each order.
5. Payment confirmation. When a customer sends M-Pesa, the bot immediately confirms receipt. "Payment of KES 850 received. Reference: QKL7XXXXXX. Your order is confirmed." This instant confirmation builds trust. The customer does not have to wonder whether their payment was received or call to verify.
Get weekly developer tips
Join 25,000+ developers. Practical guides, job tips, and new content — straight to your inbox.
No spam. Unsubscribe anytime.
A WhatsApp bot is a server that listens for incoming WhatsApp messages via webhooks and sends automated replies using the WhatsApp Business API. The bot itself is your code running on a server. WhatsApp is just the communication channel.
The flow:
Bot logic approaches:
You do not need natural language processing or AI for most small business bots. A state machine with keyword matching and interactive buttons handles the majority of use cases. Add AI later if your bot needs to understand free-text queries, but start simple.
The combination of WhatsApp and M-Pesa is powerful for Kenyan businesses. The customer orders through WhatsApp and pays through M-Pesa, all without leaving their phone or visiting a website.
The payment flow:
From the customer's perspective, they chatted on WhatsApp, got an M-Pesa prompt, entered their PIN, and received a confirmation. Three interactions, under a minute. That is a smoother buying experience than most websites offer.
Technical considerations: The M-Pesa callback and the WhatsApp message are handled by the same backend but through different endpoints. Your M-Pesa callback handler updates the order status in your database and triggers the WhatsApp confirmation message. Keep the M-Pesa and WhatsApp logic loosely coupled so a failure in one does not break the other. If the WhatsApp confirmation fails to send, the payment is still processed and the customer gets their M-Pesa SMS receipt as a fallback.
Here is the business reality: thousands of Kenyan small businesses want WhatsApp automation. Almost none of them have it. The gap between demand and supply is enormous.
Why? Most small business owners know WhatsApp well as users. They see competitors using automated replies and want the same thing. But they do not know that it requires the Business API, a server, and custom code. They think there is an app they can download or a setting they can turn on. When they discover it requires a developer, they start looking for one.
What the market looks like:
The clients are not tech startups. They are restaurant owners, salon operators, tutoring centers, cleaning services, and event planners. Find them at business networking events, in Facebook business groups, and through referrals from your first few clients. One successful bot that a business owner shows to their friends generates referrals.
The skill set you need: basic web development (Node.js or Python), understanding of the WhatsApp Business API, M-Pesa Daraja API integration, and a simple database. If you can build a basic web app, you can build a WhatsApp bot. The learning curve is days, not months.
If you want to build WhatsApp bots, here is a practical starting path.
Week 1: Understand the platform. Read Meta's WhatsApp Business API documentation. Set up a Meta Developer account. Create a test app. Send your first message using the Cloud API. Receive a webhook for an incoming message. Understand the 24-hour rule and template system.
Week 2: Build a simple echo bot. Write a server (Node.js with Express or Python with Flask) that receives incoming WhatsApp messages via webhooks and replies with the same message. This teaches you the request/response cycle. Then upgrade it to a keyword-matching bot that responds differently based on what the user types.
Week 3: Build a menu-based bot. Add state management (using a database or in-memory store keyed by phone number) so your bot can track where each user is in a conversation flow. Build a simple ordering flow: show menu, accept selection, show price, confirm. This is the core of every business bot.
Week 4: Add M-Pesa. Integrate the Daraja API to trigger STK Push payments from within your bot flow. Handle the payment callback. Send a WhatsApp confirmation when payment is received. Now you have a bot that takes orders and processes payments. That is a sellable product.
After that: Build one for a real business. Do it cheaply or free for your first client in exchange for a testimonial and the right to show it as a portfolio piece. The experience of building for a real user with real requirements is worth more than any tutorial.
Our Full-Stack Software and AI Engineering course (KES 120,000) covers both the WhatsApp Business API and M-Pesa Daraja API integration. You build production-grade projects with mentor guidance. But the path above works for self-directed learners too.
KES 9,999
Master Daraja API, STK Push, C2B, B2C, and callback handling. Build a real payment flow from scratch. 10 modules, 57 lessons.
Enrol in M-Pesa Integration