FOUNDING PRICING · 40% OFFfor the first 1,000 members · from ₹95/month
ArchitectureNPCI11 min read

How UPI Processes a Payment: Debit, Credit and Timeouts

How a UPI payment moves from your app through the NPCI switch to two banks, how a VPA is resolved, and what happens when the credit leg times out.

ShareXLinkedInWhatsApp
A small roadside sweet shop in North 24 Parganas, West Bengal, with printed UPI QR code placards hanging along its awning and the shopkeeper sitting behind trays of sweets and bread.
A small roadside sweet shop in North 24 Parganas, West Bengal, with printed UPI QR code placards hanging along its awning and the shopkeeper sitting behind trays of sweets and bread. Photo: Yooktashree barai, CC BY-SA 4.0, via Wikimedia Commons.

A UPI payment looks like one action: scan, enter a PIN, done. Underneath, it is a debit at one bank and a credit at another, coordinated in a few seconds by a central switch run by the National Payments Corporation of India (NPCI), with up to four other organisations taking part. The interesting engineering is not the happy path. It is what the system does when one of those parties does not answer in time, because money has already left an account.

Diagram of a UPI push payment: the payer's app sends a pay request to the NPCI switch, the payee's PSP resolves the VPA, the remitter bank debits the payer, the beneficiary bank credits the payee, and a failed credit leg ends in either a debit reversal or a deemed-approved transaction.

The problem and the scale

Before UPI, sending money between Indian bank accounts from a phone meant knowing an account number and IFSC, or a mobile number and MMID on IMPS, and using your own bank's app. UPI's idea was to separate the app from the bank. Any approved app can drive a debit from any participating bank, and the payee is identified by a short address instead of account details.

NPCI's product page says the pilot was launched on 11 April 2016 with 21 member banks, and that bank apps began appearing on the Play Store from 25 August 2016. The scale today is very different. NPCI's figures for October 2026, as reported by the Free Press Journal, were 25.47 billion transactions worth ₹31.53 lakh crore, about 822 million a day. Dividing that daily figure by 86,400 gives roughly 9,500 transactions a second as an average. That is our arithmetic, not a published peak figure.

A customer at a shop counter holds a phone over a tablet that shows a QR code under the words Scan and Pay.
Scanning a QR code to pay at a counter. Illustrative only: the amount on the screen is in euros, so this is not a UPI payment. Photo: European Commission, CC BY 4.0, via Wikimedia Commons.

A caution on sources before the detail. What follows comes from NPCI's Procedural Guidelines, its operating circulars and RBI directions. The edition of the guidelines we could read is the original 2015 one, and NPCI amends the rules by circular, so current timer values and message details may differ. How NPCI builds the switch itself, its databases, languages and hardware, is not something it has published in these documents, and we do not guess at it here.

Who takes part, and how a VPA is resolved

The guidelines define four roles around the NPCI switch.

RoleWhat it does
Payer PSPThe payment service provider whose app captures the payer's PIN
Remitter bankThe payer's bank, which processes the debit
Payee PSPThe provider that maps the payee's virtual address to an account
Beneficiary bankThe payee's bank, which processes the credit
NPCI (UPI switch)Routes every message, and acts as the settlement agency

One organisation can play two roles. If you use your own bank's UPI app, the payer PSP and the remitter bank are the same entity. The guidelines call the fully separated case the four party model.

PSPs are banks. Consumer apps run by non-banks join as third party application providers, which NPCI's roles page says participate through a sponsoring PSP bank. That bank is responsible for onboarding users and for the security of the app's systems.

A virtual payment address (VPA) has the form username@psp. The part after the @ is a handle that NPCI allocates to a PSP when it is onboarded. The part before it is unique within that PSP.

This gives a two-level lookup, much like an email address or a domain name. The switch does not need a central table of every VPA in the country. It reads the handle, works out which PSP owns it, and asks that PSP. The guidelines say the PSP holds the mapping from a virtual address to the underlying account details in its own local mapper and is responsible for resolving it. So-called global addresses, such as an account number with IFSC, are resolved by NPCI directly.

The payer never needs to see the payee's account number.

Diagram of VPA resolution: the address username@psp splits into a username that is unique within one PSP and a handle that NPCI allocates to that PSP; the switch reads the handle, asks the payee PSP, and gets back account details from its local mapper, while a global address made of an account number with IFSC is resolved by NPCI directly.
How a virtual payment address is resolved in two levels

A push payment, step by step

