Skip to main content
Available in🇮🇳 India
Webhooks automatically notify your application when specific events occur. Instead of continuously polling APIs to check for updates, webhooks push notifications directly to your server when events happen. Integrating with webhooks is strongly recommended as it is the most efficient method for tracking payment and token status changes in real time. To configure webhooks, go to the Razorpay Dashboard and set up the webhook URL for your account. Know more about Webhooks.
Implementation ConsiderationsWebhooks are the primary and most efficient method for event notifications. They are delivered asynchronously in near real-time. For critical user-facing flows that need instant confirmation, supplement webhooks with API verification.Recommended approach
  • Rely on webhooks for all automation, which can be asynchronous.
  • If a critical user-facing flow requires instant status, but the webhook notification has not arrived within the time mandated by your business needs, perform an immediate API Fetch call (Payments, Orders and Refunds) to verify the status.

Check Token Status using Webhooks

You can use the below webhooks to check the status of the token (mandate).

Token Confirmed

Indicates that the bank has completed the mandate registration. Once confirmed, you can execute subsequent payments as per your business needs.
UPI

Token Rejected

Triggered during the mandate registration process, when the registration fails without completion.
UPI

Token Cancelled

Triggered when a token is explicitly cancelled or deactivated. This can happen when the customer cancels the mandate from their UPI app or when the business cancels it via the Cancel Token API.
Handy TipsWhen you call the Cancel Token API, the token first enters the cancellation_initiated state while Razorpay waits for NPCI and the customer’s bank to confirm the closure. The token.cancelled webhook is triggered only after NPCI has fully processed and confirmed the cancellation.
Watch Out!If a customer cancels the mandate directly from their UPI app, you will receive this webhook. Ensure your system handles this event to stop any further debit attempts against this token.
UPI

Token Paused

Indicates the token has been paused by the customer from their UPI app. No subsequent debits can be executed while the token is in the paused state.
Handy TipsThe token.paused event is available only for tokens authorised via UPI. Tokens authorised via Emandate, Card or Paper NACH do not support the paused state.
UPI

Check Payment Status using Webhooks

You can use these webhooks to check the status of the authorisation payment and subsequent payments.

Payment Authorised

Indicates that the payment has been authorised. A payment is authorised when the customer’s payment details are successfully authenticated by the bank. Use this webhook to fetch the token_id from the payment entity and store it for subsequent debits.
UPI

Payment Captured

Indicates that the payment has been captured.
UPI

Order Paid

Indicates that the customer has successfully made the payment.
Handy TipsFor UPI, the invoice_id parameter value is null when using the API-based setup. The invoice_id is populated only when a Registration Link is used.
UPI

Payment Failed

Indicates that the payment has failed. If the authorisation payment fails, you need to initiate the mandate registration again. For subsequent payments, you can retry the debit after checking the failure reason.
UPI
You can use these webhooks to check the status of the registration link. These are relevant only if you are using the Registration Link flow to initiate mandate registration.

Invoice Paid

Indicates that a registration link has been successfully paid.
UPI

Check Notification Status using Webhooks

You can use these webhooks to check the status of the pre-debit notification sent to the customer. These notification webhooks are available only if you send the notification object while creating an order for a subsequent payment.

Notification Delivered

Indicates that a pre-debit notification is successfully delivered.
UPI

Notification Failed

Indicates that a pre-debit notification has failed to deliver. You should re-trigger the pre-debit notification before making a debit attempt in these cases.
UPI