M-Pesa Payment Gateway for Online Businesses

Accept M-Pesa payments in Kenya and Ethiopia through the A-Pay payment gateway. Add a local mobile money option to your online platform and connect customer payments to your existing business operations.

Integrate through a Host-to-Host API or a Hosted Payment Page. Our team will help you confirm the M-Pesa configuration available for your market and business model before you begin implementation.

Connect Mobile Money to Your Online Business

M-Pesa gives customers an alternative to card-based payments through their mobile money accounts. With A-Pay, businesses can incorporate this payment method into their existing platform without developing a separate payment infrastructure for each supported market.

M-Pesa
Mobile money account
Customer payment
Customer side
Payment
Payment gateway
Payment processing
A-Pay infrastructure
Payment result
● ● ●
Your online platform
Method
M-Pesa
Record
Customer order
Update according to payment result
Merchant side

Illustrative payment flow. The actual configuration depends on your project.

01 / CUSTOMER

A familiar way to pay

Let customers use their existing M-Pesa accounts when the method is enabled for your project.

02 / CONNECTION

Connected payment infrastructure

Manage M-Pesa alongside other supported local payment methods through your A-Pay integration.

03 / BUSINESS

Your business stays in control

Use payment results to determine when to update an order, credit a customer account or provide access to a paid digital service.

Where Can You Accept M-Pesa with A-Pay?

M-Pesa is available through A-Pay in two African markets: Kenya and Ethiopia. Although both markets have the same mobile money brand, payment configurations may differ. Your integration should reflect the country in which your customers make payments.

Kenya

Connect M-Pesa for the Kenyan market

If your platform serves customers in Kenya, discuss adding M-Pesa to your payment setup with A-Pay. Confirm the available transaction options and payment requirements for your project before implementation.

Explore Payments in Kenya ↗
EAST AFRICA
Kenya Ethiopia
Kenya
Ethiopia

Ethiopia

Extend your payment coverage to Ethiopia

If Ethiopia is part of your expansion strategy, you can discuss enabling M-Pesa for this market. Confirm its availability for your business independently of your Kenyan payment configuration.

Explore Payments in Ethiopia ↗

Schematic map. Payment method availability depends on your project configuration.

How M-Pesa Payments Work on Your Platform

Connecting M-Pesa involves more than displaying a mobile money option at checkout. Your platform needs to associate each payment attempt with a customer record and use the transaction result to determine what happens next.

01

Initiate a payment

Your platform creates a payment request associated with a specific order, service or customer account.

02

Follow the M-Pesa payment instructions

The customer proceeds with the payment using the M-Pesa flow configured for your project. The exact instructions depend on the approved market and integration setup.

03

Receive the transaction result

A-Pay communicates the payment status to your backend. Your system uses this information to identify the corresponding payment attempt.

04

Complete the business operation

Once a successful payment is confirmed, your platform can update the order, credit the customer account or activate the purchased service.

Payment lifecycle
M-Pesa
01 — PAYMENT REQUEST

Payment initiated

The merchant creates a payment request linked to a customer record.

Payment method
M-Pesa
Business record
Customer order
Stage
Request created
02 — CUSTOMER ACTION

Customer payment

The customer follows the payment instructions for the configured M-Pesa method.

Payment method
M-Pesa
Payment flow
Project-specific
Stage
Customer action
03 — TRANSACTION RESULT

Result communicated

A-Pay communicates the transaction status to the merchant's system.

Source
A-Pay
Destination
Merchant backend
Stage
Status handling
04 — MERCHANT ACTION

Order record updated

Following a confirmed successful payment, the merchant completes the corresponding business operation.

Example result
Successful payment
Action
Update order
Managed by
Merchant platform

Illustrative payment lifecycle. Actual payment instructions and transaction results depend on your project configuration.

Design Your M-Pesa Checkout Experience

Adding M-Pesa to your platform requires planning how customers move between your website and the configured mobile money payment flow. Consider the information customers need before paying, during the payment process and when returning to your platform.

