#HugoRS
1 messages ยท Page 1 of 1 (latest)
Hey!
Hi ๐ if you're trying to create a Checkout Session to update a Subscription, that is not possible. You will need to build a flow to allow your customers to update their Subscriptions, or alternatively look into the functionality provided by the Customer Portal:
https://stripe.com/docs/customer-management
Alright, so if a user upgrades to another plan the user will have 2 subscriptions?
Because we are using bubble.io's plugin right now and there we just select a "update excisting user". We are now changing to our own api calls.
It depends on what you mean by "upgrades to another plan". If you're creating a new Checkout Session with a mode: subscription, then those will result in a new Subscription being created.
Yes but will this also cancel the previous subscription plan? Or is there an API call that cancels this manually?
No, we do not assume that the creation of a new Subscription means all previous ones should be canceled. You will need to add code to provide that logic if that is the flow you would like.
This is the endpoint for canceling a Subscription:
https://stripe.com/docs/api/subscriptions/cancel
There is also an endpoint for updating Subscriptions that you can use, but this approach doesn't come with a hosted UI and you would need to build the upgrade flow into your site/app:
https://stripe.com/docs/api/subscriptions/update
Alright, I see. Can we cancel the previous subscription and use the proration_behavior to add the remaining credit to the account. Then use a new checkout?
Are you planning to reuse the Customer's existing Payment Method? I think updating the Subscription may be an easier approach if so, and doing so handles prorations in line so you don't have to worry about what happens if a customer has one Subscription canceled but then never starts the next one (in which case they may have been charged for a good/service they didn't receive/have access to).
Alright, thats the best. Just worried about the calculation of the new price. Is this available in the response code?
I would suggest taking a look through this doc (it's not too long) about upgrading (or downgrading) Subscriptions, as it goes into a bit more detail:
https://stripe.com/docs/billing/subscriptions/upgrade-downgrade
When it comes to proration calculations though, you have three options:
create_prorations: our system will automatically calculate the difference between the old price and the new one based on how far into the billing period the change is made, and will charge the customer for that additional amount at the beginning of the next billing period:always_invoice: similar to the above, but it only calculates the excess amount from the previous payment and immediately creates a new Invoice to process the payment for the new pricenone: proration calculations are disabled
Thank you for your help!
Any time! I need to step away soon, but if there is anything else my teammates can help with then please let them know. ๐