Skip to content
Log inSign up free
Payments

Setting up direct M-Pesa (Daraja API)

Connect your own Safaricom Daraja credentials if you don't want to use PayHero.

If you want to accept M-Pesa payments directly from Safaricom's Daraja API — without going through an aggregator like PayHero — you can. This is more work but gives you direct control. For most sellers, PayHero is much easier.

When to use direct Daraja vs PayHero

If both are configured, your shop hides direct M-Pesa and only shows PayHero at checkout — fewer points of failure for customers.

Before you start (direct Daraja)

You need:

Getting Daraja approval can take weeks. Plan accordingly.

Step 1 — Get your credentials from Safaricom

  1. Log in to developer.safaricom.co.ke
  2. Open your approved app
  3. Note the Consumer Key and Consumer Secret
  4. Under STK Push, generate a Passkey tied to your shortcode

Step 2 — Connect M-Pesa in your shop

  1. Go to Dashboard → Shop and scroll to the Accept Payments section
  2. Tap M-Pesa
  3. Enter your Shortcode, Consumer Key, Consumer Secret, and Passkey
  4. Save

Test before going live

The Daraja sandbox uses a test shortcode (174379) and a default test passkey. Use these first to confirm the flow works, then switch to your live credentials.

Common issues

Direct M-Pesa fees

You pay Safaricom's standard M-Pesa transaction fees (these vary by transaction size and shortcode type). No additional fee from us.

Still need help?

Can't find what you're looking for? Reach out and we'll get back to you.

Contact support
WhatsAppsupport@myduka.link+254797 560 650