#ramonp99_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
âąď¸ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!
đ 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/1212727486438309910
đ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
â˛ď¸ 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. Thank you for your patience!
I would only want to allow customers to change 'basic monthly' to 'premium monthly', and 'basic yearly' to 'premium yearly'
And possibly also basic monthly to premium yearly
Sure, you can define the matrix of product/prices that are available to update to when you create the portal session
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes I found these docs (and also the config on the webportal)
However this only allows you to specify which products support changing plans
So currently it is possible to switch from basic monthly to basic yearly, and maybe even to premium basic or premium yearly
That is when I add all of the plans in the configuration
However that also allows customers to change from premium yearly back to basic monthly
And I don't want that
So for customers with the basic plan, it should show different options to change to compared to users with the premium plan
Yeah it won't adapt to the plan(s) the customer is currently subscribed to. You'd need to create the configure the reflect their current subscription
What if they have multiple active subscriptions, for example they have basic monthly and basic premium?
So you'd need to lookup their active plan prior to creating the portal session, and create/use a configure that reflects the upgrade options they should have
Because in that case you'd be able to change between all plans right?
You cannot provide a configuration per plan
Only fetch the plan beforehand, and provide all possible plans to change to
Then you can use a deep link to upgrade a specific subscription: https://docs.stripe.com/customer-management/portal-deep-links#create-a-flow