# M-PESA

> M-PESA payment integration for businesses in Kenya, with STK push, offline Paybill, and M-PESA Till.

Paystack supports three M-PESA flows to accommodate different customer experiences. All M-PESA transactions use the `mobile_money` parameter with `KES` as the currency. We recommend that you include the country code in the phone number. For example, `0722000000` should be sent as `+254722000000` to the [Charge endpoint](/api/charge#create)

## STK Push

The most common flow where Paystack sends an STK (SIM Toolkit) push notification to the customer's phone. The customer enters their M-PESA PIN to approve the payment.
The response returns `data.status` as `pay_offline`. The `display_text` field describes the next step for the customer.

This is a commonly used in the following scenarios:

- **E-commerce checkout** - customer is ready to pay and can respond immediately
- **In-app payments** - real-time context, the app can show a "check your phone" prompt
- **Event ticketing**: time-sensitive purchases where instant confirmation matters
- **Donations and fundraising pages**: simple single-action flows

<localized-snippet src="payments/channels/mpesa-stk-charge">



</localized-snippet>

<callout title="Time limit" type="warning">

The customer must respond to the STK push within **180 seconds**. After this window, verify the transaction using the [Verify Transaction](/api/transaction#verify) endpoint to determine the final outcome.

</callout>

## Offline Payment

The offline option allows businesses to create a transaction that will be completed later. This is useful for businesses that offer payment after service delivery. The customer will pay to Paystack's Paybill and the generated `account_reference` will identify the transaction.

The biggest benefit to businesses is the transaction can’t be completed with the wrong amount. It’ll fail and the customer will have to start again.

This feature is commonly used in:

- Invoice generation
- Payment on delivery
- Customer-initiated payments at their own convenience
- Fallback when STK push is unavailable

<localized-snippet src="payments/channels/mpesa-offline-charge">



</localized-snippet>

<localized-snippet src="payments/channels/mpesa-offline-response">



</localized-snippet>

<callout title="Transaction Verification" type="info">

If the customer sends an incorrect amount, the transaction will fail automatically. A new charge must be created.

</callout>

## M-PESA Till

You can also get paid by other businesses from their M-PESA Till numbers. The `mobile_money` object should have provider set to `mptill` and the `account` which is the other business's M-PESA Till number. They will receive a prompt on the phone assigned the till for authorization. This channel is best suited for large M-PESA based transactions.

<localized-snippet src="payments/channels/mpesa-till-charge">



</localized-snippet>

## Webhook confirmation

Paystack sends a `charge.success` webhook on successful authorization. Always wait for the `charge.success` webhook before fulfilling orders.

<localized-snippet src="payments/channels/mpesa-webhook">



</localized-snippet>
