How to Integrate MTN MoMo API in Rwanda: A Developer's Guide
To integrate MTN MoMo API in Rwanda, you need: (1) a developer account on the MTN MoMo Developer Portal, (2) sandbox API credentials for testing, (3) an understanding of the Collections API (receiving payments from customers) and Disbursements API (sending money to users). The architecture follows a request-callback pattern: you initiate a payment, MoMo prompts the user on their phone, the user confirms, and MoMo sends a callback to your server with the result. This is the same pattern used by M-Pesa, Airtel Money, and most mobile money APIs in Africa.
Why MoMo Integration Is the Most Valuable Skill in Rwanda
MTN Mobile Money (MoMo) is Rwanda's dominant digital payment rail. When a Rwandan business needs to accept payments online, MoMo is the first option. When a customer wants to pay for a product or service digitally, they reach for MoMo. The developer who can make that payment flow work is the developer who gets hired.
Despite this, almost no online coding course teaches MoMo integration. Udemy teaches Stripe. YouTube tutorials teach PayPal. freeCodeCamp teaches generic payment concepts. None of them teach the callback architecture, the sandbox environment, or the specific patterns that mobile money APIs in East Africa use. This gap is your opportunity.
The good news: if you understand one mobile money API, you understand them all. The MTN MoMo API, the Safaricom M-Pesa Daraja API, and the Airtel Money API all follow the same fundamental pattern. Request, prompt, confirm, callback. The specifics differ (different endpoints, different authentication methods, different parameter names), but the architecture is the same. McTaba teaches this pattern using M-Pesa and Airtel Money, and the knowledge transfers directly to MoMo.
How the MoMo API Works (The Architecture)
Before touching any code, understand the flow. Every MoMo payment follows this sequence:
- Your app sends a payment request to MoMo. This is an HTTP POST to the MoMo API with the customer's phone number and the amount.
- MoMo sends a USSD prompt to the customer's phone. The customer sees a pop-up asking them to confirm the payment by entering their MoMo PIN.
- The customer confirms (or declines). This happens on their phone, outside your application. You do not control this step.
- MoMo sends a callback to your server. A POST request to a URL you specified, containing the transaction result (success, failure, or timeout).
- Your app updates based on the callback. Mark the order as paid, deliver the product, send a confirmation, whatever your business logic requires.
This is a request-callback pattern (sometimes called a webhook pattern). It is fundamentally different from Stripe or PayPal, where the payment happens in the browser and the result is immediately available. With MoMo, there is a delay between your request and the result because the customer has to interact with their phone. Your application needs to handle this asynchronous flow gracefully.
The same architecture applies to M-Pesa (via STK Push) and Airtel Money. If you have used either, MoMo will feel familiar. If you have not, learning this pattern once prepares you for all three.
Getting Started: The MoMo Developer Portal and Sandbox
MTN provides a developer portal and sandbox environment for testing. Here is how to get started.
- Create a developer account on the MTN MoMo Developer Portal (momodeveloper.mtn.com).
- Subscribe to the APIs you need. For most applications, you want the Collections API (to receive payments). If you also need to send money to users, add the Disbursements API.
- Generate sandbox credentials. The portal provides API keys and a sandbox user ID for testing. These credentials only work in the sandbox environment.
- Set up your development environment. You need a server that can send HTTP requests and receive callbacks. Node.js with Express is the most common setup for JavaScript developers.
The sandbox simulates the full payment flow without moving real money. You can test payment requests, callback handling, and error scenarios safely. Do all your development and testing here before applying for production access.
For a detailed, step-by-step walkthrough with code examples, read our MoMo API tutorial for beginners.
The Collections API (Receiving Payments)
The Collections API is what you use when a customer pays you. In MoMo terminology, this is a "Request to Pay" (sometimes abbreviated as C2B, consumer-to-business).
The basic flow in code:
- Authenticate. Get an access token using your API key and secret. Tokens expire after a set period, so your code needs to handle token refresh.
- Send a Request to Pay. POST to the Collections endpoint with the customer's MSISDN (phone number), the amount, the currency (RWF), and a unique reference ID for the transaction.
- Handle the callback. MoMo will POST the transaction result to your callback URL. Your server must be publicly accessible (not localhost) to receive this. During development, tools like ngrok can expose your local server to the internet.
- Verify the transaction status. As a fallback, you can also poll the transaction status endpoint using the reference ID. This is useful if your callback endpoint misses a notification.
Common mistakes at this stage:
- Forgetting that the callback URL must be publicly reachable. MoMo cannot send callbacks to localhost.
- Not handling the "pending" state. There is a gap between your request and the customer's confirmation. Your UI needs to show a waiting state, not assume instant success.
- Using production credentials in development. Always use sandbox credentials until you are ready to go live.
For the specific error codes and how to handle them, see our guide on common MoMo API errors.
The Disbursements API (Sending Money)
The Disbursements API lets you send money from your account to a customer's MoMo wallet. Use cases: refunds, payouts, cashback, salary disbursements, marketplace seller payments.
The flow is simpler than collections because there is no customer confirmation step. You send a disbursement request with the recipient's phone number and amount, and MoMo processes it. A callback confirms whether the transfer succeeded.
Disbursements carry more risk because you are sending real money. Production access for disbursements typically requires a more thorough review from MTN. In the sandbox, you can test freely.
The Pattern That Transfers Across All Mobile Money APIs
If you are learning MoMo API integration, you are simultaneously learning a pattern that works across African mobile money platforms:
- M-Pesa (Kenya): Uses STK Push for collections. Same request-callback architecture. Different endpoint URLs and authentication method (OAuth vs. API key), but identical flow.
- Airtel Money: Same request-callback pattern. Different API structure but the concepts are identical.
- Payment aggregators (IntouchPay, RwandaPay, Paypack): These abstract multiple mobile money providers behind a single API. The underlying pattern is still request-callback.
This is why McTaba teaches mobile money integration as a pattern, not as a single API tutorial. Our M-Pesa Integration course (KES 9,999, approximately RWF 100,000) covers the architecture, the callback model, the sandbox workflow, and the production deployment process. What you learn there applies directly to MoMo. The API endpoints are different. The architecture is the same.
If you want to learn mobile money integration from zero with structured instruction, this is the most efficient path. If you prefer to learn directly from MoMo's documentation, our beginner tutorial will guide you through the steps.
Going Live: From Sandbox to Production
Once your integration works in the sandbox, going live requires:
- Apply for production credentials. This is done through the MoMo Developer Portal. MTN reviews your application and the use case.
- Complete any required KYC or business verification. MTN needs to verify your business before allowing real money transactions through your application.
- Switch your API endpoints and credentials. Production endpoints are different from sandbox endpoints. Update your configuration without touching your core integration code (use environment variables).
- Test in production with small amounts. Even after going live, start with small test transactions to confirm everything works with real money before processing large volumes.
The production approval process takes time. Start it early, not on the day before your launch. For detailed guidance, see our guide on testing MoMo payments in sandbox and our Deployment and Going Live course (KES 4,999, approximately RWF 50,000).
Key Takeaways
- ✓The MTN MoMo API uses a request-callback architecture that is nearly identical to M-Pesa Daraja and Airtel Money APIs. If you understand one, you can adapt to the others.
- ✓Start in the sandbox. MoMo provides a test environment where you can simulate payments without real money. Never test with production credentials during development.
- ✓The two main APIs are Collections (C2B: customer pays you) and Disbursements (B2C: you pay the customer). Most applications start with Collections.
- ✓Callback handling is where most integration bugs live. Your server must be publicly accessible and able to receive POST requests from MoMo when a transaction completes.
- ✓Going live requires a formal approval process from MTN. Build and test thoroughly in sandbox before applying for production credentials.
Frequently Asked Questions
- Is the MoMo API free to use?
- The sandbox is free. Production usage involves transaction fees charged by MTN on each payment. The fee structure varies by transaction type and volume. Check with MTN Rwanda for current rates.
- What programming language should I use for MoMo integration?
- The MoMo API is language-agnostic (you send HTTP requests, which any language can do). Node.js (JavaScript) is the most common choice among East African developers and has the most community examples. Python, PHP, and Java all work equally well technically.
- Can I test MoMo integration without a business registration?
- Yes, in the sandbox. The sandbox does not require business verification. You can develop and test your entire integration as an individual developer. Business verification is only required when you apply for production credentials.
- How is MoMo API different from M-Pesa Daraja API?
- The architecture is the same (request-callback). The differences are in authentication (MoMo uses API key and user ID; Daraja uses OAuth), endpoint structure, and specific parameter names. A developer who understands one can learn the other in a day or two. Our comparison article covers the specific differences.
Ready to build real-world apps?
Join the McTaba Labs full-stack marathon (4 months full-time · 6 months part-time). Learn M-Pesa, USSD, and WhatsApp engineering while shipping 8 production apps.
Apply to the McTaba Marathon