developer
UPI Checkout Inside an In-App Browser: Recovery Guide
Handle UPI checkout inside social and messaging app browsers with clear system-browser recovery, stable order identity, safe return states, and backend verification.
Customers often reach checkout from messaging, social, email, or marketplace apps that open links inside an embedded browser. These containers can display the page correctly but handle external UPI app links, new windows, cookies, and return navigation differently from the system browser.
The checkout should detect difficulty and offer recovery without losing the order or asking the customer to pay twice.
Understand the Constrained Context
Treat the embedded browser as a capability question, not a permanent user label. User-agent detection can be incomplete and should not be the only decision. Prefer feature behavior plus a visible fallback.
Possible symptoms include:
- Tapping “Pay with UPI” does nothing.
- The container asks for confirmation but never opens the payer app.
- The payer app opens, but returning creates a blank or restarted page.
- Session cookies are not shared with the system browser.
- A new tab or external-navigation action is blocked.
- The page is reloaded and creates another checkout attempt.
Log only safe context such as device category, selected payment surface, launch result, and application version. Do not collect unrelated app or customer identifiers.
Preserve the Order Across Navigation
Create the payment attempt before presenting the app-launch action. The backend stores the order identity, expected amount, and current state. Generate a short-lived resume reference that lets the system browser load a customer-safe status page for that same order.
The resume reference should be unguessable, scoped to one order, expire after a bounded period, and reveal no API key or provider credential. It should grant only the minimum ability to view or continue that checkout—not merchant dashboard access.
If the page reloads, it must query the existing order before creating anything new.
Offer System-Browser Recovery
When launch appears unavailable, show:
- A plain explanation: “This browser may not open UPI apps.”
- An “Open in your browser” action where the platform permits it.
- A copyable, customer-safe resume link as a fallback.
- Cross-device QR instructions where suitable.
- The same visible order reference and amount.
Do not blame a specific app unless you have verified the exact condition. Do not tell the customer to disable security settings or share credentials. The mobile Intent fallback guide covers the app-selection sequence.
Return to a Server-Owned State
The resumed page reads status from your backend. A browser cookie, URL parameter, page focus event, or customer message is not payment evidence. Keep the order pending until a signed event or authenticated status check confirms the stored reference and amount.
If the customer already paid before switching browsers, the resumed page should discover that final state and avoid showing another payment action. If verification remains unknown, provide a support reference and explain that the customer should not pay again yet.
Test Common Failure Paths
Test links opened from every major acquisition channel you actually use. For each, cover app installed, no compatible app, customer cancellation, slow return, browser switch, cleared session, and network loss.
Verify that:
- Browser switching does not create a second
client_txn_id. - The resume link cannot access another order.
- Expired links produce a safe recovery page.
- Authenticated payment can resolve after either page closes.
- Analytics reports recovery without storing the resume token.
- Customer support can locate the case using the visible order reference.
Measure verified conversion and unresolved-pending rate for in-app and system-browser paths. A higher system-browser handoff rate is not itself success; the goal is verified payment with one order and a clear customer journey.
Prepare customer-support copy for the three common states:
- “Open this order in your regular browser to continue. Your amount and order reference will stay the same.”
- “We are checking the payment linked to this order. Please do not pay again.”
- “This resume link expired. Contact support with order reference ORD-82K4; do not share a PIN or OTP.”
These messages should be generated from current backend state, not hard-coded assumptions. Test that copied links open the correct merchant-branded page and that social link previews do not reveal amount, customer, token, or payment status.
Direct answers
Frequently asked questions
- Why can UPI Intent behave differently inside an in-app browser?
- Embedded browsers can restrict external app navigation, link handling, cookies, or returning to the original page. Design a system-browser fallback instead of assuming every container behaves alike.
- How can checkout continue after opening the system browser?
- Use a short-lived, non-secret resume link that resolves the existing backend order. Never place API keys, webhook secrets, or privileged data in the URL.
- Should the website claim a payment failed when the payer app did not open?
- No. App navigation failure and payment failure are different. Show a launch-recovery state unless authenticated evidence resolves the payment itself.
Build your payment flow
Explore the API and browser-only merchant tools.
Create UPI checkout orders, verify signed events, or test the free calculators and generators without exposing credentials.