eSewa & Khalti Payment Integration Guide for Nepal Websites
How to integrate eSewa and Khalti payments into your Nepal website or app. Developer guide: API setup, sandbox testing, and best practices.
Why eSewa and Khalti Integration is Essential for Nepal Websites
Cash on delivery accounts for only 42% of Nepal's online transactions as of 2024. eSewa and Khalti together command over 80% of Nepal's digital payment market. Any Nepal website or app that doesn't support these payment methods will see cart abandonment rates of 50–70%.
eSewa vs Khalti — Which to Integrate First?
| Factor | eSewa | Khalti |
|---|---|---|
| Market Share | ~55% | ~35% |
| Users | 8M+ active | 5M+ active |
| Merchant Fee | 1.5–2% | 1.5–2% |
| Settlement Time | T+1 | T+1 |
| API Documentation | Good | Excellent |
| Sandbox Environment | Available | Available |
| SDK for Flutter | Available | Available |
How to Get a Merchant Account
eSewa Merchant Account
- Go to esewa.com.np → Business → Become a Merchant
- Submit: Company registration certificate, PAN certificate, bank account details
- Processing time: 3–7 working days
- You'll receive: Merchant ID, Secret Key, API credentials
Khalti Merchant Account
- Go to khalti.com → Merchants → Register
- Submit: Business registration, PAN, bank details, website URL
- Processing time: 2–5 working days
- You'll receive: Live Key, Secret Key, Merchant ID
Integration Approaches for Nepal Websites
Direct API Integration (Recommended for Custom Sites)
For custom Django, Laravel, or Node.js websites, direct API integration gives full control. Both eSewa and Khalti provide REST APIs with clear documentation.
WordPress/WooCommerce Plugin
Several Nepal developers have built WooCommerce payment plugins for eSewa and Khalti. Install from WordPress plugin directory and configure with your merchant credentials.
Payment Gateway Wrapper (For Multiple Gateways)
Services like Fonepay and PayWay act as wrappers, letting you accept eSewa, Khalti, bank cards, and ConnectIPS from a single integration.
Testing Your Integration
Both eSewa and Khalti provide sandbox environments for testing:
- eSewa sandbox: Use test merchant ID and test phone numbers provided in documentation
- Khalti sandbox: Use testpid and test API keys with NPR amounts in paisa (1 NPR = 100 paisa)
- Always test the full flow: initiate payment → confirm → verify → handle failure
Common eSewa/Khalti Integration Mistakes
- Not verifying payment on the server side (client-only verification is insecure)
- Using live keys in development (creates real transactions)
- Not handling payment failures gracefully
- Displaying prices in paisa instead of NPR to users
- Not testing refund flows
Neuro AI Nepal integrates eSewa, Khalti, and ConnectIPS into websites and apps. Contact us for payment integration in your existing project.