Skip to main content
Available in🇮🇳 India
Register mandates, run auto-debits, simulate failures and manage tokens in Test Mode, then work through the pre-launch checklist before you go live. Use Test Mode to check your UPI Autopay integration before you go live. Test Mode simulates the responses from NPCI and the customer’s bank, so you can register mandates, run auto-debits and handle failures without moving real money or using a UPI app. This page describes how to test the request and response payload across each API call, and what error scenarios to expect. UPI Autopay flows: Intent · QR · Collect Start with the overview for test keys and webhook setup.

1. Test Mode Coverage

How live mode and test mode differ

What you can test

Endpoint coverage in test mode

Webhooks: what fires, and what it lets you decide

Every webhook UPI Autopay fires in live mode is listed below, along with whether it also fires in test mode. Test mode webhooks have the same shape as live mode ones and are delivered to the URL set in your Test Mode Dashboard. Which webhooks each scenario fires In Live Mode, subscribe to order.notification.delivered and order.notification.failed to track pre-debit notifications.
Handy tip. A webhook can be delivered more than once. Use the event ID to make sure you process each event only once. This applies in live mode as well.

Token states

Charge a token only while it is confirmed.

2. Before you begin

  • Generate your test mode API keys from the Dashboard. Keys that start with rzp_test_ send all requests to test mode. You do not need to enable any separate flag.
  • Use the same APIs and request formats you use in live mode. Only the API keys change.
  • Pass every amount in paise, as you do in live mode. For example, send 201 for ₹2.01 and 100 for ₹1.
  • Configure a webhook URL in your test mode Dashboard to receive test events. Test mode webhooks are separate from live mode ones and do not carry over.
In test mode the amount you send decides the outcome, because there is no real bank on the other end. Use the trigger amounts below to simulate successful and failed payments.
  • Send 100 (₹1) on both the order and the payment to succeed.
  • Send a reserved amount from 3.3 Autopay error scenarios on both calls to fail. For debits, keep it below the mandate’s max_amount.
  • You don’t need to open the intent link or approve anything in a UPI app.
Coupled or decoupled? Both debit flows are covered below as scenarios — scenario 2 (coupled) and scenario 4 (decoupled). The flows themselves, the notification object and who owns the retries are defined in the published integration doc: Subsequent Payments. This page does not redefine them.

3. Scenarios to Test Your Integration

This section lists every scenario we think is worth running against your UPI Autopay Intent integration before you go live. They are grouped by what each one proves, rather than by how urgent they are, so that you can work down the page in order and know that you have covered the integration end to end. Must-have. We highly recommend running these scenarios first. They cover the successful path and the handful of outcomes you are almost certain to meet once you are live, so getting through them is the shortest route to an integration you can trust. Other common scenarios. These come up in normal day-to-day running and are shared across one-time UPI and UPI Autopay, so the same handling has to work on both. They are not errors as such, but your integration still needs to recognise them and respond correctly, so we recommend covering them before launch. Error scenarios. These are failures you can bring on deliberately, using a reserved trigger, so that you can check your error handling without waiting for a real failure to happen. Most rows use a single trigger, which keeps the error you get back unambiguous. Not available in test mode yet. These scenarios are real and your integration still has to handle them, but they cannot be reproduced in test mode today. We recommend reading through them and checking your handling on live traffic or in a controlled live test before you ship.

3.1 Must-build Autopay scenarios

