#annex2040_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1229675867589050399
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
What do you plan to update on the subscription?
i have one product and it has three plans
i already done buy-subscription feature where i generate checkout session token so on frontend side user can pay subscription amount but i not able to find code for update plan using checkout session token
i wants a code where i give current subscription_id of user and plan_id of update plan
After the Checkout Session is created, the Checkout Session can't be updated
What do you want to update specifically? Can you illustrate in an example?
i have django apis backend which i used to run subscription feature in that -
- we have plans and there stripe_plan_ids
- i have users
- user can buy plan subcription also change plans
now i wants a update-subscription api where i give plan_id and user_id
i wants to create a update plan sucription session so on frontend side user can do payment for updating payment ?
how should i do ?
I see! Checkout Session is only for subscription sign up and doesn't support updating a subscription.
If you want to change the plan on a subscription, I'd recommend checking the guide here: https://stripe.com/docs/billing/subscriptions/upgrade-downgrade
Alternatively, Customer Portal can be used for your customer to update their subscription: https://docs.stripe.com/customer-management
ok than whats now how can user pay for updating plan ?
Hi @jovial sinew I'm taking over this thread
If your customer changes plan through billing portal, they can choose the existing payment method, or add a new payment method for the subscription.
i want somthing like that
-
i give users current subscription_id and also the plan_id which i needs to update into it
-
user pay amount for that new upgrate plan
-
and on stripe customar old subscription needs to we cancel and new plan subscription will activate ?
Why do you want to cancel the old subscription?
You don't need to cancel the subscription, you can just change the plan on a existing subscription. have you checked this doc? https://docs.stripe.com/billing/subscriptions/upgrade-downgrade
yes what in that way user cant pay - i wants to create session token for update plan so user can pay ? after payment we update plan ?
In fact no user interaction is needed (unless 3DS authentication is request) when you change a subscription.