Understanding Mandates
At the heart of every Recurring Payment is a mandate, a standing permission that a customer gives you to debit their payment method on a schedule. Think of it as a signed agreement stored electronically against the customer’s UPI id, card or bank account. Setting up a mandate always requires the customer to actively authorise it. This is a regulatory requirement, the customer must enter their UPI MPIN, card OTP or Aadhaar OTP before the mandate is registered. No mandate can be created without explicit customer consent. Once the mandate is confirmed, all future debits happen backend, automatically, on your schedule, without the customer doing anything. Unless the debit amount crosses RBI’s AFA threshold, the customer is not involved at all.What is Inside a Mandate
Every mandate has four key parameters that you define at setup time. These are locked once the mandate is registered. You cannot change them later without creating a fresh mandate.Max Amount (token.max_amount)
First Payment (order.amount)
Frequency (token.frequency)
Expiry (token.expire_at)
token_id issued by Razorpay. This is the key you use for all future debit calls. Before attempting any debit, always check the token’s current state: debiting against a paused or cancelled token will fail. Store the token_id securely against the customer record in your system.Setting Up a Mandate
Mandate registration is a four-step process. Steps 1 to 3 happen as part of the customer’s checkout journey. Step 4 is confirmed asynchronously after NPCI or the card network processes the registration.Step 1: Create a Customer
Step 1: Create a Customer
customer_id. Store this against the user in your system. If the customer already exists, pass fail_existing: "0" to retrieve the existing record instead of throwing an error. POST /v1/customersStep 2: Create an Order with mandate details
Step 2: Create an Order with mandate details
max_amount, frequency and expire_at) inside a token object. This is the order the customer will authorise. The amount field is the first payment charge: ₹1 (100 paise) for UPI and Cards, ₹0 for eMandate. POST /v1/ordersStep 4: Mandate is confirmed
Step 4: Mandate is confirmed
token.confirmed webhook. The token_id is now ready for recurring debits. Do not attempt any debits before this event fires. Webhook: token.confirmedPerforming Recurring Debits
Once the mandate is confirmed, all future debits are backend operations. You initiate them from your server with no customer interaction needed. When you trigger a debit, Razorpay first sends a Pre-Debit Notification (PDN) to the customer through the issuing bank. This is an RBI-mandated notification that informs the customer of the upcoming debit, including the merchant name, amount and scheduled date. For UPI, this must be sent at least 24 hours before the actual debit. Razorpay handles this automatically. After the PDN window, the actual debit happens backend. The customer’s account is debited directly with no MPIN or OTP required, unless the amount exceeds the AFA limits set by RBI (see AFA Limits below).Pre-Debit Notification Timeline
Step 1: Create a Debit Order
Step 1: Create a Debit Order
max_amount set at mandate registration. Set payment_capture: true for automatic capture. POST /v1/ordersStep 2: Create the Recurring Payment
Step 2: Create the Recurring Payment
order_id, customer_id and token_id. This is fully server-side. There is no UI and the customer is not redirected anywhere. Razorpay queues the debit, sends the PDN and executes the debit after the notification window. POST /v1/payments/create/recurringStep 3: Payment is confirmed
Step 3: Payment is confirmed
payment.captured webhook when the debit succeeds. For UPI, this typically arrives 24 to 36 hours after you trigger the payment due to the PDN window. For Cards and eMandate, it is typically faster. Avoid creating another debit for the same token until you have received a terminal status (payment.captured or payment.failed) via webhook.Payment and Token States
Every mandate is tracked through two parallel objects: a payment (the individual transaction) and a token (the mandate itself). The combination of payment state and token state tells you exactly what is happening at any point in the lifecycle.paused, cancelled or rejected token will fail. Use GET /v1/customers/:customer_id/tokens/:token_id to fetch the current state at any time.- During Mandate Registration
- During Recurring Debits
AFA Limits
AFA (Additional Factor of Authentication) is an extra layer of approval required for high-value recurring debits. When AFA is triggered, the customer receives a notification from their bank and must enter their UPI MPIN or card OTP before the debit is processed. This is an RBI mandate, not a Razorpay policy, and applies across all Recurring Payment methods. For UPI Autopay, NPCI enforces both the maximum mandate amount you can register and the per-debit silent threshold below which AFA is not required. Two parameters drive the applicable limits:- Your Merchant Category Code (MCC): Assigned to your business by Razorpay during onboarding. The MCC determines both the maximum mandate amount you can register and the AFA-free per-debit threshold.
- The mandate frequency: Variable-amount mandates (
frequency: as_presented) have lower maximum mandate ceilings than fixed-schedule mandates (daily,weekly,monthly,quarterly,yearly).
- Standard Limit (Most MCCs)
- Enhanced Limit (Select MCCs)
Limits by MCC
The table below lists the limits enforced by NPCI per merchant category for UPI Autopay. The twoMax Mandate Amount columns map to your mandate’s frequency value at registration. The AFA-Free Limit is the per-debit amount below which silent debits are processed. If your MCC is not listed, the All other MCCs row applies.
max_amount that exceeds the limit shown above for your MCC and frequency will cause the order creation request to fail.Integration Matrix
Use the table below to navigate directly to the integration guide for your payment method and checkout type.Pre-Launch Checklist
Before flipping the switch to live mode, walk through this checklist. Each item below maps to a configuration or handler that, if missed, results in failed mandates, dropped webhooks or rejected debits in production. Most go-live issues come from missing one of these.Methods enabled on your account
Methods enabled on your account
Order configuration during mandate registration
Order configuration during mandate registration
token object. Confirm auth_type, max_amount, frequency, expire_at, recurring_type and recurring_value are set to match your business model. For UPI Autopay with TPV, include the bank account details in the order. For eMandate and Paper NACH, decide between Register and Charge or Register Only, since this affects how the first debit is processed. For Custom and S2S UPI integrations, pass the TPAP name in the notes object so Razorpay can route correctly and report mandate quality analytics.Checkout configuration
Checkout configuration
recurring: true (or recurring: 1, or recurring: "preferred" for some flows) and the customer_id in the order or payment request. A missing recurring flag silently degrades the payment to a one-time transaction, with no mandate created.Signature verification for successful payments
Signature verification for successful payments
razorpay_signature returned in the success callback against the payment_id and order_id. Never trust the callback payload without verification, since this is the only way to confirm the response is genuinely from Razorpay. After verification, fetch the payment status using the payment_id to double check the final state before granting access or service to the customer. The code sample for signature verification is included in each checkout integration guide.Failure handling and error codes
Failure handling and error codes
error_code and error_reason returned for failed payments. Different error codes call for different actions, retry, notify the customer or stop scheduled debits entirely. Refer to the Error Codes reference for the full list and the recommended action for each. Failing to differentiate between transient bank errors and permanent mandate failures is a common source of unnecessary retries and customer churn.Token management
Token management
token_id against the customer record in your system and treat it as the source of truth for whether you can charge.Auto-capture settings and late auth scenarios
Auto-capture settings and late auth scenarios
late_authorized state, typically due to bank-side delays. Build your reconciliation logic to consume the payment state at capture time rather than at initiation, so late authorisations are not silently dropped from your records.Webhooks and fetch APIs as fallback
Webhooks and fetch APIs as fallback
token.confirmed, token.cancelled, payment.captured and payment.failed. Implement signature verification on every webhook payload using your webhook secret. Webhooks are at-least-once, so deduplicate on payment_id or event_id before acting. Implement the Fetch Payment and Fetch Token APIs as a fallback path, since webhooks can be delayed or missed during outages. Treat the API response as the source of truth when webhooks and your records disagree.Refund handling
Refund handling
payment_capture to manual if you want to avoid auto-refunding. Otherwise, the auth amount is auto-refunded back to the customer after the auto-capture window. For regular debits, integrate the Refunds API so your support team can refund failed-service or disputed transactions without engineering intervention. Test the refund flow end-to-end in test mode before launch.SDK and server library versions
SDK and server library versions