Payments
Safaricom APIs Integration & Consulting
Guidance for Safaricom Daraja API integration in Kenya, including Lipa Na M-Pesa STK Push, C2B, B2C, Bill Manager, USSD, callbacks, and reconciliation.
Safaricom's Daraja API Gateway provides the connection point for adding M-Pesa services to applications, ERPs, billing systems, and mobile checkouts. Statum helps teams understand the integration boundary and fit the callback, authentication, and transaction flow into their own systems.
The work is specific to the system being connected. It may include a custom bridge, callback handling, security review, USSD session mapping, reconciliation, or support while the integration is tested.
Safaricom Developer APIs Directory
The directory below summarises the Safaricom services covered by this page. Confirm availability, onboarding requirements, and payload details in the current Safaricom developer portal before implementation:
Starts a payment prompt on the customer's phone. The customer confirms the request with their M-Pesa PIN.
Receives customer payments through a Paybill or Till and sends validation and confirmation callbacks to the configured server.
Sends money from a business wallet to individual recipients. Common uses include payouts, refunds, and disbursements.
Moves funds between business wallets for use cases such as supplier payments or corporate settlement.
Creates a payment QR code that a customer can scan from the M-Pesa application.
Enables corporations to programmatically remit taxes (such as KRA payments) directly from their M-Pesa business wallets to government treasury systems.
Checks the state of a specific M-Pesa transaction so your application can reconcile the result.
Reads the balance information exposed for a corporate Paybill or Till, including the account categories returned by the service.
Submits a request to reverse an incorrect payment, subject to the service's rules and the transaction state.
Supports invoice dispatch, billing setup, e-receipts, and payment reconciliation for connected billing systems.
Provides communication capabilities for outbound calls, SMS alerts, and authentication messages where enabled for the account.
Connects interactive menus such as *xxx# to an application backend for account, service, and payment flows.
Supports the documented business-to-Pochi disbursement flow for sending funds from a business wallet to a customer's merchant wallet.
Checks the SIM-swap information exposed to an authorised partner before a sensitive transaction.
Provides the subscriber and SIM information made available to authorised partners for security checks.
Supports the documented Lipa na Bonga payment flow for customers using eligible loyalty points.
Checks the shortcode and transfer information available to an authorised partner before sending money.
Validates mobile subscriber information available through the service before a transaction is submitted.
Moves funds to the documented B2C utility balance from a merchant or treasury system.
Supports recurring payment instructions, such as standing orders for subscriptions, bills, or loans, where the service is available.
Provides programmatic management for the IoT connectivity operations exposed by the portal.
Safaricom Daraja PHP & Laravel SDK
Use the open-source SDK as a starting point for Safaricom integrations. Check its repository for the APIs, framework support, and authentication behaviour currently implemented.
Consultancy Focus Areas
Safaricom integrations need careful handling of callbacks, credentials, timeouts, and reconciliation. Areas we commonly review include:
- Callback idempotency: Store a callback result before acknowledging it so a repeated notification does not create a second business event.
- Callback verification: Follow the verification mechanisms documented by Safaricom rather than relying on an unverified source address alone.
- Credential management: Keep consumer keys, secrets, and certificates out of the repository and restrict access to the services that need them.
- USSD flow design: Keep the interactive path small and move longer work out of the time-limited session.
- Reconciliation: Compare provider transaction records with your own ledger and make discrepancies visible for review.
Engage Statum for Safaricom Portal Integrations
If you are connecting a system to Daraja, adding corporate billing, or building a USSD flow, contact Statum with the service and transaction flow you are planning.