#amdev-plan-idempotency
1 messages · Page 1 of 1 (latest)
Hello @hot sundial I'm sorry I don't follow what you mean
idempotency key has ~nothing to do with plans and cancelations and such
Our stripe plans are connected to an enrollment link, so a user has the link and is then enrolled in the plan. If an admin on our site cancels the plan for a user, but it's an accident, could they be re-enrolled by removing the idempotency key so they can have a duplicate plan
I thought idempotency was to make sure users don't keep adding the same plan when they enroll. Is that wrong?
yeah that is not really what idempotency keys are for sorry you likely are misunderstanding this
You use an idempotency key to recover from a network error or a crash. Those are valid only 24 hours, there's no logic where you can only get a plan once and never again
also the Plan API has been deprecated for a few years and replaced by the Price API
and you're talking about an "enrollment link" but I'm not sure what that means
ultimately, nothing on Stripe prevents you from subscribing to the same Price (or Plan) twice
I see what you're saying. But once you cancel a plan, that's it for the user. A whole new plan has to be created, right?
not really no
sorry I worry we're talking about completely different things at this point
Are you a developer writing the code end to end? If so, can you share exactly what you are doing, which exact API you are using, etc.?
I'm a new dev so I'm looking through our codebase to try to solve this for our team. Now that I understand what you're saying...yeah I don't think what was proposed can work. Hoping to try to fudge something to get a user to re-enroll via the API so we aren't manually creating plans for user mistakes, but it looks like it really isn't possible
I mean our API supports this and has from day one many years ago
https://stripe.com/docs/api/subscriptions/create and you can pass a Price id price_123 (or plan_123 if you use the old API) totally fine whether it was created today or 7 years ago
Even if that id shows up as canceled for a user?
a Plan can never be canceled
Are you mixing up your vocabulary maybe?
Do you mean a Subscription
Yes a subscription! We call them plans on our end
😅
And everything I'm reading points to a no. But my team wants me to check
It is impossible to take a canceled Subscription and bring it back to active. It is impossible to create a new Subscription and have it use the same sub_123456 id as the previous one
You would simply create a new Subscription: https://stripe.com/docs/api/subscriptions/create
That's what I thought too. Someone on the team mentioned the idempotency key and I wanted to investigate that. Thanks for all of your patience!