#ScenarioTrigger credsSteps to follow
1Register a mandateamount: 100Create a customer (POST /v1/customers) and store the returned customer_id. Create an order (POST /v1/orders) with method: "upi", the customer_id and a token object, using the trigger amount. Create the authorisation payment (POST /v1/payments/create/upi, recurring: 1) with the same amount. upi.flow: "intent". Read the intent link (no need to open it in test mode). Webhooks received: payment.authorized, payment.captured, order.paid, token.confirmed. Status changes: the payment moves to captured and the token to confirmed. Store the token ID carried on payment.authorized. On the order and the payment.
2Subsequent debit succeedsamount: 100Register a mandate (#1). Create a debit order without the notification object, which is what places the payment on the coupled flow, and a recurring payment (POST /v1/payments/create/recurring) with the trigger amount. Confirm payment.captured and order.paid. Token stays confirmed.
3Debit fails: insufficient fundsamount: 201Register a mandate (#1). Create a debit order and a recurring payment (POST /v1/payments/create/recurring) with the trigger amount. Confirm payment.failed with insufficient_funds. The token stays confirmed.
On the coupled flow in Test Mode, allow about 25 hours after you create a subsequent payment for the pre-debit notification window. The payment stays created until execution, which can take 25–34 hours depending on the scheduler. Use Fetch a Payment With ID to check the status after the window. Razorpay retries failed debits about an hour apart, for three attempts in total.

3.2 Common scenarios in UPI

#ScenarioTrigger credsSteps to follow
4Debit with your own pre-debit notificationamount: 100Register a mandate (#1). Create the debit order (POST /v1/orders) with the notification object, setting notification.token_id and notification.payment_after. Create the recurring payment (POST /v1/payments/create/recurring) with the same amount, passing order_id, customer_id, token and recurring: true. Confirm payment.captured.
5Fetch tokensA sample token IDTake a sample token ID from a mandate you registered earlier. GET /v1/customers/:customer_id/tokens/:token_id and GET /v1/customers/:customer_id/tokens. Confirm status, max_amount, expire_at, frequency.
6Fetch a payment and reconcile (also on one-time UPI)A payment ID from the registration in scenario 1 and one from any row in 3.3Poll GET /v1/payments/:payment_id for each payment. Confirm the status your reconciler reads matches the status the webhook carried. Confirm a payment still in created is never treated as final.
7Full and partial refund (also on one-time UPI)A captured debit payment from scenario 2Refund in full with POST /v1/payments/:payment_id/refund, and refund another captured debit in part. Webhooks received: refund.processed. Confirm the mandate is untouched. A refund does not cancel the token, and the next debit still runs.
8API validation errors (also on one-time UPI)Missing amount, amount: 0, wrong key secretSend each bad request to the order and the payment endpoints. Read the API error response. If the API rejects the request before creating a payment, no payment webhook fires.
In Test Mode, the UPI payment request can return HTTP 5xx for amount: 0. The recurring payment request can also return HTTP 5xx if you omit method.

3.3 Autopay error scenarios

Registration Follow scenario 1 and use the same trigger amount in paise on the order and the authorisation payment. Use Fetch a Payment With ID (GET /v1/payments/:payment_id) to check the error fields on the failed payment.
After a failed registration in Test Mode, the token stays initiated and Razorpay does not send token.rejected. Listen for payment.failed to detect the failure and let the customer restart registration. If the API rejects the request before creating a payment, read the error in the API response.
The API returns beneficary_bank for 106 and upi_app_ not_available for 107 with the spelling and spacing shown. Amounts 501–504 all return gateway_technical_error at registration. Use these amounts to test generic gateway errors. Auto-debit Allow about 25 hours before checking a scheduled debit on the coupled flow. Follow scenario 2 with a confirmed token, use the same trigger amount on the order and payment and check the result using Fetch a Payment With ID. A debit on a live mandate can run on either of two flows. On the coupled flow you create the order and the payment together and Razorpay raises the pre-debit notification, schedules the debit and runs the retries for you. On the decoupled flow you send the notification object on the order, raise the notification yourself and create the payment separately once the window has passed, and no retries are run on your behalf. For the full description of both, see Subsequent Payments. If you are on the decoupled flow Everything above assumes the coupled flow, which is where most integrations start and which Razorpay recommends. If you send the notification object on the debit order you are on the decoupled flow, and four things change. Run the cases above first, then these. If you integrate against coupled behaviour and later move to decoupled without building the retry loop, every failed debit is silently lost. That is the single most expensive mistake on this flow. For other UPI Autopay errors, see the Error Index.

3.4 Not available in test mode yet

Not being able to trigger a scenario is not a reason to leave it out of your test suite. Each row below gives the behaviour your code has to implement and the assertion worth writing now, so that the test is already in place when the trigger arrives and so that you can run it against live traffic in the meantime.

4. Common Integration Gaps to Avoid

These are the mistakes that most often cause failed payments, missed debits or double charges after go-live. Webhook and token updates Error handling and messaging to the payer Fetch API when webhooks are late

5. Best Integration Practices

These apply to every Razorpay integration. “On this method” says what each one means here; “Test it” links to where it is tested once for every method. All best practices: Overview · Webhooks and Fetch APIs · Payment states and late authorisation · Error handling · Downtime handling · Security
Last modified on December 2, 2026