The guidelines list the steps for a four party push payment, where the payer starts the transfer. In our words:

  1. The payer enters the payee's VPA, the amount and their UPI PIN in the payer PSP's app.
  2. The payer PSP sends a pay request (ReqPay in the guidelines) to the UPI switch.
  3. The switch sends an address resolution request to the payee PSP.
  4. The payee PSP returns the payee's account details.
  5. The switch sends a debit request to the remitter bank.
  6. The remitter bank checks the PIN, debits the payer and confirms.
  7. The switch sends a credit request to the beneficiary bank.
  8. The beneficiary bank credits the payee and confirms.
  9. The switch reports success, and the apps notify both customers.

A collect request, where the payee asks for money, runs the same debit and credit legs. The difference is at the start: the request goes to the payer's PSP first, and the payer approves it with a PIN.

Two details are worth noting. First, the order is always debit, then credit. Money is never created at the beneficiary bank before it has been taken from the payer. Second, the PIN is protected from the app that collects it. The guidelines describe an NPCI-supplied library inside the PSP app that encrypts the PIN with NPCI's public key. NPCI decrypts it, re-encrypts it with the issuing bank's public key and passes it on, and the bank must decrypt it inside a hardware security module. Only the bank that issued the PIN validates it.

Diagram of the path of the UPI PIN: the NPCI-supplied library in the payer PSP app encrypts the PIN with NPCI's public key, NPCI decrypts it and re-encrypts it with the issuing bank's public key, and the bank decrypts it inside a hardware security module.
The PIN is encrypted twice on its way to the issuing bank

When a leg times out

The debit leg failing is the easy case, because nothing has moved. The hard case is step 7: the payer has been debited, the credit request has gone out, and the beneficiary bank says nothing. The switch cannot tell a lost request from a lost reply. The payee may or may not have the money.

NPCI's circular of 27 January 2017 sets out the procedure that took effect on 1 February 2017.

  1. The switch sends a Check Transaction message asking for the status of the original credit, up to three times. Any answer settles it: approved or declined.
  2. If all three go unanswered, the switch sends the beneficiary bank a credit reversal request.
  3. If the bank confirms the reversal, the transaction is treated as declined and the remitter bank is told to reverse the debit.
  4. If the bank does not answer the reversal either, or replies that the reversal was declined, the transaction is marked deemed approved, with response code RB. It is included in settlement, and no debit reversal is sent.

Step 4 looks odd at first. Why treat silence as success? Because the alternative is worse. Before February 2017, the same circular explains, silence was treated as a decline and the payer's debit was reversed. The circular does not spell out its reasoning, but the risk is easy to see: if the beneficiary bank had in fact credited the payee, the payee kept money that the payer had also got back. Deemed approval picks the opposite default: keep the debit, move the funds to the beneficiary bank at settlement, and make that bank responsible for finishing the job.

The clean-up is done in reconciliation. The beneficiary bank must check each deemed approved transaction and either confirm the credit, credit the customer manually, or return the funds to the remitter bank if the account cannot be credited. Remitter banks are told not to reverse the customer's debit on an RB code. The app is expected to show the customer a deemed approved status.

Later circulars tightened the edges. In March 2017 NPCI added response code ND, used by a remitter bank to decline a reversal when it never debited the account in the first place, so that case is clearly identified and there is nothing to give back. The same circular added certification tests for failed debit reversals, with a store and forward facility at the bank for when its core banking system is down, and told banks to reconcile daily across three records: NPCI's file, the bank's own switch and its core banking system. In February 2018 NPCI added code CS, which lets a beneficiary bank answer a reversal request with "the credit already succeeded", turning the transaction into an approval instead of a needless decline.

Deadlines, compensation and settlement

A timeout that resolves by reconciliation can leave a customer waiting. The Reserve Bank of India set outer limits in a direction dated 20 September 2019, effective 15 October 2019. For a UPI transfer where the account is debited but the beneficiary is not credited, the beneficiary bank must auto-reverse by T+1, meaning the day after the transaction. For a merchant payment where the confirmation never reached the merchant, the limit is T+5. Beyond those limits the customer is owed ₹100 a day, credited without having to file a claim.

Online timers have also shortened. Business Today reported that an NPCI circular of 26 April 2025 cut the response time for the pay request and response from 30 seconds to 15, and for status checks and reversals from 30 seconds to 10, from 16 June 2025. We could not open the circular itself, so treat those numbers as reported.

