Skip to main content

Setup

Required env vars:

How it works

Checkouts and one-off payments are both built on Razorpay’s Payment Links. Subscriptions use a pre-existing Razorpay Plan instead — item_id maps to that plan’s plan_id:

Webhooks

Razorpay signs webhooks with a webhook secret you configure separately in the Razorpay dashboard — it’s not the same as your API key secret.
Razorpay sends the signature in the x-razorpay-signature header: HMAC-SHA256(webhookSecret, rawRequestBody).

Raw Razorpay events

Opt into any native Razorpay event — fully typed against Razorpay’s webhook payload shape:
Every webhook always emits its raw event first, alongside the matching standard PayKit event below where one applies.
Raw eventPayKit event
razorpay.payment.authorizedpayment.updated
razorpay.payment.capturedpayment.succeeded + invoice.generated
razorpay.payment.failedpayment.failed
razorpay.order.paidpayment.succeeded + invoice.generated
razorpay.refund.created / razorpay.refund.processedrefund.created
razorpay.payment_link.paidpayment.succeeded
razorpay.payment_link.cancelled / razorpay.payment_link.expired(raw only)
razorpay.subscription.authenticated/activated/updated/resumedsubscription.updated
razorpay.subscription.chargedpayment.succeeded + invoice.generated
razorpay.subscription.completed / razorpay.subscription.cancelledsubscription.canceled
razorpay.subscription.pending/halted/paused(raw only)
Razorpay has no delete-customer API and no cancel-payment API — use createRefund to reverse a captured payment instead of canceling it.

provider_metadata