What webhooks should I handle for subscriptions?
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).
Verify This Answer
Cross-check this information using these trusted sources:
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
