All docs

Razorpay

Connect

Razorpay has no API for creating webhooks, so this one is by hand.

  1. In Razorpay, go to Accounts & Settings → Webhooks → Add new webhook. Choose your own secret there.
  2. Use https://YOUR-DATAPENNY-URL/api/webhooks/razorpay/YOUR_SITE_ID.
  3. Subscribe to order.paid, subscription.charged and refund.processed.
  4. 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.