Automation

Payments (M-Pesa)

Collect payments, manage transactions, and process payouts through M-Pesa on WhatsApp.

Overview

The M-Pesa integration turns your WhatsApp agent into a full payment channel. During any conversation, the agent can send a payment prompt directly to the customer's phone — they enter their M-Pesa PIN, and the payment is done. No switching apps, no manual invoicing, no waiting.

The agent can handle the entire payment flow autonomously — qualifying an order through conversation, calculating the total, requesting payment, confirming receipt, and issuing refunds if needed. You can also view transaction history, track payment volumes, and process payouts from the dashboard.

Access M-Pesa from the M-Pesa link in the main dashboard sidebar. This link only appears if the M-Pesa toolkit is installed.

The M-Pesa dashboard

The overview page shows four key metrics:

MetricWhat it shows
Current BalanceYour available M-Pesa balance, with the last update time
Pending PayoutsMoney awaiting approval or settlement
Collections ProcessedTotal volume of completed transactions, refunded amount, and average transaction size
Failure RatePercentage of transactions that failed, were declined, or cancelled

Below the metrics, you'll see your latest activity — the most recent transactions with timestamps, customer phone numbers, reasons, statuses, and amounts.

Collecting a payment

There are two ways to collect a payment:

From the AI agent

If your system prompt instructs the agent to collect payments (e.g., "when a customer confirms an order, request payment via M-Pesa"), the agent can trigger STK push requests automatically during conversations.

The customer sees a payment prompt on their phone, enters their M-Pesa PIN, and the payment is processed. The agent is notified of the result and can confirm receipt in the conversation.

From the chat dashboard

You can also request a payment manually during any conversation:

Chat → Request Payment

Request M-Pesa Payment

5,000
Premium Package — Order #4892
Referred by Grace A.
CancelSend STK Push
M-Pesa payment request dialog from within a chat
  1. Open the chat with the customer
  2. Click the payment option
  3. Enter:
    • Amount — The amount in KES
    • Reason — What the payment is for (e.g., "Order #1234")
    • Internal note (optional) — Notes for your records
  4. Confirm to send the STK push

The customer receives the M-Pesa prompt on their phone. Once they pay, the confirmation appears in the conversation.

Viewing transactions

Go to the Transactions page to see your complete transaction history.

Filtering transactions

Use the filter tabs at the top:

  • All — Every transaction
  • Paid — Successfully completed payments
  • Pending — Payments that are awaiting confirmation
  • Failed — Payments that failed, were declined, or timed out
  • Refunded — Payments that were refunded

Transaction details

Each transaction shows:

  • Date — When the transaction was created
  • Customer — The phone number that made the payment
  • Reason — The description provided when the payment was requested
  • Status — Current state of the transaction (Paid, Pending, Failed, Refunded)
  • Amount — The net amount in KES

Payouts

The Payouts page lets you request cash-outs from your platform balance.

To request a payout:

  1. Go to the Payouts page
  2. Enter the payout till number or phone number where funds should be sent
  3. Enter the amount
  4. Select the destination type (Till or Phone)
  5. Add any internal notes
  6. Submit the request

The page shows your current balance, pending payout amounts, and any limits based on your account verification tier.

M-Pesa settings

Go to the Settings page within the M-Pesa section to configure:

  • Segmentation scope — Choose whether to track transactions organization-wide or per-instance
  • Default payout till — Set a default destination for payouts
  • Per-instance overrides — Allow individual instances to have their own payout configuration

Tips for using payments

Keep payment reasons clear

When your agent or team requests a payment, include a clear reason. This appears in the M-Pesa transaction on the customer's phone and helps avoid confusion.

Monitor failure rates

A high failure rate might indicate issues with phone number formatting, customer balance issues, or network problems. Check the Transactions page regularly to identify patterns.

Set up payment instructions in your system prompt

If you want the AI to handle payments automatically, include clear instructions:

text
When a customer confirms they want to order, request payment via M-Pesa.
The payment reason should include the order details.
After payment is confirmed, send the order confirmation.
If payment fails, let the customer know they can try again.

Next steps