Recurring Payments via UPI Autopay
UPI Autopay allows Indian customers to authorize recurring payments directly from their UPI-linked bank account. Recurso integrates with Razorpay to manage the full mandate lifecycle:- Create mandates against a customer’s VPA (Virtual Payment Address)
- Authorize via the customer’s UPI app (Google Pay, PhonePe, BHIM, etc.)
- Auto-debit on schedule with mandatory pre-debit notifications
- Revoke mandates when no longer needed
UPI Autopay mandates are governed by NPCI (National Payments Corporation of India) guidelines. Recurso handles pre-debit notifications and frequency rules automatically so you stay compliant.
Mandate Object
Mandate Lifecycle
Create a Mandate
Create a UPI autopay mandate for a customer. Optionally link it to a subscription for automatic recurring billing.Create Parameters
Authorization Flow
After mandate creation, the customer must authorize it through their UPI app. Recurso orchestrates this via Razorpay.1
Mandate creation
Your application calls
POST /v1/mandates. Recurso creates the mandate in created status and registers it with Razorpay.2
UPI collect request
Razorpay sends a collect request to the customer’s UPI VPA. The customer receives a notification in their UPI app.
3
Customer authorization
The customer opens their UPI app, reviews the mandate details (amount, frequency, merchant), and approves it with their UPI PIN.
4
Mandate activated
Once authorized, the mandate transitions through
authorized to active. The razorpay_token_id is populated, and Recurso can now execute debits.Get a Mandate
List Mandates
Retrieve all mandates for your tenant.Pre-Debit Notifications
NPCI mandates that customers must be notified at least 24 hours before any auto-debit. Recurso handles this automatically.If the pre-debit notification fails (e.g., UPI service downtime), the debit will not be attempted. Recurso will retry the notification and reschedule the debit accordingly.
Revoke a Mandate
Permanently cancel a mandate. No further debits will be executed.Linking Mandates to Subscriptions
When asubscription_id is provided during mandate creation, Recurso automatically uses the mandate to collect recurring payments for that subscription.
How Linked Billing Works
- When the subscription’s billing cycle triggers a new invoice, Recurso checks for an active mandate.
- A pre-debit notification is sent to the customer 24 hours before the scheduled debit.
- On the debit date, the invoice amount is collected from the customer’s bank account via UPI.
- The invoice is marked as
paidand the mandate’slast_debit_atandnext_debit_atare updated.
Frequency Options
Webhooks
Example Webhook Payload
Best Practices
Set max_amount with headroom
Set max_amount with headroom
Set
max_amount higher than the current plan price to accommodate tax variations, plan upgrades, or price changes. A good rule is 1.5x the expected debit amount. If the actual debit exceeds max_amount, the payment will fail and require a new mandate.Monitor debit failures
Monitor debit failures
Subscribe to
mandate.debit.failed events. Common failure reasons include insufficient funds, bank server errors, or customer-initiated blocks. Implement retry logic and notify the customer to ensure their bank account has sufficient balance.Validate VPA before mandate creation
Validate VPA before mandate creation
Verify the customer’s VPA is valid and active before creating a mandate. An invalid VPA will cause the authorization request to fail silently. Use Razorpay’s VPA validation API for this check.
Keep customers informed throughout the lifecycle
Keep customers informed throughout the lifecycle
Send notifications at each stage: when the mandate is created (with approval instructions), when it is authorized, before each debit (in addition to the NPCI-mandated notification), and if a debit fails. Clear communication reduces mandate revocations and support tickets.
Plan for mandate revocations
Plan for mandate revocations
Customers can revoke mandates at any time from their UPI app, bypassing your API. Listen for the
mandate.revoked webhook and promptly handle the subscription impact — notify the customer and offer alternative payment methods.Next steps
Consent tracking
The records behind every mandate
Set up UPI mandates
Configuration walkthrough