Blog/UPI and payment gateway integration for your app
5 November 2026·1 view·
Web DevelopmentMobile ApplicationsGuides

UPI and payment gateway integration for your app

How UPI, cards and wallets reach your app through a gateway like Razorpay, Cashfree or PayU, what integration involves, and the mistakes that lose payments.

To accept UPI, cards, net banking and wallets in an Indian app or website, you integrate a payment gateway such as Razorpay, Cashfree, PayU or PhonePe, which handles the connection to banks and UPI apps. A basic checkout integration takes days. A production-grade one, with webhooks, retries, refunds, reconciliation and subscriptions, usually takes two to four weeks of development and testing. Most payment problems in live apps come from the parts around the checkout, not the checkout itself.

UPI now carries the majority of India's digital payments, and customers expect it to work in one or two taps. Here's how to get it right.

How payments reach your app

When a customer pays, several parties are involved: your app, the payment gateway, the customer's bank or UPI app, and your bank, where money settles. The gateway hides most of this complexity behind one integration.

For UPI specifically, the common flows are:

  • UPI intent on mobile: the customer taps pay, picks their UPI app (Google Pay, PhonePe, Paytm and others), approves in that app, and returns to yours. This is the smoothest option on phones.

  • QR codes: useful on desktop, the customer scans with their phone.

  • UPI ID entry: the customer types their UPI ID and approves a request in their UPI app.

Cards, net banking, wallets and EMI options come through the same gateway. RBI rules mean saved cards are stored as tokens by the card networks, and gateways handle that for you.

Choosing a gateway

The main gateways cover similar payment methods. Differences show up in:

  • Fees, especially for cards, international payments and special methods. UPI is usually the cheapest method for merchants.

  • Settlement speed: how quickly money reaches your bank account.

  • Products you'll need later: subscriptions, payment links, split payments for marketplaces, payouts to vendors.

  • Developer experience: documentation, test environments and SDKs for your app's framework.

  • Support quality when something goes wrong, which you only discover under pressure.

Many businesses integrate a second gateway as a backup, so they can switch if the main one has an outage during a busy sale.

What a proper integration includes

A button that opens a checkout is the easy part. Production payments need:

  • Server-side order creation: your server creates each order with the gateway, so the amount can't be changed in the browser.

  • Signature verification: confirming each payment result really came from the gateway.

  • Webhooks: the gateway notifies your server of payment success, failure and refunds. This is the source of truth, because the customer's phone may lose signal before returning to your app.

  • Idempotency: making sure a repeated notification doesn't create a double order.

  • Pending payments: UPI payments sometimes take a while to confirm. Your app needs to show a sensible "waiting" state and resolve it.

  • Refunds, full and partial, from your admin panel.

  • Reconciliation: matching payments, fees and settlements to orders, so finance knows what arrived.

  • GST invoices for each order, generated correctly.

Skipping webhooks and reconciliation is the most common shortcut we see, and it's the one that creates "I paid but my order didn't go through" support tickets.

Testing payments before launch

Gateways give you a test mode with dummy cards and UPI flows. Use it thoroughly, then do a round of small real payments before launch. Check these cases:

  • Successful payments by UPI intent, QR, card and net banking.

  • A payment the customer cancels in their UPI app.

  • A payment that succeeds after the customer closes your app.

  • The same webhook arriving twice.

  • A partial refund and a full refund, including how they appear in reports.

  • Payments on a budget Android phone on mobile data, where UPI app switching is slowest.

Each of these has caught real bugs in real apps. Finding them in testing costs an afternoon. Finding them in production costs customers.

Subscriptions and recurring payments

For subscriptions, memberships and EMIs, Indian rules require the customer to set up a mandate. UPI AutoPay and card mandates both work through gateways. The customer approves once, and future debits happen automatically within the approved limit, with pre-debit notifications sent before each charge as the rules require.

Recurring payments add work: handling failed renewals, retries, upgrades and downgrades, pausing and cancelling. If you're building a SaaS product for Indian customers, see our guide to SaaS pricing models for how billing affects the build.

Common mistakes that lose payments

  • Trusting the app's "payment successful" screen instead of the server webhook.

  • No handling for payments that succeed after the customer closed the app.

  • Testing only on a fast phone on Wi-Fi, never on a budget Android phone on mobile data.

  • Showing too many payment options up front, which slows down the customers who just want UPI.

  • No alerts when payment success rates drop, so a gateway problem runs for hours unnoticed.

  • Hard-coding one gateway so deeply that switching or adding another takes weeks.

Questions about UPI and payment integration

How much does payment gateway integration cost?

A basic checkout is a small job. A production integration with webhooks, refunds, reconciliation and invoices is usually a few weeks of development. Subscriptions, marketplaces with split payments, and multiple gateways add more. Ongoing gateway fees are charged per transaction.

Which payment gateway is best in India?

Razorpay, Cashfree, PayU and PhonePe are all widely used. The best one depends on your fees, settlement needs and the products you'll use later, like subscriptions or payouts. Compare quotes for your expected volume.

Can I accept UPI without a payment gateway?

Small businesses can accept UPI directly with a merchant QR code. Apps and websites that need automatic order confirmation, refunds and reconciliation should use a gateway, since it connects payments to orders.

How long does payment gateway approval take?

Onboarding usually takes a few days once your business documents, website and policies are in order. Gateways check that your site has clear terms, refund and privacy policies and contact details.

Get your payments built properly

If your app loses payments or you're building checkout from scratch, tell us about your setup. Our web and app development team builds payment flows with webhooks, refunds and reconciliation included, for a fixed price.