digital agency in Nairobi Burst Digital

Email us:

Call us:

(+254) 708 865 088

Contact Us

M-PESA API Integration: How to integrate Mpesa Into your Website or Application [2024 New Guide]

In Kenya, M-Pesa has revolutionized the way businesses and consumers handle financial transactions. It's more than just a payment method; it's a financial powerhouse that has redefined convenience. If you're considering accepting payments via M-Pesa on your website, you're about to unlock a world of opportunities. This comprehensive guide will walk you through the process step by step, from the requirements to going live.

What Is Lipa Na M-Pesa?

Before we dive into the nitty-gritty of integration, let's take a moment to grasp the significance of Lipa na M-Pesa. Translating to "Pay with M-Pesa," this mobile payment service by Safaricom has taken Kenya by storm. It's not just a payment method; it's a way of life for many. With the power to transform your online business, accepting Lipa na M-Pesa payments is a game-changer not just in Kenya but globally.

What is an M-Pesa API, and How Does Its Integration with Businesses Work?

An M-Pesa API, or Application Programming Interface, serves as a bridge that connects the M-Pesa platform with various applications. This integration empowers developers to create solutions for sending and receiving money, paying bills, and making purchases. Additionally, businesses can tap into the M-Pesa API to offer services like airtime top-up, balance inquiries, and customer registration.

M-Pesa API integration is the process that allows businesses to accept payments from their customers through M-Pesa pay bills or till numbers. This integration seamlessly embeds payment options within websites, mobile apps, and other digital platforms. Customers, in turn, can conveniently use their M-Pesa accounts to pay for products and services on these platforms.

Furthermore, this integration equips businesses with the ability to access valuable insights, including transaction histories and the flexibility to reverse payments when necessary. It's essential to note that all transactions conducted between businesses and customers are secure and comply with the terms and conditions set by M-Pesa and local financial institutions. This seamless integration streamlines financial interactions, enhancing the overall customer experience.

What Are the Benefits of Having an M-Pesa Integration?

M-Pesa integration with businesses brings a host of benefits, streamlining financial transactions and enhancing user experiences. Here's a closer look at the advantages that make it a game-changer for businesses in Kenya:

  1. Expanded Customer Base - M-Pesa boasts a substantial user base in Kenya, with over 23 million customers. For businesses, this means access to a broader audience and the opportunity to grow their customer base significantly.
  2. Improved Cash Flow - M-Pesa integration enables secure payment management and offers higher transaction limits, contributing to improved cash flow for businesses. This streamlined approach simplifies financial operations.
  3. Reduced Transaction Costs - In contrast to traditional payment methods, M-Pesa minimizes transaction costs, resulting in lower charges for customers. This cost-efficiency is a win-win for both businesses and their clientele.
  4. Enhanced Convenience - M-Pesa transactions are known for their security and convenience. Whether customers are at home, in the office, or on the go, they can make payments without concerns about their surroundings. The seamless nature of these transactions benefits businesses and customers alike.
  5. Increased Sales - The user-friendly M-Pesa API facilitates quick and trustworthy transactions. Customers have confidence in businesses that have integrated M-Pesa into their systems, leading to increased orders and, ultimately, higher sales.
  6. Streamlined Payment Management - M-Pesa integration enables businesses to sync payment transactions to their applications, websites, or systems, automating payment verification and management. This simplifies financial operations and enhances efficiency.
  7. Potential for Global Payments- M-Pesa's integration with PayPal and the recent Visa/Mastercard announcements opens up the possibility of global payments, adding an extra layer of convenience for businesses and their customers.

Embracing M-Pesa integration is not just about keeping up with trends; it's about optimizing your business's financial operations and enhancing the customer experience. By offering secure, efficient, and cost-effective payment options, businesses can unlock their full potential and achieve sustained growth.

How to Integrate M-Pesa Into Your Business Website Processes

To integrate your business with M-Pesa API, here are 4 steps you can follow for it to be successful;

Step 1: Ensure You Have a Paybill or Buygoods Number (Skip if You Have One)

Before proceeding with the integration process, make sure you already possess a Paybill or BuyGoods number. If you already have one, you can skip this step.

How to Get Safaricom Lipa Na M-pesa Till Number
  • Begin by requesting a Paybill or BuyGoods number, which can be easily done through the 'M-Pesa for Business' portal. Alternatively, you can send an email to or dial *234# from your Safaricom phone. Follow these steps to make your application:
  • Ensure you have the required documents in PDF format, including your company's KRA Pin certificate, a copy of company CR12 (validity 90 days), a scanned certificate of registration, front and back scanned copies of directors' IDs or passports, M-Pesa Authorization form (download it here) signed by two directors, directors' KRA PIN certificates, and bank details.
  • Once your application is reviewed and approved, Safaricom will email you the new M-Pesa Paybill or BuyGoods number. If further clarification is needed, you will receive an email requesting additional documents. The entire process typically takes around 24 hours.

Step 2: Create an account on M-Pesa G2 Portal

  • Gather the Required Documents: Ensure you have the following documents ready:
    • A scanned copy of your company's CR12 OR company registration certificate.
    • A scanned copy of the elected Administrator's ID (both front and back).
  • Administrator Form Filling: Proceed with the following steps for filling out the Business Administrator Form:
    • Download and fill the M-Pesa Business Administrator Form with your company's information.
    • Ensure the provided information matches the details on the CR12 and registration certificate.
  • Email Submission: To initiate the account creation process from Safaricom, send an email to with the documents attached, subject "Request for Mpesa Portal Login" and include the following message:
    • "To Whom It May Concern, Hello, Kindly create and provide me with the logins to the Mpesa Portal. Attached is the duly filled Business Administrator form, company registration certificate, and copies of IDs. Kind Regards."
  • Receive Login Credentials: Once you've submitted the necessary documents and request, Safaricom will process your application within 24-48 hours. You will receive an email containing your username and password for the M-Pesa Portal.
    • Proceed to Login to the M-Pesa G2 portal and go to “Operator management”
    • Create a user with the name “Business Manager”
    • Set phone number (not email) to get notification via SMS.
