-
Notifications
You must be signed in to change notification settings - Fork 120
Description
Hi team ,
I’m using Razorpay Subscriptions in my application and need some guidance on the best way to handle user subscription updates.
Use case
A user subscribes to a plan with plan_id = plan_xx1.
Later, the same user wants to switch to another plan, say plan_xx2.
In my database, I already track the user’s active subscription, so I can update it internally. However, I want to understand how Razorpay manages subscriptions at the customer level.
Questions
-
Does Razorpay maintain a customer identifier (similar to how Stripe creates a customer and then attaches subscriptions to that customer)? This will be realy helpful to verify all subscriptions of a user from Razorpay as source of truth, I definitely maintain all subscriptions of a user but it's good to have on Razorpay side.
-
If yes, can we use that customer_id to ensure a single user does not end up with multiple active subscriptions?
-
Or is it expected that we handle this logic ourselves in the application layer?
Basically, I’m trying to prevent the same user from subscribing multiple times to different plans simultaneously.
If Razorpay maintains a unique customer_id, then I can easily check all subscriptions for that user, instead of trusting my DB it will more better to check Razorpay for some cases
Any guidance or best practices around this would be really helpful 🙏
Thanks,
Arjun Dangi