Skip to main content
POST
Razorpay webhook receiver (per-connection, BYO)
Per-connection variant of the Razorpay webhook receiver for workspaces that connected their own Razorpay account with Connect a Gateway. The event is verified with that connection’s own webhook secret (resolved from connID) before the payload is trusted. Invoice, refund and virtual-account events are bound to the connection’s workspace; token.confirmed is not (see below). Event handling is otherwise identical to the platform receiver.
Each connection has its own URL. Read webhook_path from List Gateway Connections (for example /webhooks/razorpay/{connID}), append it to https://api.recurso.dev, and register that URL in the Razorpay Dashboard under Settings > Webhooks using the webhook_secret you supplied when connecting, or set later with Set Gateway Webhook Secret. A connection without a webhook secret cannot verify deliveries and rejects them.

Parameters

Request Body

The raw Razorpay event payload. The event field selects the handler: Any other event is acknowledged with status: "ignored". An invoice, refund or virtual account that belongs to a different workspace than the connection is never applied: an invoice is acknowledged as ignored with reason unknown invoice_id, while a refund or virtual account is acknowledged with status: "ok" and no reason, exactly as if it had been applied. token.confirmed resolves the mandate by its Razorpay token id alone and is not checked against the connection’s workspace.

Example Request

Razorpay sends a POST request with event data:

Response

Returns 200 OK on successful processing. A payment.captured or order.paid whose invoice_id matches no invoice is acknowledged as ignored; a payment.failed whose invoice_id matches no invoice is treated as an error and returns 500, so Razorpay keeps redelivering it.
When the event is acknowledged but deliberately not applied, reason says why:

Fields

Deduplication keys on X-Razorpay-Event-Id. When the header is missing, the delivery is deduplicated on a hash of the signed body instead, so a byte-identical replay is still ignored. An event is only recorded as processed after a 2xx response; a delivery that fails with 5xx is retried by Razorpay and reprocessed.

Errors

Errors use the standard envelope — see Errors.

Authorizations

Authorization
string
header
required

Headers

X-Razorpay-Signature
string
required

HMAC-SHA256 signature of the raw request body.

Path Parameters

connID
string<uuid>
required

The tenant's Razorpay gateway-connection id.

Body

application/json

Raw Razorpay event payload.

Response

Event processed (or deliberately ignored).

status
enum<string>
Available options:
ok,
ignored
reason
string