#jur_outlawz
1 messages · Page 1 of 1 (latest)
hi, you need to use SubscriptionSchedules to have the change happen at a later date than the API call itself.
https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#upgrading-subscriptions
but the customer can still increase and decrease the number between the adjustments?
by that you are referring adjusting the quantity on the SubscriptionItems? Using the API or the CustomerPortal?
yes, Api
then yes, you can make those same updates
So I actually want to schedule the price change. Do you have sample code to do just that?
yep, in the docs linked above
For phases I have to provide a quantity, but that changes before the price changes. How can I arrange that?
I really just want him to go into the next circle from year to month
well you would be declaring what you intend the quantity to be at the time that the phase will come into effect
so at the time you're creating the Schedule you would just pass the current quantity, I would think
But the quantity changed, like the phase goes into effect on 21-01-2023 and I entered it on 15-01-2023 and the quantity changed on 18-01-2023. How does that work?
good question, would have to test it
it might be that when you update the quantity you also have to update the Schedule to update the quantity of the upcoming phases(otherwise when the phase starts it changes the quantity to the one declared on the phase which would be confusing, but it's certainly logical that it might work this way) , not sure off the top of my head but I remember this type of issue coming up before
If I have created a subscriptionSchedules, can I adjust it?
I see with update() but how can i check if i have a subscriptionSchedules on this subscription?
there would be a non-null subscription_schedule field on the Subscription object
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
thanks
Is it correct if I create a schedule for a subscription and if I then adjust the subscription it removes the schedule?
it shouldn't remove it no, generally what it does is it "writes-back" the change you made to the Subscription to the current_phase of the Schedule