#sergx_subscription-multipleprices
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/1225720961693909012
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- sergx_best-practices, 18 hours ago, 8 messages
@naive mauve I'm so sorry I started typing, switched threads to help someone and completely forgot to follow up
What you are trying to do can be done in various ways. You can delete the add on 1 first and then add the second add-on separately
Otherwise you can also call the Update Subscription API https://docs.stripe.com/api/subscriptions/update and pass items with the changes you want.
That parameter is a bit confusing at first because it requires you to understand it merges the new items with the existing ones though
So if you already have price_A and price_B and pass items: [{price: 'price_C'}] you end up with a Subscription that has three Prices (A/B/C)
What you need to do instead is explicitly add C and delete B. This is down by using the SubscriptionItem id si_123 of the items associated with B. So you'd pass items: [ { id: 'si_123', price: 'price_C' } ]
This explicitly tells us "I want to change price_B to price_C all in one request
sergx_subscription-multipleprices
Thank you very much!
of course! I'm around if you want to try quickly in Test mode and confirm it works as expected
Of course, I'm going to test it!
I have another doubt. In my SaaS, at the beggining subscription's logic were a little bit different.
In the SaaS you are able to add and create accounts. Each account is considered at the moment as an indepent subscription. So if the user has 5 accounts in the SaaS, means 5 different subscriptions.
But because we're adding add-ons, we would like to migrate this logic to a single subscription with multiple products. For new users is going to be more or less easy just as set up the new logic. But the problem are old users.
Following the example, if a user has 5 accounts and 5 subscriptions, I am wondering how to handle this situation, and if it's possible to manually migrate these five subscriptions to a single subscription with one item and set quantity to 5
That's possible but you'll need to write some logic/code on your end. You will find the 5 Subscriptions, update the first one to have a quantity of 5 and then cancel the other 4
and you can write a script that will migrate all Subscriptions as needed
And this could cause extra charges for those users? This would be possible too for users that have a single subscription but a different product? (In the past I did wrong and I created a different product with the name for example (8 accounts plan) and don't use quantities, etc.)
hi! I'm taking over this thread.
And this could cause extra charges for those users?
what do you mean by this?
This would be possible too for users that have a single subscription but a different product?
sure, all of this is completely up to you
I mean if I create a script where I update users subscription to another different product and quantities if that could cause charges for the user? I'd like to respect billing cycle
again that's completely up to you, depending on how you write the Script.
would you recommend me documentation to look in order to do this please?
to update an existing Subscription: https://docs.stripe.com/api/subscriptions/update
to cancel an existing Subscripton: https://docs.stripe.com/api/subscriptions/cancel
I recommend you doing some tests in test mode to see how that works
you may want to use Test Clocks for this: https://stripe.com/docs/billing/testing/test-clocks