The customer sees money move instantly, but banks do not pay each other per transaction. The guidelines describe NPCI as the settlement agency: it computes each member's net position at the end of a settlement cycle and arranges the debits and credits to the banks' settlement accounts at the RBI. Each bank is also given a limit, called the NDC limit in the guidelines, which is refreshed after each cycle. The guidelines leave the number and timing of cycles to NPCI to prescribe.

The trade-offs UPI accepts

  • A central switch. Every transaction between two different banks passes through NPCI. That makes routing, rules and dispute handling uniform, and it concentrates risk in one place.
  • No shared lock across banks. The debit commits at one bank before the credit is attempted at another. There is a window where the money is in neither customer's usable balance.
  • Availability depends on the slowest bank. The 2018 circular tells banks to resize their capacity as volumes grow and to keep the number of hops between their UPI switch and core banking system small, because slow replies turn into declines and deemed approvals.
  • Reconciliation is part of the design. Online messages are best effort within a time limit. The settlement files and daily reconciliation catch what the online path missed.

The computer science underneath

A saga, not two-phase commit. Two banks each run their own database, and each debit or credit is a local ACID transaction. See ACID and isolation levels for what that guarantees inside one database. Nothing spans both. Two-phase commit would have both banks hold locks until a coordinator says commit, which is fragile across dozens of independent organisations. UPI instead runs a sequence of local transactions with a compensating action for failure: the debit reversal. That is the saga pattern, covered in distributed transactions: two-phase commit and sagas. The price is that atomicity is eventual, not instant.

Timeouts are ambiguous. A missing reply tells you nothing about whether the work happened. The switch's first reaction, asking for status instead of sending the credit again, is the right one, and retries, timeouts and circuit breakers explains why blind retries are dangerous.

Idempotency. Check Transaction, the reversal request and the ND and CS codes all exist so that a repeated or late message cannot move money twice. Each refers back to one original transaction and asks the bank to report or undo that exact operation, not to perform a new one. Idempotency and delivery guarantees covers the general technique, and design a payment system applies it to ledgers.

What an interviewer could ask from this

Why does UPI debit before it credits? If the credit came first and the debit failed, the system would have created money. Debit-first means the worst failure is a customer waiting for a refund, which is recoverable.

The credit request times out. Should the switch retry it? Not blindly. The first request may have succeeded. Query the status of the original transaction, and only then decide between completing and reversing.

Why not use two-phase commit between the banks? It needs every participant to hold locks while waiting for the coordinator, and one slow bank would block others. A saga with compensation keeps each bank independent.

What does deemed approved mean? The beneficiary bank answered none of the status checks and did not confirm the reversal request. The switch settles the transaction as if it succeeded and the beneficiary bank must confirm, credit manually or return the funds during reconciliation.

Why keep daily reconciliation if every message is acknowledged online? Acknowledgements can be lost and systems can be down. Comparing independent records after the fact is the only way to catch what the online path missed.

Takeaways

  • A UPI payment is two local transactions at two banks, sequenced by a switch, with a reversal as the undo.
  • The hard case is a debit that succeeded followed by a credit whose outcome is unknown.
  • UPI resolves that by asking for status, then asking for a reversal, and finally defaulting to deemed approved with clean-up in reconciliation.
  • Routing by handle keeps address lookup decentralised.
  • Published rules explain the protocol. The internals of the switch are not public.

Sources

  1. Unified Payments Interface Procedural Guidelines (NPCI, 2015 edition, copy hosted by YASHADA)
  2. NPCI circular UPI and IMPS OC No. 79, 27 January 2017: Implementation of Deemed Approved process in UPI (archived copy)
  3. NPCI circular UPI OC No. 17, 9 March 2017: Debit reversals and handling deemed approved transactions (archived copy)
  4. NPCI circular UPI OC No. 45, 12 February 2018: Best practices to reduce deemed approved transactions (archived copy)
  5. UPI Roles and Responsibilities (NPCI, archived copy)
  6. UPI Product Overview (NPCI, archived copy)
  7. Harmonisation of Turn Around Time (TAT) and customer compensation for failed transactions (RBI, 20 September 2019)
  8. UPI transactions hit 25.47 billion in October (Free Press Journal, 2 November 2026)
  9. NPCI slashes UPI API response time (Business Today, 17 June 2025)

Written by the Codevizag Academy team

An independent explainer built from the public sources listed above. Codevizag Academy is not affiliated with NPCI. Found a mistake? Write to support@codevizag.com.

More case studies

Understood it? Now prove it.

The lessons behind this case study are free, and 20 problems a month are judged on real test cases at no cost.

Start solving free