Overview
Digital wallets (eSewa, Khalti) are Nepal’s payment backbone for e‑commerce. This case highlights architectural patterns enabling reliable payments on mobile networks with variable latency and coverage.
Key Architecture Themes
- API-First Design: Both apps rely on a robust set of RESTful APIs. This allows them to integrate with thousands of third-party merchants and banks using standardized JSON payloads.
- Mobile UX Resilience: Since mobile data in Nepal can be spotty, the apps use aggressive local caching for static assets (icons, merchant lists) and retry mechanisms for pending transactions.
- Idempotent Transactions: To prevent double-charging a customer due to a timed-out network connection, the backend uses unique transaction IDs to ensure a request is only processed once.
- Security Layers: Multi-factor authentication (MPIN + OTP), device binding (restricting an account to a specific phone), and SSL/TLS pinning for all web requests.
- Integration Ecosystem: Use of SDKs for web/mobile checkout and QR standards (Fonepay) to enable interoperability across the Nepali banking sector.
Outcomes
- Dominance over Cards: Local wallets are used more than debit/credit cards in Nepal due to their low-barrier infrastructure (smartphone vs. POS terminal).
- Embedded Finance: Payments are now seamlessly embedded into other web services (buying bus tickets, renewing movie subscriptions, or paying school fees).
Lessons (Unit 3 Lens)
- Reliability is a Product Feature: In a developing network like Nepal’s, the server must handle network variability gracefully.
- Clear API Contracts: Documentation for merchant APIs is essential for scaling an e-commerce ecosystem.
- Scalability of Microservices: Using a microservice architecture allows wallets to scale the “Payment Processing” service independently from the “Voucher/Offers” service during high-traffic events.
Chapters covered
- Internet & web infrastructure (3.1–3.3)
- Mobile platforms and app patterns (3.5)


