MPESA API: How to integrate Mpesa to your Website or Application

Mpesa integration is the syncing of an application, website or system with the Mpesa web API with the goal of automating payment verification and management of payments

M-Pesa has approximately 30 million users in Kenya. This number extends by 20 million when you add users across other parts of Africa, such as Tanzania, the Democratic Republic of Congo (DRC), Mozambique, Lesotho, Ghana and Egypt. 

This reach can work as a gold mine for a business in Africa that wishes to collect and receive payments using Mpesa.

Getting access to Mpesa will be a long strenuous process. There are alternatives to getting started on Mpesa API that is less stressful. We highly recommend using KopoKopo instead. 

For the brave, this article will address how to connect Mpesa to your business processes using HelloDuty.

What are the benefits of having an Mpesa integration?

Integrating to  M-Pesa API provided the ability to sync payment transactions to your application, website or system with the Mpesa web API to automate payment verification and management of payments.

With the Mpesa Paypal integration, it is only a matter of time to see users being able to pay directly from Paypal to your Mpesa paybill. This is not to forget the recently announced Visa/Mastercard integrations.

How to integrate Mpesa into your business processes.

Follow the following 4 steps

1. Request for a Paybill or a BuyGoods number.

There are multiple ways to request a BuyGoods or Paybill number. The easiest is via the 'Mpesa for business' portal . 

The others include sending an email to and dialling *234# from your Safaricom phone number. Then select 'merchant services' followed by 'my request'. 
Before making your application, make sure you have the following documents

  • Company KRA Pin certificate 
  • Copy of CR12 (Validity 90 days)
  • Scanned copy of the certificate of registration
  • Front and back scanned copies of the directors Id's or Passport
  • Mpesa Authorization ( form signed by two directors. 
  • Directors' KRA PIN certificates
  • Bank details.

All the above documents need to be in PDF format. 

If you have any questions about the process, you can find answers in the FAQ.

Once your application has been reviewed and approved, you will receive an email from Safaricom with your new Mpesa Paybill or BuyGoods number. Otherwise, you will receive an email asking for more documents if they need clarification. Note that it might take 24 hours for a response to each communication. To cut on the turnaround time, ensure you provide the correct details.

2. Request for access to the portal.

Mpesa G2 portal

Most developers in Kenya are familiar with Mpesa Daraja , but many might not know of the G2 portal.

To access the Mpesa G2 portal, you must send the following documents to in PDF,

  • A scan of your company's CR12 and company registration certificate.
  • A scan of the elected Administrator's ID both front and back.
  • A signed and stamped Administrator Form signed by at least two signatories. 

Indicate this in bold if it's a sole proprietorship or a company with a single director. 

Cross your fingers; in 24 - 48 hours, you should receive an email with your username and password, with instructions on how to log in to the G2 portal. 

Ensure you visit the Mpesa portal to sign in and change your passwords before you proceed. Create both a Business Admin and a Business Manager user and log in to them.

3. Go Live on Daraja

Mpesa daraja portal

Congratulations on getting to this step. You are a moment away from going live and activating your Mpesa tokens. 

Head over to Daraja and click on the 'Go Live' and input the following values:

  • Verification Type: Short Code
  • Organisation Short Code : [Your Paybil or BuyGoods]
  • Organisation Name: [As submitted in your application]
  • Mpesa Username: [Either the Business Admin or Business Manager]

If you get an error like "Verification failed! Paybill or M-Pesa username keyed in does not exist", write an email to

Finally, write an email to and ask them to approve your Daraja app. You are now ready to get started. 

4. To code or no code?

That should not be the question. Once your application is approved, you will receive an email from Safaricom with the keys and instructions on how to proceed. Use a platform like Hello Duty to add Mpesa into your business process without requiring code or a developer.

Single Inbox

Are you ready to get started? sign up for our forever FREE version of Brrng CRM and customer engagement automation software now.

Nancy Njeri
January 19, 2023

Relationships that matter.

Plan, engage, and analyse with ease. Transform your customer relationship with an all-in-one platform.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.