Facebook Pixel
Razorpay Subscriptions and Recurring Payments in Node.js Setup and Management

What webhooks should I handle for subscriptions?

The answer

subscription.activated (first payment successful), subscription.charged (recurring payment successful), subscription.cancelled (user or admin cancelled), subscription.expired (all billing cycles completed), and subscription.pending (payment pending for the current cycle).

More FAQs in Razorpay Subscriptions and Recurring Payments in Node.js Setup and Management

Create a plan (e.g., ₹500/month), create a subscription linking the customer to the plan, the customer authenticates once (first payment), Razorpay auto-charges on each billing cycle, and webhooks notify you of each charge. Handle cancellation via the API or dashboard.

Use razorpay.plans.create({ period: 'monthly', interval: 1, item: { name, amount: 50000, currency: 'INR', description } }). Period can be daily, weekly, monthly, or yearly. Amount is in paise. Save the plan ID for creating subscriptions.

Call razorpay.subscriptions.cancel(subscriptionId). Update the database status to 'cancelled'. The user keeps premium access until the current billing period ends (currentPeriodEnd). After that, downgrade the user to free plan.

Still have questions?

Browse all our FAQs or reach out to our support team

Want to upskill yourself?

Your learning library

Small steps. Big possibilities.

Find your next course. Build something great.

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.