The verdict in three sentences
M-Pesa STK Push via the Daraja API sends a payment prompt straight to the customer's phone, with confirmation in 5 to 15 seconds. On the merchant side, paybill/till fees range from 0 to 0.5%, making it one of the cheapest flows on the continent. The Django integration rests on ShortCode validation, C2B/B2C callbacks and respecting the applicable daily cap.
The STK Push flow step by step
In Django, you get an OAuth token, send the STK Push request with amount and phone number, then receive the result on your callback URL. The CheckoutRequestID acts as the idempotency key.
| Parameter | Role | Example |
|---|---|---|
| BusinessShortCode | Merchant identifier | Paybill / Till |
| Password | Base64(ShortCode+Passkey+Timestamp) | Request security |
| Amount | Amount to debit | 1500 |
| PhoneNumber | Customer MSISDN | 2547XXXXXXXX |
| CallBackURL | Result delivery | HTTPS required |
| CheckoutRequestID | Idempotency key | Returned by Daraja |
Fees, delays and caps
M-Pesa stands out for very low merchant cost and near-instant confirmation, but with caps to watch.
| Criterion | M-Pesa Daraja | Mobile money benchmark |
|---|---|---|
| Merchant fee | 0 to 0.5% | 1.5 to 2% |
| Confirmation | 5 to 15 s | 30 to 120 s |
| Daily cap | 300,000 KES | Variable |
| Callback | C2B / B2C | Webhook |
| Sandbox | Free | Free |
| Idempotency | CheckoutRequestID | Unique reference |
These values are a 2026 order of magnitude; caps evolve with local regulation.
Need a professional website?
Kolonell builds websites that attract clients, optimized for the Sénégalese market. Free quote in 2 minutes.
Mini case study
Wanjiku runs an online course platform in Nairobi, collecting the equivalent of 6,000,000 FCFA/month via M-Pesa. At 0.4% merchant fee she pays ~24,000 FCFA/month, versus ~102,000 FCFA on a 1.7% flow. Confirmation in under 15 seconds also cuts her checkout abandonment by 8 points.
FAQ
Must the CallBackURL be HTTPS? Yes, Daraja requires a publicly reachable HTTPS URL. In development, expose your local Django server through a secure tunnel.
How do you handle idempotency? Store the CheckoutRequestID returned by Daraja with a unique constraint. Since the callback can arrive more than once, you ignore duplicates.
What happens if the customer never enters their PIN? The STK Push expires and Daraja returns a failure code. Never fulfil the order until the callback confirms payment.
Which cap should I watch? The standard daily cap is around 300,000 KES per customer. For higher amounts, plan a split or an alternative payment method.
Let's talk about your project. We integrate M-Pesa Daraja into your Django backend with reliable callbacks and idempotency. WhatsApp +221 77 596 93 33.
Mohamed Bah
Fondateur, Kolonell
Passionate about digital and entrepreneurship in Africa, Mohamed has been helping Sénégalese businesses with their digital transformation since 2020. Founder of Kolonell, he believes every SME deserves a professional and accessible online présence.
