How a UPI Payment Works, Step by Step

Moves money between two banks in seconds: the payment apps talk to a central switch, which debits one bank and credits the other.

Loading the interactive diagram…

How a UPI Payment Works, Step by Step

Moves money between two banks in seconds: the payment apps talk to a central switch, which debits one bank and credits the other.

People

Payer's UPI app
Client · Assumption. Someone paying ₹250 to a shop by scanning its QR code.
Shop's phone
Client · Assumption. The shopkeeper, waiting for the "₹250 received" message.

Payment apps' banks (PSPs)

Payer's PSP
Service · Assumption. The bank partnered with the payer's app, which connects it to UPI.
Payee's PSP
Service · Assumption. The bank behind the shop's UPI ID. It knows which account the ID points to.
UPI ID directory
Database · Assumption. Maps each UPI ID to a name and a bank account.

Central switch

UPI switch (NPCI)
Gateway · Assumption. The central switch every UPI payment passes through, run by the National Payments Corporation of India.

Where the money is

Payer's bank
External · Assumption. Holds the payer's account. Checks the PIN and takes the money out.
Shop's bank
External · Assumption. Holds the shop's account. Puts the money in.

Flow: Check who you're paying

Before the PIN screen, the app shows the name behind the UPI ID, so you can stop if it's wrong.

  1. Payer's UPI app → Payer's PSP (Who is ravi.shop@okbank?). The payer scans the shop's QR code, which holds its UPI ID. The app asks its PSP who that is.
  2. Payer's PSP → UPI switch (NPCI) (Validate ravi.shop@okbank). The PSP passes the question to the UPI switch.
  3. UPI switch (NPCI) → Payee's PSP (Validate ravi.shop@okbank). The switch sees the @okbank handle and sends the question to the bank behind it.
  4. Payee's PSP → UPI ID directory (Look up ravi.shop). The payee's PSP looks the ID up in its directory.
  5. UPI ID directory → Payee's PSP (Ravi's Store, active). It exists, and belongs to Ravi's Store.
  6. Payee's PSP → UPI switch (NPCI) (Valid: Ravi's Store). Only the name goes back, never the account number.
  7. UPI switch (NPCI) → Payer's PSP (Valid: Ravi's Store). The switch returns the answer.
  8. Payer's PSP → Payer's UPI app (Pay Ravi's Store?). The app shows the name. If it says someone else, this is the moment to stop.

Flow: Pay ₹250

The switch finds the shop's account, the payer's bank checks the PIN and takes the money, then the shop's bank puts it in. The payer gets the answer; the shop's "received" message is a one-way notice.

  1. Payer's UPI app → Payer's PSP (Pay ₹250 (encrypted PIN)). The payer enters the UPI PIN on the secure screen. It's encrypted on the phone; the app can't read it.
  2. Payer's PSP → UPI switch (NPCI) (Pay ₹250, txn 4321). The PSP gives the payment a unique transaction id and sends it to the switch.
  3. UPI switch (NPCI) → Payee's PSP (Account for ravi.shop?). The payer's side only knows the UPI ID. Before moving money, the switch asks the shop's PSP which account it points to.
  4. Payee's PSP → UPI ID directory (Look up ravi.shop). The PSP looks the ID up.
  5. UPI ID directory → Payee's PSP (Account at OK Bank). It finds the shop's bank and account.
  6. Payee's PSP → UPI switch (NPCI) (Credit to acct …4410). The account details go to the switch only, never to the payer's app.
  7. UPI switch (NPCI) → Payer's bank (Debit ₹250 + PIN). Now the switch asks the payer's bank to take ₹250 from the account. Only this bank can check the PIN.
  8. Payer's bank → UPI switch (NPCI) (Debited). PIN correct and enough money: the bank debits the account.
  9. UPI switch (NPCI) → Shop's bank (Credit ₹250). Only after the debit succeeds does the switch ask the shop's bank to credit the shop.
  10. Shop's bank → UPI switch (NPCI) (Credited). The money is in the shop's account.
  11. UPI switch (NPCI) → Payer's PSP (Success, ref 6012…). The switch tells the payer's PSP it worked, with a reference number both sides can quote.
  12. Payer's PSP → Payer's UPI app (Paid ✓). The payer sees the green tick.
  13. UPI switch (NPCI) → Payee's PSP (₹250 received). The switch also tells the shop's PSP.
  14. Payee's PSP → Shop's phone (₹250 from Asha). The shop's app (or speaker box) announces the payment.

Flow: Debited, but the credit times out

The money left the payer's account, but the shop's bank didn't answer. The payment is pending, never lost: it's either credited or returned automatically.

  1. Payer's UPI app → Payer's PSP (Pay ₹250 (encrypted PIN)). A payment starts as usual.
  2. Payer's PSP → UPI switch (NPCI) (Pay ₹250, txn 4400). The PSP sends it to the switch.
  3. UPI switch (NPCI) → Payee's PSP (Account for ravi.shop?). As in a normal payment, the switch first finds out which account the UPI ID points to.
  4. Payee's PSP → UPI switch (NPCI) (Credit to acct …4410). The shop's PSP answers.
  5. UPI switch (NPCI) → Payer's bank (Debit ₹250 + PIN). The payer's bank is asked to debit.
  6. Payer's bank → UPI switch (NPCI) (Debited). The money has left the payer's account.
  7. UPI switch (NPCI) → Shop's bank (Credit ₹250). The switch asks the shop's bank to credit.
  8. Shop's bank → UPI switch (NPCI) ((no answer)). The shop's bank is slow or down. Nobody knows yet whether the credit happened.
  9. UPI switch (NPCI) → Payer's PSP (Pending, txn 4400). The switch reports the payment as pending, not failed: saying "failed" would invite the payer to pay again.
  10. Payer's PSP → Payer's UPI app (Pending: don't pay again). The app shows a pending status. Behind the scenes, the switch keeps checking the shop's bank; if the credit never lands, the debit is reversed automatically, usually the same or next working day. This is why people are told not to pay twice when a UPI payment is pending.

HowItScales is not affiliated with the companies shown. Components marked Assumption or Hypothetical are not confirmed by the company.