Use a mandate when the customer will be billed repeatedly — a subscription, metered usage, or wallet top-ups. Use the one-time payment link when there is a single payment and nothing recurring.
Prerequisites
- Razorpay connection with invoice sync enabled. Set
sync_config.invoice.outbound: truewhen you connect Razorpay so future invoices sync automatically. - Customer
contact(phone number). A mandate registration is rejected without it ("The contact field is required"). The requirement comes from Razorpay’s authorization step, so setcontactwhen you create the customer if you plan to use autopay. - A plan and price in the currency you will charge. The examples below use
INR.
Register a mandate at checkout
Create a checkout session and includepayment_provider_config. This is what switches the session from a one-time payment link to a mandate registration.
payment_action.url, this time a Razorpay UPI Autopay authorization link:
payment_action.url. They authorize the mandate once in their UPI app.
payment_provider_config fields
Card mandate
A card mandate uses the same request. Changepayment_method to CARD:
What happens after authorization
Once the customer authorizes, Razorpay confirms the mandate (token.confirmed) and captures the first payment (payment.captured). Flexprice marks the checkout session completed, activates the subscription, and finalizes the invoice — the same completion path as a one-time payment link.
From then on, every new invoice for that customer is checked for a usable saved token and charged automatically, with no further customer action. This applies to subscription renewals, and also to one-off invoices and wallet top-up invoices.
An invoice falls back to a normal Razorpay payment link when there is no usable saved token, or when the invoice amount exceeds max_mandate_limit. The fallback is automatic and safe to rely on — the customer receives a link to pay that invoice manually.
max_mandate_limit is a hard ceiling, not a soft warning. An invoice above it
never auto-charges; it always falls back to a payment link. Set the limit high
enough to cover your largest expected invoice.Gotchas
contactis mandatory to register a mandate. Collect it at customer creation — see Prerequisites.max_mandate_limitis a hard ceiling. Invoices above it fall back to a payment link rather than auto-charging. This is an intentional safety cap.- Currency casing. Send
currencyin any casing — Flexprice normalizes it to uppercase before calling Razorpay.
Razorpay Setup
Enable the webhook events, including the mandate events autopay needs.
Checkout Sessions API
Full field reference for the create session call.
Implementation Guide
End-to-end integration with webhook handling.

