M-PESA API
Daraja, the M-PESA API platform, provides open interfaces through web services that allow developers and partners to connect directly to the M-PESA core system. Through Daraja, businesses can build applications that integrate seamlessly with M-PESA, enabling innovation, automation, and more flexible business operations.
We’ve consolidated the various interfaces developers have requested to make it easier to create and scale solutions that plug into M-PESA, supporting everything from payment processing to real-time reconciliation.
Daraja is open to both individuals and companies interested in accessing M-PESA APIs.
Target Audience
The M-PESA API targets integrators and developers who directly consume the APIs, as well as business owners who use them for payment reconciliation and day-to-day operations.
Access and Onboarding
Developers and partners can access M-PESA API services through Daraja by visiting https://developer.safaricom.co.ke, creating an account, loading their app details, performing tests, and then moving their app to production or integration.
Available APIs
The M-PESA platform offers a range of APIs to support different business needs:
- C2B (Customer to Business) – For customer payments, with confirmation and validation.
- B2C (Business to Customer) – For disbursing payments such as salaries, supplier payments, or refunds.
- B2B (Business to Business) – For payments between businesses.
- Transaction Query – For checking the status and details of a transaction.
- Account Balance – For checking a Paybill organization’s account balance.
- Lipa Na M-PESA Online Payment API – For customer payments through applications that complete transactions via M-PESA PIN.
- Lipa Na M-PESA Online Query API – For checking transaction details for Lipa Na M-PESA Online.
What You Can Do with Daraja
- Automated Payment Receipt Processing
Previously, payment receipts were handled through Instant Payment Notification (IPN), which only provided notifications.
With Daraja, this process is enhanced by adding an optional validation step for Paybill payments. Merchants can now confirm whether to accept an incoming payment based on details like:
- Account number
- Amount
- Sender details
This helps reduce common payment errors, ensuring smoother processing and fewer reversals.
- Automated Payment Disbursements (B2C API)
Many systems that receive payments also need to send them.
The B2C API automates disbursements, allowing developers to:
- Initiate payments directly from their systems
- Eliminate manual file generation and uploads
- Handle large disbursements efficiently and securely
This makes bulk payments faster, easier, and less prone to errors.
- Automated Payment Reversals
If a merchant cannot deliver a paid-for service, the G2 system supports secure, automated reversals.
Merchants can build custom reversal workflows that fit their business operations and internal controls — ensuring flexibility and transparency in refund processes.
The Future of M-PESA Innovation
The future we once imagined of machine-to-machine payments is here. With the M-PESA API, developers can automate payment journeys end-to-end, connect systems in real time, and build solutions for what’s next.
Get Started
For feedback, onboarding, or integration support, reach out to:
To begin your integration journey, visit https://developer.safaricom.co.ke and explore the Daraja platform.
Who can I call for support?
Prepaid customers can call 100, while those on Post-pay can call 200
Social Media handles
- Twitter: @SafaricomPLC and @Safaricom Care
- Facebook: https://www.facebook.com/SafaricomPLC., Safaricom Kenya Official Page
- E-mail:
This email address is being protected from spambots. You need JavaScript enabled to view it. orThis email address is being protected from spambots. You need JavaScript enabled to view it. @safaricom.co.ke
Frequently Asked Questions
You must have an Lipa na M-PESA shortcode.
Developers and partners can access Daraja by login to https://developer.safaricom.co.ke/,
The developer will require to provide the following details to create an account:
- Developers Name
- Primary contacts – email, company, and phone
- Country
- Username
- Email address
- Mobile contacts
a) Integrators & Developers
- Simpler onboarding process
- Less complex programming language
- Documentation is available
- Available online support channels
- A sandbox environment for testing
b) Business Owners
- Improved customer experience. There is efficiency in the collection of payments
- Easier reconciliation of payments


, how can I help you today?
