Skip to main content
Before creating your first Checkout Session with Razorpay, you need a connected Razorpay account and the correct webhook events enabled in your Razorpay dashboard.

Step 1: Connect Razorpay

Follow the Razorpay Connection Setup guide to add your API keys and webhook secret. Come back here once the connection is active.

Step 2: Enable the required webhook events

Go to your Razorpay Dashboard: Settings → Webhooks → [your Flexprice endpoint] and enable these events:
If payment_link.paid is not enabled, Flexprice will never receive payment confirmation and the subscription will stay inactive. Verify these events are enabled before testing.
token.confirmed is only needed if you use Autopay & Mandates. Without it, mandate registrations never complete and the session stays pending. It is harmless to enable for payment-link-only setups.

Webhook URL

Your Flexprice webhook URL follows this format:
Find your TENANT_ID and ENVIRONMENT_ID in Settings → General.

Step 3: Verify the webhook secret

Flexprice validates the signature on every inbound Razorpay webhook. If the secret doesn’t match, events are rejected silently. Go to Settings → Connections → Razorpay in Flexprice and confirm the webhook secret matches what’s shown in your Razorpay dashboard for that endpoint.

Step 4: Test the flow

Use Razorpay test mode before going live. Test cards: Test UPI: After a test payment, confirm:
  • Session status is completed
  • Subscription status is active
  • Invoice status is finalized
  • Your server received the checkout.session.completed event
If the session stays pending after payment, check the Razorpay webhook delivery log and confirm all five events are enabled on the correct endpoint URL.

Troubleshooting

Razorpay Connection Setup

Connect your Razorpay account to Flexprice.

Checkout Sessions API

Create your first session once Razorpay is configured.