Intermediate

M-Pesa Integration for Developers

The definitive guide to building payment systems with Safaricom's Daraja API, from your first STK Push to production-grade payment infrastructure.

4.910 modules57 lessons25-30 hoursCertificate included
B
Bonaventure Ogeto10,000+ students

What You'll Learn

Foundations
Authentication
Stk Push
C2b Payments
B2c Disbursements
Transaction Queries
Webhooks Deep Dive
Testing And Sandbox
Going To Production
Capstone Paylink

Course Curriculum

10 modules · 57 lessons · 17h total

Module 1: Foundations

5 lessons
Lesson 1.1: What is M-Pesa and the Daraja API?
Free13m
Lesson 1.2: How M-Pesa Works Technically
Free16m
Lesson 1.3: Setting Up Your Daraja Developer Account
13m
Lesson 1.4: Understanding the Daraja API Architecture
16m
Lesson 1.5: Your First API Call -- Getting an Access Token
18m

Module 2: Authentication

4 lessons
Lesson 2.1: OAuth in the Context of Daraja
13m
Lesson 2.2: Building a Reusable Auth Module
15m
Lesson 2.3: Token Caching and Refresh Strategies
17m
Lesson 2.4: Securing Your Credentials
17m

Module 3: Stk Push

6 lessons
Lesson 3.1: How STK Push Works (Full Lifecycle)
14m
Lesson 3.2: Building STK Push from Scratch
19m
Lesson 3.3: Handling STK Push Callbacks
14m
Lesson 3.4: Polling vs Webhooks — Checking Payment Status
17m
Lesson 3.5: STK Push Error Handling — Everything That Can Go Wrong
19m
Lesson 3.6: Building a Payment Form UI
21m

Module 4: C2b Payments

5 lessons
Lesson 4.1: C2B vs STK Push — When to Use Which
15m
Lesson 4.2: Registering C2B URLs
16m
Lesson 4.3: Handling Validation and Confirmation
22m
Lesson 4.4: Paybill vs Till Number
17m
Lesson 4.5: Reconciling C2B Payments
23m

Module 5: B2c Disbursements

4 lessons
Lesson 5.1: When to Use B2C
15m
Lesson 5.2: Building B2C Payouts
18m
Lesson 5.3: B2C Callbacks and Status
20m
Lesson 5.4: B2C Security and Limits
28m

Module 6: Transaction Queries

4 lessons
Lesson 6.1: Transaction Status API
17m
Lesson 6.2: Account Balance API
17m
Lesson 6.3: Reversal API
18m
Lesson 6.4: Building a Transaction Dashboard
23m

Module 7: Webhooks Deep Dive

5 lessons
Lesson 7.1: Webhook Architecture
16m
Lesson 7.2: Securing Webhooks
16m
Lesson 7.3: Retry Logic and Idempotency
16m
Lesson 7.4: Logging and Debugging Callbacks
17m
Lesson 7.5: ngrok and Local Development
16m

Module 8: Testing And Sandbox

4 lessons
Lesson 8.1: The Daraja Sandbox Deep Dive
16m
Lesson 8.2: Simulating All Scenarios
22m
Lesson 8.3: Writing Automated Tests
22m
Lesson 8.4: Common Sandbox Pitfalls
23m

Module 9: Going To Production

5 lessons
Lesson 9.1: Safaricom's Go-Live Process
15m
Lesson 9.2: Production Credentials
16m
Lesson 9.3: Production Checklist
19m
Lesson 9.4: Monitoring and Alerting
20m
Lesson 9.5: Handling Production Failures
24m

Module 10: Capstone Paylink

10 lessons
Lesson 10.1: Project Overview and Architecture
19m
Lesson 10.2: Backend Setup and Database
25m
Lesson 10.3: Payment Link Generation
16m
Lesson 10.4: STK Push Integration
22m
Lesson 10.5: Callback Handling and Status
21m
Lesson 10.6: PDF Receipt Generation
18m
Lesson 10.7: React Frontend — Dashboard
20m
Lesson 10.8: Payment Page and Polling
20m
Lesson 10.9: Deployment to Production
17m
Lesson 10.10: Extensions and Next Steps
17m

Appendices

Reference materials and cheatsheets

5 lessons
Appendix A: Daraja Error Codes Reference
APPENDIX13m
Appendix B: M-Pesa Phone Number Formatting
APPENDIX9m
Appendix C: Timestamp and Password Generation
APPENDIX11m
Appendix D: Environment Variables Template
APPENDIX8m
Appendix E: Glossary
APPENDIX13m

About the Instructor

B

Bonaventure Ogeto

Founder, Mctaba Labs

Software engineer building products for the African market. 10,000+ students taught across multiple platforms. BSc Mathematics & Computer Science from JKUAT.

10K+ students 4.9/5 rating

Frequently Asked Questions

How long do I have access?

Lifetime. Once you purchase, you have access to all current and future updates to this course.

What payment methods do you accept?

M-Pesa and international cards (Visa, Mastercard) via Paystack.

Can I preview content before buying?

Yes! The first two lessons are free to preview. No purchase required.

Who teaches this course?

Bonaventure Ogeto, founder of Mctaba Labs, a Nairobi-based software company that builds the tools and products we teach about.

KES 9,999one-time
Enroll Now