Subscription-based businesses in India have historically relied on card-based recurring payments, which suffer from high failure rates due to card expiry, insufficient funds, and the RBI's recurring payment authentication mandate. UPI Autopay changes the game by allowing merchants to set up mandates directly on a user's UPI ID, with automatic debits on a predefined schedule. The failure rate on UPI Autopay is significantly lower than card-based recurring — our data across five subscription clients shows a 94% success rate versus 78% for cards.
Setting up UPI Autopay through Razorpay involves creating a subscription with a mandate. The flow begins with a one-time authentication where the user approves the mandate on their UPI app, authorising recurring debits up to a specified maximum amount. Once approved, subsequent charges happen automatically without user intervention. The critical detail that many developers miss is that UPI mandates have a 24-hour pre-debit notification requirement — you must notify the user at least 24 hours before each debit, and the notification must include the amount, date, and a link to cancel.
Edge cases are where implementations break. Mandate revocation can happen at any time from the user's UPI app, and the notification of revocation may be delayed by hours. Bank maintenance windows cause temporary failures that should be retried, not treated as permanent. Amount changes require creating a new mandate — you cannot modify the maximum amount on an existing one. We handle all of these with a state machine that tracks mandate lifecycle (created, authenticated, active, paused, revoked, expired) and a retry engine that distinguishes between soft failures (temporary bank issues) and hard failures (mandate revoked, account closed).
The billing system architecture wraps around this with a scheduled job that runs daily, identifies subscriptions due for charge, verifies mandate status, triggers the debit via the Razorpay API, and handles the asynchronous result. Failed charges enter a dunning flow — a series of retry attempts over 7 days with increasing urgency in the WhatsApp notifications sent to the user. If all retries fail, the subscription is paused (not cancelled), preserving the user's data and making reactivation frictionless. This approach has reduced involuntary churn by 40% across our subscription clients.