DEV Community

Cover image for System Design: How Does a UPI Payment Reach the Chai Wala in Just Seconds?
Khushi Patel
Khushi Patel

Posted on

System Design: How Does a UPI Payment Reach the Chai Wala in Just Seconds?

Imagine this.

You buy a ₹20 chai from your local chai wala.

You open Paytm, scan his QR code, and make the payment.

But here's the interesting part:

  • Your Paytm is linked to HDFC Bank
  • The chai wala's Paytm is linked to SBI
  • The money moves between two completely different banks

And yet...

Within 2-3 seconds both of you receive a notification.

How does this happen so fast?

Let's follow the journey of that ₹20.


Step 1: You Scan the QR Code

The QR code doesn't contain money.

It usually contains information like:

UPI ID: chaiwala@sbi
Merchant Details
Enter fullscreen mode Exit fullscreen mode

When you enter ₹20 and click Pay, Paytm creates a payment request.


Step 2: Paytm Doesn't Transfer Money

Many people think Paytm sends the money.

It doesn't.

Paytm is simply acting as an interface.

The actual money movement happens between banks through UPI.

So the flow looks like:

You
 ↓
Paytm
 ↓
UPI Network
 ↓
Banks
Enter fullscreen mode Exit fullscreen mode

Step 3: Request Goes To NPCI

The payment request is sent to the UPI infrastructure operated by the National Payments Corporation of India.

Think of NPCI as the traffic controller of India's UPI system.

It knows:

  • Which bank owns your account
  • Which bank owns the chai wala's account
  • Where the request should be routed

Step 4: Your Bank Verifies Everything

NPCI forwards the request to your bank.

Your bank checks:

  • Is the account active?
  • Is there enough balance?
  • Is the UPI PIN correct?
  • Is the transaction suspicious?

If everything is valid, the bank approves the debit.

Account Balance = ₹1000
Payment = ₹20

Approved ✅
Enter fullscreen mode Exit fullscreen mode

Step 5: Chai Wala's Bank Gets The Credit Request

Now NPCI forwards the request to the chai wala's bank.

His bank verifies the account and credits ₹20.

Chai Wala Balance
₹500
   ↓
₹520
Enter fullscreen mode Exit fullscreen mode

Step 6: Success Message Everywhere

Once both banks confirm:

  • NPCI marks transaction successful
  • Paytm receives success response
  • Chai wala's Paytm receives success response

Within seconds:

You: Payment Successful ✅

Chai Wala: ₹20 Received ✅
Enter fullscreen mode Exit fullscreen mode

But Wait... Did The Money Actually Move?

This is where things get interesting.

Millions of UPI transactions happen every minute.

Banks don't physically transfer money one-by-one for every chai, samosa, or grocery purchase.

Instead, they maintain settlement records.

Throughout the day:

HDFC owes SBI
SBI owes ICICI
ICICI owes Axis
Enter fullscreen mode Exit fullscreen mode

NPCI keeps track of these obligations.

Later, settlement happens through the banking system in bulk.

This is much faster than moving actual money for every transaction individually.


Why Is It So Fast?

Several engineering decisions make this possible:

Parallel Processing

Banks verify requests simultaneously.

High-Speed Network

NPCI operates highly optimized payment infrastructure.

Lightweight Messages

Only transaction information is exchanged, not huge amounts of data.

Deferred Settlement

Banks settle balances later rather than moving money instantly every time.


Simplified Architecture

You
 │
 ▼
Paytm App
 │
 ▼
NPCI UPI Switch
 │
 ├─────────────► Your Bank
 │                    │
 │                    ▼
 │              Debit Money
 │
 ▼
Chai Wala Bank
 │
 ▼
Credit Money
 │
 ▼
Success Response
Enter fullscreen mode Exit fullscreen mode

All of this happens in just a few seconds.


Key Takeaway

When you pay ₹20 to a chai wala:

  • Paytm is only the interface.
  • NPCI acts as the traffic controller.
  • Your bank debits the amount.
  • The merchant's bank credits the amount.
  • Settlement between banks happens later.
  • Optimized infrastructure allows the entire process to complete in seconds.

The next time you hear that familiar "Payment Received" sound from the chai wala's phone, remember:

Behind that simple beep, multiple systems, banks, servers, and networks coordinated in real time to move money across the country.

Top comments (0)