Back to Blog
technicalpayments
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.
CloudMyle Team
7/30/2025
1 min readđź“‹ Table of Contents
Reading time: 1 minutes
đź’ˇ 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.
🎯 Key Takeaways
- Expert insights on technical development
- Practical implementation strategies
- Best practices from industry professionals
- Actionable steps for your next project
📚 Continue Reading
Related Article 1
Discover more insights on technical development...
Related Article 2
Discover more insights on technical development...
Related Article 3
Discover more insights on technical development...
🏷️ Topics Covered
upiphonepespring-bootreact-nativepaymentsqr
📊 Article Stats
Word Count198
Reading LevelIntermediate
Categorytechnical
