Skip to main content
Razorpay is Fluxrate’s native payment gateway for Indian businesses. When connected, Fluxrate creates a Razorpay Payment Link for every finalized invoice. Customers receive a link to pay via UPI, debit/credit cards, net banking, or popular wallets all in INR.

Prerequisites

  • A Razorpay account (live or test mode)
  • A Razorpay Key ID (rzp_live_... or rzp_test_...)
  • A Razorpay Key Secret
  • A Razorpay Webhook Secret (set when creating the webhook endpoint)

Setup

Step 1 - Get your Razorpay API Keys

  1. Go to Razorpay Dashboard > Settings > API Keys.
  2. Click Generate Key (or use an existing key pair).
  3. Copy the Key ID (rzp_live_...) and Key Secret.
The Key Secret is shown only once at generation time. If lost, you must generate a new key pair. Fluxrate stores both values encrypted.

Step 2 - Connect in Fluxrate

  1. Open Dashboard > Integrations.
  2. Click Connect next to Razorpay.
  3. Fill in the form:
FieldValue
Connection NameA friendly label, e.g. Production Razorpay
Key IDYour Razorpay Key ID (rzp_live_...)
Key SecretYour Razorpay Key Secret
Webhook SecretLeave blank for now — you’ll add this after setting up the webhook
  1. Click Create Connection. Fluxrate generates a unique Webhook URL for your integration.

Step 3 - Configure the Webhook in Razorpay

  1. Go to Razorpay Dashboard → Account Settings → Webhooks.
  2. Click Add New Webhook.
  3. Paste the Webhook URL from Fluxrate:
    https://api.fluxrate.co/api/v1/webhooks/razorpay/tenant_{your_org_id}/{env_id}
    
  4. Set a Secret this is your webhook secret. Copy it now.
  5. Under Active Events, enable:
    • payment.captured
    • payment.failed
    • order.paid
    • refund.created
    • payment_link.paid
  6. Click Create Webhook.

Step 4 - Save the Webhook Secret

  1. Back in Fluxrate, go to Dashboard → Integrations → Manage (Razorpay).
  2. Paste the webhook secret you set in Razorpay.
  3. Click Save Changes.
Your Razorpay integration is now fully configured.

How Payments Work

Fluxrate passes invoice_id and customer_id in the Razorpay Payment Link notes field. When Razorpay fires a webhook on successful payment, Fluxrate reads these values to identify and update the invoice.

Webhook Payload Handling

Razorpay webhook payloads use a nested payload structure. Fluxrate reads from multiple possible locations:
FieldSource in payloadPurpose
invoice_idpayload.payment.entity.notes.invoice_id or payload.payment_link.entity.notes.invoice_idLinks event to a Fluxrate invoice
customer_idpayload.payment.entity.notes.customer_idLinks event to a Fluxrate customer
amountpayload.payment.entity.amount ÷ 100Amount in INR (paise → rupees)
currencypayload.payment.entity.currency (uppercased)Currency code, e.g. INR
provider_payment_idpayload.payment.entity.idRazorpay payment ID (pay_...)
Events that trigger invoice payment in Fluxrate:
  • payment.captured
  • order.paid
  • payment_link.paid

Signature Verification

Fluxrate verifies every Razorpay webhook using HMAC-SHA256:
expected = hmac.new(webhook_secret.encode(), raw_body, hashlib.sha256).hexdigest()
assert hmac.compare_digest(expected, razorpay_signature)
The signature is read from the X-Razorpay-Signature request header. Requests that fail verification are rejected with 400 Bad Request.

Managing the Integration

ActionHow
Rotate API keysManage → enter new Key ID and Key Secret → Save Changes
Rotate webhook secretManage → enter new webhook secret → Save Changes
Temporarily disableManage → toggle is_active off → Save Changes
Remove entirelyDashboard → Integrations → ··· → Disconnect

Troubleshooting

Fluxrate uses X-Razorpay-Signature and your stored webhook secret to verify requests via HMAC-SHA256. Ensure the webhook secret in Fluxrate exactly matches the secret you set in the Razorpay Dashboard. Regenerating the secret in Razorpay requires updating it in Fluxrate too.
Confirm that the Payment Link was created with notes.invoice_id populated. Check Dashboard > Integrations > Webhook Events in Fluxrate to verify the event was received and that event_type is payment.captured or payment_link.paid.
Razorpay amounts are in the smallest currency unit (paise for INR). Fluxrate divides by 100 to convert to rupees. If the amounts differ, verify that the Payment Link was created with the correct invoice total.
Razorpay primarily processes INR. Multi-currency support on Razorpay is limited to specific international payment methods. If your customers are outside India, consider using the Stripe integration instead.