Connect
Razorpay has no API for creating webhooks, so this one is by hand.
- In Razorpay, go to Accounts & Settings → Webhooks → Add new webhook. Choose your own secret there.
- Use
https://YOUR-DATAPENNY-URL/api/webhooks/razorpay/YOUR_SITE_ID. - Subscribe to
order.paid,subscription.chargedandrefund.processed. - Paste the secret you chose into Setup → Payments → Razorpay.
Checkouts
Add the visitor id to the notes of the order or subscription you create:
const order = await razorpay.orders.create({
amount: 49900,
currency: 'INR',
notes: { datapenny_visitor_id: visitorId }, // from datapenny.visitorId()
});
Import past sales
Use a key id and secret from Account & Settings → API Keys.
Currencies
Sales in INR can report in any currency. Pick one under Setup → Reporting, and each sale converts at that day’s ECB rate.