Chatzuri
Pricing
HomeBlogConversational M-Pesa: How AI Agents Handle Payments Through Chat
Product UpdatesDecember 12, 20255 min read

Conversational M-Pesa: How AI Agents Handle Payments Through Chat

Your customer asks to pay an invoice. The AI agent confirms the amount, initiates an M-Pesa push, and reconciles the transaction — all in one conversation. Here's exactly how we built it and what to watch out for.

L

Lawrence

Founder, Chatzuri

For businesses operating in Kenya, Tanzania, and Uganda, M-Pesa is not an optional payment integration — it's where your customers' money lives. Building an AI agent that can receive payments, confirm transactions, and handle payment-related queries is a direct revenue enabler, not just a support tool. Here's how the integration works in practice.

The Conversation Architecture

A conversational payment flow has four stages: intent detection (the customer mentions payment, invoice, or a specific amount), confirmation (the agent summarises what will be charged and requests explicit consent), execution (the agent initiates the M-Pesa STK push to the customer's phone), and reconciliation (the agent confirms receipt and updates the relevant system record).

Each stage has edge cases. Intent detection needs to distinguish 'I want to pay my invoice' from 'I already paid — why is my account still locked?' Confirmation must handle the customer not responding (session timeout), responding with an incorrect amount, or replying in an unexpected language. Execution can fail due to insufficient M-Pesa balance, network timeout, or the customer rejecting the STK push. Reconciliation needs to handle delayed callbacks from the M-Pesa API, which occasionally arrive 3–5 minutes late.

What the Implementation Looks Like

In Chatzuri, payment flows are implemented as tool definitions — structured API calls that the AI agent can invoke when a payment intent is detected. The tool takes an account identifier and amount, calls the M-Pesa Daraja API to initiate the STK push, and returns a transaction reference. The agent then monitors for the callback and updates the conversation accordingly.

  • STK push timeout (default 30s): agent prompts the customer to check their phone and retry
  • Insufficient balance: agent suggests alternative amounts or payment scheduling
  • Wrong PIN: handled by M-Pesa natively — agent confirms final transaction status via callback
  • API timeout: agent logs the attempt and offers to retry or escalate to a human agent

Security Considerations

Payment flows require additional safeguards that standard AI agent conversations don't need. The agent should never store M-Pesa PINs or full phone numbers in conversation logs. Transaction amounts should be confirmed explicitly before initiating any payment. For amounts above a configurable threshold (typically $50), adding a second confirmation step reduces disputed transaction rates significantly.

“After adding the conversational M-Pesa flow on WhatsApp, our payment collection rate on outstanding invoices went from 34% to 71% in the first month. Customers pay when it's frictionless.”

— CFO, Kenyan SaaS company

The combination of proactive payment reminders (sent via WhatsApp at configurable intervals) and a one-tap payment completion flow in the same conversation is the specific configuration that drives collection rates up. The friction reduction is enormous: instead of receiving an SMS, switching to a mobile banking app, and navigating to bill payment, the customer taps 'Pay' in the same conversation where they received the invoice.

Ready to build your AI agent?

Deploy in under 10 minutes — no code required

Join 2,000+ businesses using Chatzuri to automate customer support across WhatsApp, SMS, Telegram, and more.

Build for free
Back to Blog

More from the blog

View all
Product Updates

Enterprise AI Security: How Chatzuri Protects Customer Data at Scale

August 22, 20256 min read
Case Studies

How One Fintech Cut Customer Response Time by 94% with AI Agents

April 18, 20268 min read
Channels

WhatsApp Business API vs. Chatzuri: Why Businesses Choose the Platform Approach

April 3, 20266 min read
Chatzuri

AI-powered agents are transforming customer interactions by providing instant, intelligent responses around the clock. They help businesses reduce operational costs, improve response times, and scale support without compromising quality. These agents understand natural language, learn from conversations, and integrate with existing systems to offer personalized experiences that enhance customer satisfaction and loyalty.

Chatzuri

AI-powered agents are transforming customer interactions by providing instant, intelligent responses around the clock. They help businesses reduce operational costs, improve response times, and scale support without compromising quality. These agents understand natural language, learn from conversations, and integrate with existing systems to offer personalized experiences that enhance customer satisfaction and loyalty.

Product

  • Pricing
  • Security
  • Affiliates

Resources

  • API
  • Guides
  • Blog
  • Help

Company

  • About us
  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • DPA

About

  • Teams
  • Singapore, Nairobi

© 2026 Chatzuri. All rights reserved.

Chatzuri uses AI and can make mistakes.

Terms of ServicePrivacy PolicyCookie PolicyChatzuri