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.
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 cancelled successfully. This can happen when the customer cancels the token from their UPI app or when the business cancels it via the Cancel Token API. When you call the Cancel Token API, the token first enters thecancellation_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.
Sometimes there is a delay in receiving the callback from the downstream partner, in which case the token remains in the cancellation_initiated state. You can retry cancelling a token that is in the cancellation_initiated state.
If a customer cancels the token directly from their UPI app, you 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 thepaused state.
The customer can resume or cancel a paused token. When this happens, you receive the token.confirmed or token.cancelled webhook respectively. Sometimes customers pause a token until a certain date. When that date passes, the token moves back to the confirmed state, and the token.confirmed webhook is sent to you as well.
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 thetoken_id from the payment entity and store it for subsequent debits.
UPI
Payment Captured
Indicates that the payment has been captured. For a mandate registration, apayment.captured event means that the first debit was successful. Along with the token.confirmed webhook, it means that the UPI Autopay token for the customer is now active.
UPI
Order Paid
Indicates that the customer has successfully made the payment. The order entity has no failed webhook, because you can create multiple payments inside the sameorder_id, which helps track conversion rates. We recommend that you rely on a combination of payment, order and token status webhooks to understand and track conversion rates.
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
Check Registration Link Status using Webhooks
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 currently available only for the decoupled flow, where you send the notification object while creating an order for a subsequent payment. Support for coupled flow is coming soon.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