Razorpay Integration Setup
Connect Razorpay to Metrivo using secure webhooks. Match Indian and international transactions to acquisition channels, keywords, and referral links to optimize your ad spend.
Read-Only & Secure
Metrivo does not capture payments or store Razorpay API credentials. It only listens to signed webhook events to map payment events back to user traffic sessions.
How the integration works
When a payment succeeds, Razorpay sends a webhook notification to Metrivo. The attribution engine processes this event, validates the signature using your configured webhook secret, and matches the purchase to a customer session.
For high-confidence session-level attribution, you must pass Metrivo tracking identifiers into the Razorpay order or checkout page under the `notes` parameter. If no metadata is present, Metrivo falls back to matching by the customer's email address hash.
Setup steps
Generate your Metrivo Webhook URL
Navigate to Data Connections in the Metrivo dashboard, choose Razorpay, enter your integration details, and copy the generated Webhook URL. It will look like: https://metrivo.co/api/integrations/razorpay/webhook/<YOUR_INTEGRATION_ID>
Create a Webhook in Razorpay
Log into your Razorpay Dashboard, navigate to Settings → Webhooks, and click 'Add New Webhook'. Paste the Metrivo Webhook URL and enter a strong secret key.
Select Active Webhook Events
In the Razorpay webhook setup form, subscribe to the following events: payment.captured, order.paid, subscription.charged, and subscription.activated. Save the settings.
Save Webhook Secret in Metrivo
Return to the Metrivo dashboard, paste your Razorpay webhook secret key, and save. Metrivo encrypts the secret at rest and uses it to verify the signature of all inbound events.
Verify the Connection
Trigger a test payment in Razorpay. Metrivo will verify the webhook payload signature and mark your connection as Active.
Supported Webhook Events
Passing tracking IDs for high-confidence attribution
For high-confidence attribution, send the current Metrivo checkout metadata to your server and include it in the `notes` payload when creating a Razorpay Order:
This attaches the session tokens directly to the order record. When checkout completes, Razorpay passes the `notes` back in the webhook payload so Metrivo can attempt a high-confidence match. Missing notes may fall back to email or remain unattributed.
