Skip to main content

Razorpay Integration

Connect your Razorpay account to automatically detect subscription cancellations and payment failures.

Setup

1

Copy Your Webhook URL

Find your webhook URL in Settings > Integrations > Razorpay. The format is:
https://api.windbackai.com/api/v1/webhooks/razorpay/<your_public_key>
Your public key starts with pub_ and is unique to your project.
2

Add the Webhook in Razorpay Dashboard

  1. Go to Razorpay Dashboard > Settings > Webhooks
  2. Click Add New Webhook
  3. Paste your Windback webhook URL
  4. Select the events listed below
  5. Click Create Webhook
3

Select Webhook Events

Enable the following events in Razorpay:
Razorpay EventWindback Churn TypeDescription
subscription.cancelledVoluntary churnCustomer canceled their subscription
payment.failedInvoluntary churnPayment attempt failed
payment.capturedRecoveryPayment successfully captured after failure

Data Mapping

When Windback receives a Razorpay webhook, the following fields are extracted:
Razorpay FieldWindback FieldNotes
payload.payment.entity.emailcustomer_emailFrom payment entity
payload.payment.entity.contactcustomer_nameFalls back to email prefix
payload.payment.entity.amountmrrAmount in smallest currency unit (paise)
payload.payment.entity.currencycurrencyISO 4217 code (e.g., inr)
payload.subscription.entity.plan_idplan_nameRazorpay plan identifier
payload.subscription.entity.created_attenure_daysCalculated from subscription start

Webhook Resilience

Windback webhook endpoints always return HTTP 200 regardless of internal processing status. This prevents Razorpay from disabling your webhook due to repeated failures.
Events are queued and processed asynchronously. If processing fails internally, events are retried automatically. You will never lose a churn event due to a transient error.

Verifying the Connection

After setup, verify the integration:
  1. Create a test subscription in Razorpay test mode
  2. Cancel the subscription to trigger a subscription.cancelled event
  3. Check your Windback dashboard for the new churn event
Use Razorpay test mode keys during development. Never send test events to a production webhook URL.
Razorpay webhooks include a X-Razorpay-Signature header. Windback currently authenticates via the public key in the URL. Keep your webhook URL private.