#beeb_subschedule-subscription-upgrades
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/1270142867247075389
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Ideally the price would change when the current billed month ends, if possible
The best way to handle this is with Schedules
If not possibile, then the goal would be to set a specific date for the new price to start
Schedules would allow you to change the price at the start of the next billing cycle or on a specific future date.
Otherwise, you can do what you're trying to do: update the Price on the SubscriptionItem (looks like your hash nesting is slightly off: https://dashboard.stripe.com/test/logs/req_xUy9Nm0zb6zfXN)
Or you can update the Subscription to cancel at period end and create a new Subscription using the new price and have it be in a trial period until the end of the old Subscription's current billing period
Got it. So if I go the schedule route I would create that schedule for an existing subscription and set it to have a phase that adds in the new price, and then end_behavior be cancel . That then puts into play that new pricing and cancels the original at that time?
HI ๐
I'm stepping in as my colleague needs to go. Do you want the Subscription to cancel at the end of the phase with the new price or just continue billing the customer?
continue billing the customer with that new subscription set up via the schedule. I think the only thing I'm missing on my POST is a start_date, or possibly an anchor date tied to the original subscription that is cancelling
I agree with my colleague that the easiest way to ensure you do this such that it lines up perfectly with the billing cycle is to use Schedules.
Since you want to keep billing after the first cycle on the new price, you would just specify end_behavior: release. That will remove the Schedule but leave the Subsription as is.
This approach, using Schedules to handle a future Price upgrade, is one of the key use cases we built Schedules for and we document that use case here: https://docs.stripe.com/billing/subscriptions/subscription-schedules/use-cases#upgrading-subscriptions
Actually, I think this code snippet is a closer fit to what you are describing: https://docs.stripe.com/billing/subscriptions/subscription-schedules/use-cases#changing-subscriptions
Fantastic. I did do similar to the changing subscription portion. I see it created a new subscription for that customer, but it doesn't appear the other one is canceled. Perhaps I just need to time simulate a month forward to see if that indeed takes place though: req_yxHaLdEokJBV7L
This request is a call directly to the Subscription Schedules API that is only providing a Customer and a Price. This will automatically create a Subscription for the Customer. The end_behavior is set to release so the Subscription created will never cancel unless you explicitly cancel it.
I guess I'm missing the object or detail for why the underlying subscription isn't released when the schedule/phase goes into effect. Shouldn't it be creating the schedule to essentially replace the existing one for the customer?
Could just be a param I missed
Oh, I missed the subscription param ๐ข
Correct. The way it works is, you apply a schedule to an existing subscription and it "schedules" future changes to that subscription. You don't cancel the existing one and create a new one.
So instead of one API call, you would perform 2.
- Create a schedule that is attached to the existing Subscription
- Update the
phasesof the schedule to add a second phase with the new price.
๐ Got it. So really two calls will always be needed since these subscriptions aren't on a schedule at prsent. Creation, then update.
Or the other route of subscription update, then cancel of the original for the customer.
Alright I think thats all I needed assistance with. Now to figure out how to accomplish this for 1500+ subscriptions via Postman without having to manually do each one
Best of luck! I generally recommend using one of our server-side SDKs (I'm a Python dev myself) so you can script these kinds of updates.
Yeah I think its time I lean on our ENG team a bit for this. I'm sloppy with code in Postman at best. Thanks for all the help and have a great week!
Happy to shed what ๐ก I can ๐