Join the M-Pesa online payment revolution
Let M-Pesa transform your business by helping you make and receive payments in an instant.
Ready?
Let M-Pesa transform your business by helping you make and receive payments in an instant.
Ready?
Welcome to M-Pesa’s Developer Portal! In this web portal, we have exposed API endpoints and provided an automated workflow to easily integrate with the M-Pesa Payments Gateway for accessing and using M-Pesa services. The M-Pesa API endpoints exposed include services for customer to business (C2B), reversals and transaction status queries interactions.
To use our APIs or invoke an API endpoint, you will need to register for an account. By registering for an account, you will be able to access all the needed API package information in order to develop your own call to M-Pesa.
An account activation link will be sent in an email to the email address used in registration. When signing in, you will be required to add your phone number as the final step to register and activate your account. Once the account has been activated, you will have access to the API documentation and will be able to test API calls to the M-Pesa Payments Gateway.
Once logged in, you will have access to the following pages:
Detailed documents for the available exposed APIs. Currently we offer the C2B (Customer to Business), Reversals and Transaction Status Query APIs. More will be added in due time. The developer will be able to build the necessary header and request package content that needs to be fired as well as view the associated response package. To get you started, we have provided code samples in Java and Python.
From the Reports tab, you can gauge how your API is performing over a period of time. Transaction details for the API invoked will be able to be viewed in both Table and Chart format.
From the My Profile tab, you can update personal details and update account details (username and password). During registration, an API Key has been created automatically and assigned to your profile. You are also able to renew the API key used to authenticate your account credentials when using the various exposed APIs. Once the development is complete and testing was successful, you will be able to post your account details and transaction reports to Vodafone M-Pesa personnel who will verify the development before taking your service live on M-Pesa.
The APIs that have been exposed are clearly documented in their respective sections. Following along with the structure and parameters will allow you to rapidly build the correct API package to seamlessly integrate with Mobile Money services, allowing for convenient payment opportunities for your business and your customers.
The APIs exposed are RESTful APIs that break down transactions into a series of small modules, each addressing an underlying part of the transaction. The REST APIs provide developers with all the tools to effectively interact with the M-Pesa Payments Gateway using the API.
A library file has been provided to facilitate the authentication and communication with the M-Pesa Payments Gateway server. For example: “portal-sdk.jar” for the JAVA programmers. The Library file can be downloaded and included in your development environment (e.g. Eclipse, Maven, etc.). The library file encrypts the user’s API Key and Public Keys. Should you wish to build your API package without the use of the library file inclusion you can follow along with the steps in the “Develop without Library File” section.
When registering for a developer account on the Integration Portal, you will receive access to your API Key and your Public Key in your Account Profile [link to Account/Profile]. The API Key and Public Key are used to authorize and authenticate your account on the M-Pesa Payments Gateway System. Once authenticated and authorized, your API can be initiated. You are able to renew your API key by going to your Account Profile and clicking on “Renew API Key”. Remember to include the new API key in your actual request package.
The M-Pesa Developer Portal allows developers the following functions:
A reports tab has been provided to allow you to monitor and gauge how your API is performing over a period of time. You can define the date range of data to include within your report. The last Active API Key will be selected by default. By clicking Generate, a list of transactions using the API Key will be displayed.
If you have reset your API Key (which allows you to generate a new API key), previous inactive API keys will also be available to show their respective transactions.
When the API has been developed correctly and transactions between your app and MPesa’s Payment Gateway is successful, you are ready to go live. Please note: successful transactions is needed to prove that your API is indeed working.
From your account profile, click on the “Go Live!” button. The Go Live button retrieves the latest generated report from your API Key and send it on, with your account details, to Vodafone M-Pesa. This allows Vodafone M-Pesa to review your API integration and advise if you are able to go live.