Available in🇮🇳 India
Use this page when your server does not know how a payment ended: the webhook did not arrive, the customer closed the browser before the callback, or an API call timed out. It is for developers who run a Razorpay Payment Gateway integration and need to bring their own order records back in line with Razorpay. It brings together the recovery guidance from the webhook, fetch API and checkout pages, and links to each page that owns the detail.
When to rely on webhooks and when to fetch
Webhooks are your source of truth and fetch APIs are your safety net. Webhooks are delivered in near real-time and are asynchronous, so for business-critical flows you can also poll the payment APIs.
The browser callback can be lost, blocked or forged, and it never fires if the customer closes the browser tab. Treat it as a hint: verify the signature and show a result, but fulfil only from the webhook or a fetch.
For how long to wait for a webhook before you fetch, see Webhooks and Fetch APIs. For how long Razorpay retries a failed webhook delivery and when it disables the webhook, see Delivery Attempts and Retries.
Which fetch call to use
If one of your own API calls timed out, do not send it again blindly:
Know more about Retries and Idempotency.
When you fetch a pending order, fetch it a few times with growing gaps, then leave it to your reconciler. Do not poll in a tight loop: you hit rate limits and still miss the result.
Reconcile your local state
Build one state machine with two inputs. Webhooks and fetches update the same order record through the same code.- Find the orders in your system that are still
createdorattemptedafter your waiting period. - For each order, call
GET /v1/orders/:id/payments. - Act on the result using the table below. Apply the same rules that your webhook handler applies.
- Run a daily reconciliation as well: fetch payments and settlements by date and confirm that your records match.
Follow these rules in the state machine:
- Forward-only: ignore any update that would move a payment or an order back. Never move an order back from
paid. - Accept a late authorisation: accept
failed→authorized. Know more about Late Payment Authorisations. - Idempotent: processing the same update twice changes nothing.
authorized payment that you do not capture in time is auto-refunded. The capture timeout and the auto-refund timing are defined in Payment Capture Settings and Auto-Refunds.
Avoid duplicate fulfilment
Razorpay follows at-least-once delivery for webhooks, so your endpoint can receive the same event more than once. A fetch can also report a payment that a webhook has already told you about.- Skip repeated events: check the
x-razorpay-event-idheader on every webhook. Its value is unique per event and stays the same across the original delivery and every replay. Store the values you have already processed and skip an event if you see the same value again. - Do not rely on the order of events: you may not always receive webhooks in the order in which the events occur. Handle whichever arrives first.
- Drive fulfilment from the order: create one order per purchase, store its
order_idagainst your cart and retry payments on the same order. Fulfil when the order ispaid. - Use one code path: with two code paths for webhook and fetch, the same payment is processed differently, or twice.
- Stop a second payment: disable the pay button once an order is
paid. No further payment requests are permitted once the order moves to thepaidstate. - Reply to the webhook first: reply with
2xxwithin 5 seconds, then process the event in the background. If your server accepts the event but does not respond in time, the webhook is treated as not processed and is sent again. - Verify before you act: validate the webhook signature on the raw request body before you update an order.
Replay a missed webhook from the Dashboard
If your server was unavailable or returned a non-2xx response, you can replay the missed events yourself from the Razorpay Dashboard, without raising a support ticket. Only unacknowledged events are replayed. Events that your server already acknowledged with a 2xx response are not sent again.- Log in to the Razorpay Dashboard and navigate to Developers → Webhooks.
- Click Replay events.
- On the Replay type step, select the Date range and choose one of the following:
- Unacknowledged events: use this when you know roughly when your endpoint was down but not which events you missed.
- Specific events: use this when you already know the entity IDs, such as payment or order IDs. Select the entity and enter the IDs.
- On the Select URLs step, select the webhook URLs that should receive the replayed events.
- On the Select events step, clear any events you do not want to trigger.
- Click Replay events.
- If any of the webhook URLs you select is disabled, it is enabled automatically when you replay the events.
- Replayed events are sent exactly as they were originally generated and are signed with your current webhook secret. Replay does not create new payments, orders or any other records.
- A replayed event is a re-delivery of the original event. If your endpoint did process the original event, the replay is a duplicate, so your endpoint must be idempotent.
- There are limits on how old an event can be and how many replays you can trigger. Check them in Replay Webhook Events before you start.
What to give Support
Try the fetch APIs and the Dashboard replay first. If you still need Razorpay to replay a webhook event, raise a request:- Log in to your Dashboard.
- Click Help → Have a query? → Technical Support → Issue regarding Webhooks/API.
- Share details of the event you want to replay and click Submit.
refund.failed event, do not re-attempt the refund automatically. Alert your operations team and contact Razorpay Support.