#dominik_subsctription-upgrade-downgrade-preview
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/1440012324164341934
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there! You can use webhooks to achieve this, where you respond to the events as they happen
https://docs.stripe.com/billing/subscriptions/webhooks
Hello,
So I am building a solution with the new stripe flexible billing mode. It is very hard to determine if a subscription update is actually a downgrade or an upgrade.
What I mean with this is:
Lets imagine the user has:
- Product 1, month
- Product 2, month
- Product 3, month
- Product 4, year
Now the user removes Product 3, this is considered as a downgrade to a smaller plan. Thats the new subscription:
- Product 1, month
- Product 2, month
- Product 3, year
Now the user switches to year for all products, this is considered an upgrade as "yearly" is above monthly.
=> Why is that important?
Based on an downgrade, I want the user to not refund => proration_behaviour= "none", and if the user upgrades I want him to always invoice to make sure he gets charged prorated
Got it. If you're defining a downgrade as an invoice that's lower compared to the current (and an upgrade as higher), then you can use the preview invoice endpoint to determine which is the case when a subscription is updated. Then you can implement the logic you described for your prorations
https://docs.stripe.com/invoicing/preview