M-Pesa G2 Portal - Creating an Account Process

Step 3: Go Live on Daraja Portal

Daraja is a powerful portal that plays a significant role in M-Pesa API integration. Here's what it does and what you need to do:

  • Daraja Portal: The Daraja portal is essential for managing M-Pesa transactions. It allows you to access and test various M-Pesa APIs before going live.
  • Create a Developer Account: To utilize Daraja's capabilities, you need to create a developer account on the Daraja portal. This account will enable you to test the APIs and ensure everything runs smoothly before launching your integration.
  1. Access the Developer Portal: Go to the daraja developer portal and click "Go live."
  2. Verification and Setup:
  1. You will need to verify that you are the legitimate owner of the API before proceeding.
  2. The verification process includes the following substeps:
    • Upload Test Case: The first step involves uploading the test case.
    • Fill in Company Details: The next substeps will guide you on how to fill in the required forms:
      • Verification Type: Select "Short Code."
      • Organization Name: Enter your Paybill or Till name.
      • Organization Short Code: Enter either your Paybill number.
      • Mpesa User Name: Use the name you created in Step 2.
      • You will receive a One Time Password (OTP) sent to the number you registered in Step 1.
      • Enter the received OTP and click "Submit."
      • Ensure you've checked all the boxes and entered the OTP, then click "Submit."
  3. Switch to the Live App: Switch to the live app and utilize the live app's secret code and Consumer Keys. It should turn to green as shown below.
M-Pesa Api Integration - Approved Production Daraja App Example

Should you encounter any issues, reach out to Once your Daraja app is approved, you're all set to get started.

Step 4: Coding or No Coding?

The question of coding should not be a concern. After your application is approved, Safaricom will provide you with keys and instructions via email. We'll delve deeper into custom coding with other programming languages in an upcoming post, for now we will discuss options for using the keys with our WordPress approved plugin.

So, if you're running your business through a WordPress website and you want to accept payments through M-Pesa, we have a solution just for you - the Mpesa Push Toolkit for WordPress. It's a user-friendly plugin designed by our agency to streamline the integration process. Here's how you can integrate M-Pesa with your WordPress site using our plugin:

  1. Install the M-Pesa Push Toolkit for WordPress: First, you need to install our plugin on your WordPress website. You can download it directly from our plugin repository. Once installed, activate it.
  2. Configure the Plugin: After activation, go to your WordPress dashboard and navigate to the plugin settings. You'll find a user-friendly interface that lets you input the necessary details:
    • Live App's Secret Code: Copy and paste the live app's secret code that you obtained in the previous step.
    • Consumer Key: Enter your Consumer Key here.
    • Company Name: Fill in your company's name or business name.
  3. Save Your Settings: Save the settings, and you're all set! The plugin will work seamlessly, allowing you to accept payments from customers via M-Pesa. When someone tries to make a payment on your website, our plugin will send a push notification to the respective phone number, ensuring a smooth and secure transaction.
Mpesa Push Toolkit for WordPress
Mpesa Push on Mobile - Wordpress Mpesa Integration

Why Choose Our M-Pesa Push Toolkit

  • Simplified Integration: Our plugin eliminates the need for complex coding. It simplifies B2B, C2B, B2C, and callback URL configurations, making M-Pesa integration straightforward.
  • User-Friendly Interface: Enjoy a modern and intuitive design that makes setting up and managing payments a straightforward process.
  • Real-Time M-Pesa Push: Enable customers to make payments directly from their mobile devices with a secure PIN, enhancing efficiency and ease of use.
  • Detailed Transaction Records: Access thorough transaction records and analysis reports, empowering you to stay informed about your payment processes.

Whether you're running an online store, a booking system, or any other business through WordPress, you can seamlessly integrate M-Pesa payments with our plugin. Get started with the M-Pesa Push Toolkit for WordPress and offer your customers a convenient payment option. We also provide this service as part of our e-commerce package or separately at a flat fee of KES 3,000, including our plugin valued at $5. Our developers will handle everything for you if you find it challenging—all you need is a Paybill or Till number. Call us on 0708 065 088 or email us now to get started.

Stay tuned for our next post, where we'll explore more customized approaches to M-Pesa integration.

Tags :

How useful was this post?

Click on a star to rate it!

Average rating 4 / 5. Vote count: 1

No votes so far! Be the first to rate this post.


Recent Posts

Get Our Newsletter

Receive the latest news, updates, and promotions from Burst Digital.

Recommended Products

(6 customer reviews)

Duplicator makes it easy to create complete WordPress files and database backup within minutes. You can use Duplicator to create unlimited on-demand backups, or schedule automated backups on daily, weekly, monthly, or even hourly basis to ensure your website is fully protected at all times.

(5 customer reviews)

Supercharge your website’s SEO with Yoast SEO Premium. Elevate your content strategy, get advanced insights, and optimize your site like a pro. This premium bundle includes Video SEO, Local SEO, WooCommerce SEO, and lifetime updates.

(5 customer reviews)

Revolutionize the way you accept payments with our game-changing Mpesa Push Toolkit for WordPress. Seamlessly integrate M-Pesa into your WordPress site and unlock a world of effortless transactions. Read our full blog on how to integrate M-Pesa into your website using this plugin here.

Share on Social Media