M-Pesa setup
Connect your Till or Paybill, and every M-Pesa payment matches itself
ShelfWise connects to your own Till or Paybill through Daraja, Safaricom's official M-Pesa API. Nothing to install: Safaricom reports each payment to ShelfWise, so nobody checks M-Pesa messages by hand.
- Customers pay your own Till or Paybill: the money goes straight to you, and ShelfWise never holds it
- Safaricom tells ShelfWise about every payment the moment it arrives
- Each payment is matched to its sale, online order or booking by itself
- Send the customer an M-Pesa prompt from the till, and the sale completes when they enter their PIN
- Find any payment by M-Pesa code, phone number, name or amount
Before you start
- A Paybill, or a Till and its store number. For a Till, Safaricom uses the store number (the head office number) on Daraja, not the Till number customers pay to.
- A user on the M-Pesa business portal (org.ke.m-pesa.com) with the Business Manager role. Safaricom sends a confirmation code to this user's phone. If you don't have one, ask your Safaricom relationship manager or email [email protected]; this can take a few days.
- A free account at developer.safaricom.co.ke.
- Your business name exactly as Safaricom has it for your Paybill or Till.
Getting M-Pesa live
- 1
Go Live on the Daraja portal
- Sign in at developer.safaricom.co.ke and open Go Live.
- Choose verification by shortcode. Enter your Paybill number (or your store number for a Till), your business name and the Business Manager's username.
- Enter the code Safaricom sends to that user's phone.
- Choose the products M-Pesa Express and Customer to Business (C2B), and create the app.
- Open the new app and copy its consumer key and consumer secret. Keys from a test (sandbox) app won't work.
- 2
Get your M-Pesa Express passkey
- Safaricom emails the passkey to your business's administrator once Go Live is approved. It isn't shown on the portal.
- If it hasn't arrived after two working days, email [email protected] and ask for the M-Pesa Express (Lipa Na M-Pesa Online) passkey, giving your shortcode and app name.
- 3
Connect in ShelfWise
- On Settings → Payments, choose Till or Paybill and enter your numbers.
- Paste the consumer key, consumer secret and passkey, then click Connect M-Pesa.
- ShelfWise then asks Safaricom to report every payment to your number. When that works, a green note says so.
- 4
Test with KSh 1
- At the till, sell something for KSh 1, choose M-Pesa, send a prompt to your own phone and enter your PIN. The sale completes by itself.
- Pay KSh 1 to your Paybill or Till from your phone. It appears under Paid to Till at the till and on Payments received.
- If you use the online shop, place a small order and pay with M-Pesa.
If something goes wrong
- “Invalid access token”
- The keys are from a test (sandbox) app, or the live app doesn't include M-Pesa Express and C2B.
- “Invalid PartyB” with a Till
- The Till number and store number are swapped. The store number goes in Store number (head office).
- The prompt arrives but the payment fails
- The passkey belongs to a different number, often the Till instead of the store number. Ask Safaricom for the passkey for your store number.
- Safaricom isn't reporting payments made straight to your number
- Another system, such as an older POS, has already registered its addresses for your number, and Safaricom allows only one. Remove them in the Daraja portal (URL management), or email [email protected] and ask them to delete the C2B URLs for your shortcode. Then click Try again on Settings → Payments.
- A payment didn't match a sale
- Open Payments received and link it to the sale by hand. This happens when the amount is different or the cashier picked another payment.
Stuck on a step? Chat with us on WhatsApp at +254 768 306 493 and we'll help you get live. Open WhatsApp