India — Razorpay Checkout · ~12 min
Connect Razorpay to RevFast
Key ID and secret in RevFast, webhooks for payment.captured and order.paid, and ros_visitor_id in order notes (plus Checkout options.notes).
- 01
Step 1 — Install tracking on your live site
RevFast must see pageviews before checkout. The tracker sets a first-party cookie named ros_uid — that value is how we tie a sale to the last visit. 1. Sign in to RevFast → Settings → Site. 2. Copy the script tag and paste it just before </head> on every public page (homepage, pricing, blog, app shell — not only checkout). 3. Publish or deploy your site. 4. Open the homepage in a normal browser window (not a blocker that strips cookies). 5. In RevFast, wait until tracking shows at least one pageview (usually within a few seconds). If ros_uid never appears, fix tracking before connecting payments. A webhook alone cannot guess which visitor paid.
- 02
Step 2 — Connect Razorpay in RevFast
1. RevFast → Settings → Payments → Razorpay. 2. Razorpay Dashboard → Account & Settings → API Keys (https://dashboard.razorpay.com/app/keys). 3. Paste as one field with a colon between ID and secret: rzp_test_XXXXXXXXXXXX:your_key_secret (use rzp_live_… in production) 4. Click Connect. On public https RevFast registers webhooks for payment.captured and order.paid. RevFast registers webhooks on your public HTTPS app URL (https://revfast.app or NEXT_PUBLIC_APP_URL on self-host). • Click Connect — we call the provider API and register the webhook when the URL is valid https. • If auto-registration fails, copy the Webhook URL from Settings → Payments and add it manually in the provider dashboard.
- 03
Step 3 — Webhook manually
1. Razorpay → Account & Settings → Webhooks → Add New Webhook. 2. URL: full RevFast Webhook URL. 3. Active events: payment.captured and order.paid. 4. Secret: choose a secret → paste the same in RevFast. Razorpay signs with X-Razorpay-Signature.
- 04
Step 4 — notes.ros_visitor_id on Order and Checkout
Razorpay notes: max 15 key/value pairs, 256 characters each. • order.paid webhook includes the Order entity — notes from orders.create. • payment.captured includes the Payment entity only — pass the same notes in Razorpay Checkout options so payment.notes is populated. RevFast reads ros_visitor_id from notes on both events.
// Read the RevFast visitor cookie (set by tracker.js on your marketing site) const ros_visitor_id = document.cookie.match(/(?:^|; )ros_uid=([^;]*)/)?.[1]?.trim() || ""; const ros_session_id = document.cookie.match(/(?:^|; )ros_sid=([^;]*)/)?.[1]?.trim() || ""; // Server — create order const order = await razorpay.orders.create({ amount: 50000, currency: "INR", notes: { ros_visitor_id, ros_session_id, }, }); // Client Checkout const options = { key: "rzp_test_…", order_id: order.id, notes: { ros_visitor_id, ros_session_id, }, handler: function (response) { /* success UI */ }, }; const rzp = new Razorpay(options); rzp.open(); - 05
Step 5 — Run a test payment and check Revenue
1. Use the provider's test mode (Stripe test cards, Polar sandbox, Razorpay test keys, etc.). 2. Complete a real checkout flow on your site — the same path a customer uses. 3. In RevFast, open Revenue (or Customers). Within a minute you should see the order amount next to the pages that visitor viewed. Still empty? • Open Settings → Payments and confirm the integration shows Connected. • In the provider dashboard, open Webhooks → recent deliveries. Look for HTTP 200 from RevFast, not 401/404/500. • Confirm checkout sent metadata.ros_visitor_id (or the provider-specific field in this guide) and that the buyer had ros_uid set before paying. • Ad blockers and cross-domain checkout (pay on another domain without the snippet) break attribution — keep checkout on the same site that runs the tracker, or pass the id explicitly.
- 06
Common mistakes
• Snippet only on the marketing site but checkout on another domain without passing ros_visitor_id. • Using publishable keys (Stripe pk_) instead of secret keys / API tokens. • Fulfilling on the browser "success" page instead of waiting for the webhook (always trust the webhook). • Polar / Lemon webhooks set to Slack or Discord format instead of Raw JSON. • Paytm webhook not on https port 443. • Stripe subscriptions missing subscription_data.metadata (only session metadata was set).
Install with AI
Paste into Cursor or Copilot — swap in your real Site ID first.
Connect Razorpay to RevFast: rzp_key:secret in Settings → Payments, webhooks payment.captured + order.paid, orders.create notes.ros_visitor_id and Checkout options.notes from ros_uid cookie.
Related
Stuck? Email hello@revfast.app or open onboarding → Need help?