Safaricom M-Pesa
Connect your Safaricom M-Pesa Paybill or Buy Goods Till to automate hotspot purchases and recurring PPPoE bill collections.
Integrating Safaricom M-Pesa
Safaricom M-Pesa is the primary mobile money payment channel across Kenya. Nukta integrates natively with Safaricom's Daraja API to support both:
- M-Pesa Express (STK Push): Dispatches an automated PIN authorization prompt directly to customer mobile handsets when they initiate checkout on captive portals or invoices.
- Customer to Business (C2B): Listens for incoming payments made directly to your Paybill or Buy Goods Till number via the customer's phone SIM menu, automatically matching the transaction to their account.
Step-by-step M-Pesa configuration
Step 1: Create a Daraja developer app
- Log in to the Safaricom Daraja Developer Portal.
- Navigate to My Apps and click Create App.
- Name your app
Nuktaand check the Lipa na M-Pesa Online (STK Push) and Customer-to-Business (C2B) checkboxes. - Click Create App.
- Copy your Consumer Key and Consumer Secret.
Step 2: Retrieve your production passkey
- If using a standard Safaricom Daraja production account, your Passkey is generated in your Safaricom merchant onboarding portal or issued securely by Safaricom API support upon production go-live.
- The passkey is a 64-character base64 string required to authenticate STK push requests.
Step 3: Enter credentials in your Nukta dashboard
- In your Nukta dashboard, navigate to Settings → Payments.
- Locate the Safaricom M-Pesa card and click Configure.
- Fill in your merchant parameters:
- Shortcode Type: Select
PaybillorBuy Goods / Till. - Business Shortcode: Enter your Paybill or Till number.
- Consumer Key: Paste from Daraja.
- Consumer Secret: Paste from Daraja.
- Passkey: Paste your Lipa na M-Pesa Online passkey.
- Shortcode Type: Select
- Review the pre-generated Confirmation URL (
https://{subdomain}.nukta.one/api/payments/saf/callback) and Validation URL (https://{subdomain}.nukta.one/api/payments/saf/validation) displayed on the screen. - Click Run Readiness Test to confirm credentials.
- Toggle the status to Live and click Save Changes.
Automated transaction matching
When an M-Pesa payment arrives, Nukta's intelligent payment matcher processes the payment:
- Exact Account Match: For Paybill transactions, Nukta matches the entered Account Number against your customer usernames (e.g.,
S102). - Mobile Phone Match: If the account number does not match an existing customer (or if payment was sent to a Buy Goods Till without an account field), Nukta searches your directory for a customer registered with that mobile phone number.
- Instant Activation: The matching customer's account validity is extended, the transaction is logged in Finance → Payments, and speed queues are applied on the router in under three seconds.
- SMS Receipt Confirmation: If automated SMS notifications are enabled under Settings → Notifications, the customer immediately receives an SMS confirming payment and their updated expiration date.