UPI with PhonePe for Multi-Business Apps: Spring Boot + React Native
Route payments to the right merchant account per business, with secure callbacks and reconciliation.
đź“‹ Table of Contents
đź’ˇ What You'll Learn
Route payments to the right merchant account per business, with secure callbacks and reconciliation.
If your app serves multiple businesses, UPI needs careful routing. Here’s how we wired PhonePe so each business gets paid to its own merchant account.
Data Model
- Business: PhonePe merchant keys, UPI ID, callback URLs, settlement preferences.
- Payment: status machine (
created → pending → success/failed → reconciled), amount, currency, external reference IDs. - Audit: request/response logs (masked), signatures, retries.
Flow
- Client requests payment intent with business ID and amount.
- Backend signs the request with the business’s merchant key; creates a
Paymentrecord. - Client shows QR/Intent; user pays via any UPI app.
- PhonePe calls your callback → verify signature → update status.
- Nightly reconciliation: cross-check settlements and mark
reconciled.
Security & Reliability
- HMAC signatures on every message; validate timestamps/nonces.
- Idempotent callbacks (dedupe by transaction reference).
- Retries with back-off for transient failures.
- Mask PII; store only what you must (no sensitive PAN-like data).
Client UX
- Show a countdown on the UPI screen with “I’ve paid” and “Try again” actions.
- Deep-link to installed UPI apps; fallback to static QR.
- Clear success/failure screens; auto-dismiss on success callback.
With the right abstractions, you can support thousands of payments across many businesses without mixing funds.
Adding UPI or payment-gateway flows to an app or online store? Explore CloudMyle's ecommerce development services in Hyderabad.
📚 Continue Reading
How Long Does It Take to Develop a Mobile App? (2026 Guide)
Most apps take 8–24 weeks to build. See 2026 mobile app development timelines by type, the 5 build stages, and how to la…
Core Web Vitals for Next.js in 2026: The Complete Technical Guide & Policies
Master Google's 2026 Core Web Vitals policies for Next.js. Complete technical blueprint to optimize LCP, INP, and CLS wi…
How Much Does Mobile App Development Cost in India in 2026?
How much does app development cost in India in 2026? From a ₹2L MVP to a ₹25L+ enterprise app — by platform, complexity,…
