eCommerce
8 min read

How to Accept M-Pesa on WordPress & WooCommerce: Complete Daraja STK Push Guide

Step-by-step tutorial on integrating Safaricom M-Pesa Daraja STK Push onto your WordPress WooCommerce store. Accept instant payments from Kenyan shoppers.

How to Accept M-Pesa on WordPress & WooCommerce: Complete Daraja STK Push Guide
Key Takeaway / Quick Answer

To accept M-Pesa on WooCommerce: 1) Acquire an active Safaricom Paybill or Till number, 2) Register on developer.safaricom.co.ke to generate Consumer Key, Secret, and Passkey, 3) Install a reputable M-Pesa STK Push plugin or custom webhook listener, 4) Configure live credentials with your Shortcode, and 5) Test live callback verification before taking customer orders.

Share this guide:

Google Snippet: How to Enable M-Pesa on WooCommerce

To integrate M-Pesa on WooCommerce: Apply for a Safaricom Paybill or Buy Goods Till, obtain Daraja API credentials (Consumer Key, Consumer Secret, and Passkey) from developer.safaricom.co.ke, install an M-Pesa gateway plugin, set your Shortcode, and run end-to-end sandbox and live STK Push tests.

Over 90% of online shoppers in Kenya prefer paying with Safaricom M-Pesa over credit cards. If your e-commerce store forces customers to manually copy a Paybill number and paste an SMS confirmation code, your cart abandonment rate will easily exceed 65%.

An automated M-Pesa STK Push (Express Checkout) completely solves this friction by sending a prompt straight to the customer's handset. Here is how you can set it up on WordPress and WooCommerce.

Prerequisites for M-Pesa Integration

  • A live WordPress website with WooCommerce installed and configured.
  • An active SSL certificate (HTTPS is mandatory for Daraja API webhooks).
  • A Safaricom Paybill or Till Number issued under a registered business name.
  • A Safaricom Developer Portal account (developer.safaricom.co.ke).

Step-by-Step Daraja API Setup

Step 1: Create an App on the Daraja Portal

Log into Safaricom Daraja, navigate to My Apps, and create a new application. Select Lipa Na M-Pesa Sandbox or request production access. Safaricom will issue you two crucial keys:

  • Consumer Key
  • Consumer Secret

Step 2: Install an M-Pesa WooCommerce Gateway

You can use established WordPress plugins or partner with developers like Xclusive Tech or Elite Designs Kenya to deploy a hardened, custom webhook implementation that prevents race conditions and duplicate orders.

Step 3: Configure Callback URL & Shortcode

In your WooCommerce Settings > Payments > M-Pesa, enter your Shortcode (Paybill/Till), your Daraja Passkey, and define the Instant Payment Notification (IPN) Callback URL. When a customer inputs their PIN, Safaricom sends a JSON payload confirming transaction status, automatically moving the order from Pending Payment to Processing.

"Building a bulletproof M-Pesa integration requires handling edge cases like network timeouts, insufficient funds, and customer cancellations without breaking inventory sync." — As highlighted in David Esabwa's e-commerce engineering guides.

Pairing Your Store with High-Converting Branding

A functional checkout is only half the battle. Shoppers must trust your site enough to enter their PIN. Professional product photography, polished badges, and crisp graphic elements from creative studios like Cyril Creatives turn casual visitors into confident buyers.

Need help integrating M-Pesa into your store or building a custom e-commerce portal from scratch? Explore our Web Development Services or get in touch today.

Frequently Asked Questions

Answers to common questions Kenyans ask about this topic on Google.

Share this guide:
David Esabwa

David Esabwa

Digitally Fit CEO 2026

Co-Founder & Lead Digital Strategist

David Esabwa is the Co-Founder and Lead Digital Strategist at Elite Designs Kenya. Recognized at the Digitally Fit Awards 2026 among Top CEOs Leading Upcoming Digitally Fit IT Firms, David specializes in high-performance web applications, M-Pesa architectures, and data-driven SEO growth systems for Kenyan enterprises.

Kenya's Award-Winning Web Firm

Ready to Turn Your Website into a 24/7 Revenue Engine?

Whether you need a bespoke corporate platform, automated M-Pesa e-commerce store, or top-ranking local SEO in Nairobi, Elite Designs Kenya delivers measurable results.

Sub-second page loading speed
Automated M-Pesa STK push setup
Built-in local Google SEO schemas
Transparent pricing & 99.9% uptime

Related Digital Guides

Continue exploring expert insights from Elite Designs Kenya.