How do I automate M-Pesa payments?
CiraIQ works with M-Pesa through your own Safaricom Daraja app, so money goes straight to your Paybill or Till and CiraIQ never holds it.
| Step | Use it to |
|---|---|
| M-Pesa Payment (trigger) | Start a workflow when someone pays your Paybill or Till. See payment triggers. |
| M-Pesa | Send a payment prompt (STK push) to a customer’s phone |
| M-Pesa Payout | Send money to phones: refunds, salaries, commissions (B2C) |
| M-Pesa Transaction | Check a payment by receipt number, or reverse one |
Connect M-Pesa
Section titled “Connect M-Pesa”From the Safaricom Daraja portal, add a connection with your app’s consumer key and consumer secret, your shortcode (Paybill or Till) and passkey. Start in the sandbox if you want to test, then switch to production keys.
Payouts, status checks and reversals also need an M-Pesa initiator connection: the initiator name and security credential Safaricom gives you for B2C.
CiraIQ sets up the callback addresses for you. There’s nothing to configure on your server.
M-Pesa (payment prompt)
Section titled “M-Pesa (payment prompt)”| Operation | Does |
|---|---|
| Request payment | Sends the “Enter your M-Pesa PIN” prompt to the customer’s phone |
| Check status | Checks whether an earlier prompt was paid |
| Setting | What it does |
|---|---|
| Phone | The customer’s number, 07… or 2547… |
| Amount | In KES |
| Account reference | What the customer sees, for example the invoice number |
| Description | A short note |
| Transaction type | Paybill or Buy Goods (Till) |
| Wait for result | Wait (up to a set number of seconds) for the customer to pay, then carry on with the result |
| Maximum amount | Refuse anything larger, as a safety check |
The result says whether the customer paid, cancelled or didn’t answer, with the M-Pesa receipt number when paid. Follow with an If / Else to thank them or chase them.
M-Pesa Payout
Section titled “M-Pesa Payout”Sends money from your B2C account to phones.
| Setting | What it does |
|---|---|
| Mode | One payout, or one per item (for example a payroll sheet) |
| Phone, Amount, Reference, Remarks | Who, how much and why |
| Payment type | Business payment, salary or promotion |
| Pay each reference once | Never pays the same reference twice, even if the workflow re-runs |
| Maximum per payout, Maximum per run, Most recipients, Daily limit | Hard limits that stop a mistake from becoming expensive |
| Delay between payouts | Space out bulk payouts |
| Dry run | Shows exactly what would be paid, without paying |
M-Pesa Transaction
Section titled “M-Pesa Transaction”| Operation | Does |
|---|---|
| Status | Look up a transaction by its M-Pesa receipt number |
| Reverse | Reverse a payment you received, for example a customer who paid the wrong number |
Reversals are off until you allow them, and have a maximum amount and a daily limit. Dry run is available here too.
Templates
Section titled “Templates”- M-Pesa Receipt by SMS for Every Payment
- Invoice Reminder Email with an M-Pesa Payment Prompt
- M-Pesa Bulk Payment Every Friday from Airtable
- M-Pesa Reversal Check for Wrong Payments
- M-Pesa for WooCommerce: STK Push on Every Order
See every M-Pesa template on the M-Pesa integration page.
Questions
Does CiraIQ hold my M-Pesa money?
No. CiraIQ uses your own Daraja app, so money goes straight to your Paybill or Till.
Can I send an STK push automatically?
Yes. The M-Pesa step's Request payment sends the PIN prompt to the customer's phone and can wait for the result.
How do I stop a payout mistake?
Use Dry run first, keep the per-payout, per-run and daily limits on, and turn on Pay each reference once.