Payment Processor script development
Develop a Payment processor easily
Payment Processor script
Accepts Cards, Mobile Money and existing gateways
Payment Processor script in PHP and Mysql
Get Started Today

How to do Mpesa API Integration in Kenya


There are two ways to learn how to integrate the Kenyan Mpesa API on your website or app for different purposes. One way to do the Mpesa API integration is adding on your already developed website and the second is to your developed Payment Gateway or process. The goal is to start accepting Mpesa mobile money Payments on your website or app.

How to Integrate the Mpesa API on your website

Follow below steps to add the Mpesa Mobile Payment Gateway or Method on your website.

  1. Step 1: Create an account on Daraja which is found on developer.safaricom.co.ke
  2. Step 2: Login Daraja and Create a sandbox App on Daraja
  3. Step 3: Copy the Consumer Key and Consumer secret for later use.
  4. Step 4: Navigate to the Test credentials page to get the sandbox shortcode and passkey.
  5. Step 5: Download the relevant Mpesa API plugin for your website depending on the technology or CMS or framework or programming language used to develop your website. Install and activate then enter the above copied Daraja App credentials then test on sandbox mode.
  6. Step 6: Go Live on Daraja to get the Mpesa Live credentials from Safaricom and enter them on the Mpesa API plugin and set it as live and you are done. You can test your work both on Sandbox and Production by simply toggling the Environment option.


Contact an Mpesa API integration expert now


To get help from our experienced Kenyan Mpesa API Integration experts, contact us via the below whatsapp link.

Contact us via WhatsApp

Adding Mpesa Payment Gateway on your Developed Payment Processor

When developing your Payment Gateway using the Payment Processor Script platform, you can choose to have your payment processor based on either Mpesa mobile alone of use it together with other Payment gateways. So long as you need it as part of basing your payment processing on, then you will need to understand how to integrate the Mpesa API to make it work automatically when processing Payments. Below are the steps.

  • Create an account on Payment Processor Script (payment-processor-script.com).
  • Login and Click "Develop a new gataway".
  • When on the Credit card or Payment processing Gateway step, choose Mpesa as one of the Gateways.
  • When done with the launch of your Payment Gateway, access the admin end.
  • Locate the Payment gateways and change the Mpesa plugin setting to add the credentials you copied from Step 1 to 6 on the above guide and save.
  • Test your integrated Mpesa Payment method by making a payment or Topping up an account on your developed gateway on the demo link which is located on Step 4 of 4 Payment Gateway Launch page.
Get started with your Mpesa integration journey now