What should I store in the Subscription model?
userId, subscriptionId (unique), planId, status (created/active/cancelled/expired), totalCount (total billing cycles), currentCount (cycles charged so far), currentPeriodStart, currentPeriodEnd, cancelledAt, and payment method.
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.
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).
Still have questions?
Browse all our FAQs or reach out to our support team