● ● ●
Your online platform
Payment overview
Review your payment details
Selected payment method
M-Pesa
Payable amount
Order total
Currency
Local currency
Next step
Follow the payment instructions configured for your M-Pesa payment.
Continue to payment
Return to your platform
View the payment result
Desktop
Mobile browser
01

Before the payment

Display the selected payment method, payable amount and relevant currency clearly. Customers should understand which payment option they have chosen before proceeding.

02

During the payment

Keep additional instructions specific to the M-Pesa configuration enabled for your project. Avoid displaying generic mobile money instructions that may not match the customer's actual payment journey.

03

Back on your platform

Design a clear return experience that helps customers understand the current state of their payment and whether any further action is required.

04

Across different devices

Consider how the payment experience works across desktop websites and mobile browsers, particularly when customers use a separate mobile device to complete a payment.

Illustrative checkout concept. Actual payment screens and instructions depend on your project configuration.

M-Pesa Payment Gateway Integration Options

Choose an integration approach that fits your existing payment infrastructure, development resources and interface requirements. A-Pay offers two ways to connect its payment gateway: Host-to-Host API and a Hosted Payment Page.

DIRECT API CONNECTION

Host-to-Host API

Build around your existing platform

Your platform
Merchant backend
API
A-Pay
Payment gateway
Merchant-controlled payment interface
  • Develop a payment interface within your own platform.
  • Connect your backend to the A-Pay API.
  • Implement payment status handling in your system.
  • Adapt the customer journey to the approved M-Pesa configuration.

Best suited for Businesses that want greater control over their payment interface and have the development resources to maintain it.

HOSTED CHECKOUT

Hosted Payment Page

Use a provider-hosted payment interface

● ● ●
Your platform
 
 
Continue
Redirect
● ● ●   A-Pay
Payment page
 
M-Pesa
Proceed to payment
Customer redirected to the hosted interface
  • Create payment requests through your backend.
  • Direct customers to the hosted payment page.
  • Offer M-Pesa when enabled for your project.
  • Handle transaction results within your platform.

Best suited for Businesses that prefer to use a hosted payment interface rather than develop every part of the payment screen themselves.

Both integration options require backend implementation. Discuss your technical requirements with A-Pay to determine which approach fits your M-Pesa payment configuration.

Handling Incomplete M-Pesa Payments

Not every mobile money payment is completed on the first attempt. Prepare your platform and customer support team to handle different payment outcomes without creating confusion for customers or inconsistencies in your internal records.

Payment operations
M-Pesa
Customer situation
Recommended merchant action
Payment interrupted

The customer leaves the payment process

Recommended action

If a customer exits the payment flow before completing the transaction, keep the original order or account record available. Determine the next action based on the actual payment status.

Awaiting confirmation

The payment result is not yet confirmed

Recommended action

Avoid treating an unconfirmed transaction as successful. Display an appropriate message on your platform while your system checks the available payment information.

Support request

The customer reports a payment issue

Recommended action

Collect the relevant transaction reference and payment details. Use this information when investigating the transaction or contacting A-Pay's technical support team.

New payment attempt

The customer wants to try again

Recommended action

Check the previous payment attempt before initiating another one. Your platform should distinguish separate transactions to avoid processing the same business operation twice.

Illustrative payment situations and recommended merchant actions, not official A-Pay API status names.

Prepare Your Business for M-Pesa Integration

Before starting your M-Pesa integration, prepare the information A-Pay needs to evaluate your project. A clear understanding of your business requirements helps define the appropriate payment configuration and technical implementation.

01

Describe your business

Share your business model, website or platform details and the purpose of customer payments.

02

Define your target market

Specify whether your project requires M-Pesa in Kenya, Ethiopia or both markets. Each country configuration needs to be considered separately.

03

Discuss processing requirements

Provide your expected transaction volumes, preferred payment amounts and the payment operations your business requires.

04

Agree on the integration approach

Confirm the available M-Pesa configuration, complete the required merchant verification and coordinate implementation and testing with the A-Pay team before launch.

Ready to Accept M-Pesa Payments?

Ready to Accept M-Pesa Payments?

Frequently Asked Questions