About this case. eSewa and Khalti are real Nepali digital wallets. The architecture described here shows patterns commonly used by mobile wallets and payment apps; it is not based on internal documentation from either company.

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.

Background

When digital wallets started in Nepal, few people had credit cards and card terminals were rare outside large shops. Mobile phones, however, were spreading quickly. Wallets let customers load money from a bank or an agent, then pay merchants, bills, and other people from an app. To succeed, a wallet must work on low-cost phones, on slow or patchy mobile data, and for users with little experience of online payments, while protecting their money from fraud.

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.

The Numbers

  • Suppose a wallet handles 50 payments a second at a festival peak, and 2% of requests time out on weak mobile connections.
  • That is 1 timed-out request a second, or 3,600 in an hour.
  • If the app simply retried without an idempotency key, many customers could be charged twice.
  • With a unique transaction ID on every request, the server recognises a retry and returns the original result instead of charging again.

Case Questions

  1. Why have mobile wallets, rather than cards, become the main digital payment method in Nepal?
  2. Explain idempotent transactions in simple terms. Why are they essential on unreliable mobile networks?
  3. Which security layers described in the case protect authenticity, and which protect confidentiality?
  4. How do APIs and QR standards help wallets build an ecosystem of merchants and banks?
  5. What trade-offs exist between strong security (OTP, device binding) and a fast, simple payment experience?

Chapters covered

Use the unit notes below to review the theory this case applies in practice.