Integrations · Razorpay

Razorpay webhooks: verify, monitor and replay

Razorpay tells your product about every captured payment, failed payment and refund through webhooks. Relaya receives them first: it verifies the signature, drops duplicates, records every event and forwards it to your code with retries, so a deploy or an outage never costs you a payment notification.

Why route Razorpay webhooks through Relaya

Razorpay retries a failed delivery for a while and then gives up, and its signature has no timestamp. If your endpoint is down during a deploy, or someone replays an old request, your books drift from what Razorpay knows. Relaya answers Razorpay in milliseconds from a separate ingest service, keeps every event for your retention window, and lets you replay any of them later.

What Relaya checks on every request

Razorpay
Signature headerX-Razorpay-Signature
AlgorithmHex HMAC-SHA256 of the raw body, keyed with your webhook secret
FreshnessRazorpay sends no timestamp, so replays are stopped by the event ID instead
DuplicatesX-Razorpay-Event-Id header
Event typeevent field of the body, e.g. payment.captured
Secret to enterThe secret you set when creating the webhook in Razorpay
A Razorpay webhook arriving at Relaya
POST https://api.relaya.sbs/v1/in/in_7Kq…
X-Razorpay-Signature: 3f1c…e9a2
X-Razorpay-Event-Id: Kq8xY2nZp4LmTe

{ "entity": "event", "event": "payment.captured",
  "payload": { "payment": { "entity": { "id": "pay_Kq8…", "amount": 49900, "currency": "INR", … } } } }

Set up Razorpay webhooks in about 15 minutes

  1. 01
    In Relaya, create a webhook and pick Razorpay. Copy its URL.
  2. 02
    In the Razorpay Dashboard → Accounts & Settings → Webhooks → Add New Webhook, paste the URL as the Webhook URL.
  3. 03
    Set a secret there and enter the same secret in Relaya, so every request can be verified.
  4. 04
    Choose the events you need (for example payment.captured, payment.failed, refund.processed) and save.
  5. 05
    Add your own endpoint as a destination in Relaya. Events are forwarded there, signed by Relaya, with retries.

Then verify Relaya's signature in your endpoint and answer 2xx. The docs show how, with SDKs for Node, Python, PHP, Go and Java.

Razorpay events teams route through Relaya

EventWhat you usually do with it
payment.capturedThe money is yours: fulfil the order or activate the plan.
payment.failedShow the customer a retry option; useful for dunning.
order.paidAn order is fully paid, even across several payment attempts.
refund.processedUpdate your ledger and tell the customer.
subscription.chargedA recurring payment succeeded: extend access.

Included for every Razorpay webhook

Verified on arrival

Forged or stale requests are rejected and kept as evidence, never forwarded.

Every event on record

Headers, payload and signature result, searchable by type or provider event ID, with secrets masked.

Forwarded with retries

Signed with Relaya-Signature, retried with backoff, with an Idempotency-Key that never changes.

Contract checks

A renamed, removed or retyped critical field opens an incident with every affected event.

Safe replay

Preview exactly what will be resent, then replay only the affected events.

Alerts

Slack, email, Jira or your own webhook when signatures fail or a destination goes down.

Razorpay webhooks: common questions

Which secret does Relaya need for Razorpay?

The webhook secret you type when you create the webhook in the Razorpay Dashboard. It is not your API key secret. Relaya encrypts it with a key unique to your organization.

Does Relaya stop duplicate Razorpay events?

Yes. Razorpay sends the same event ID on every retry (X-Razorpay-Event-Id). Relaya stores the first one and marks later copies as duplicates, so your endpoint handles each event once.

What if Razorpay changes a payload field?

Relaya learns the shape of each event type. If a field you marked critical goes missing or changes type (say amount arrives as a string), it opens an incident with every affected payment and alerts you.

Can I test without a real payment?

Yes. Every webhook in Relaya has a "Send a test event" button that sends a sample Razorpay event signed with your own secret, through the same checks as a real one.

Never miss a Razorpay event again.

Point your first webhook at Relaya today. Try the Team plan free for 7 days.