#AndrewAndyAndy
1 messages · Page 1 of 1 (latest)
When making update calls, you actually need to re-include all of the information for current and future phases
So if that is the second phase, you still need to include the current phase before it along with its iterations/end date
If that is meant to be the first phase, you will need to include how many iterations before it moves on or an explicit end date
for the second phase, what would i set the end date to be if we want it to continue until the user end the subscription
The way that I think is easiest is to include a number of iterations, that tells stripe to transition exactly when the subscription cycle ends https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-phases-iterations
You could manually set that yourself by including an end_date but you would have to do a bit of work yourself to figure out when exactly that should be
instead of setting the quantity to 0 can we remove the previous phase item
Hi there 👋 I'm jumping in as my teammate needs to step away soon.
Yes, instead of setting the quantity for the first item to zero and adding another one, you can instead change the Price that the item is pointing to by passing the ID of the new Price in the price parameter.
Any time! We're always happy to help!
I was looking at the upcoming invoice and it looks correct. Is it possible to view the following upcoming invoice?
end_behavior: 'release',
phases: [
{
start_date: data.currentPeriodStart,
items: [
{
price: data.priceId,
}
],
iterations: 1,
},
{
items: [
{
price: updatedPricedIdKey[data.priceId],
quantity: 1,
}
],
},
],
}
this is the most up to date code
just wanted to make sure that iterations was done correctly
No, but for testing Subscriptions or Subscription Schedules I would recommend using Test Clocks. They allow you move time forward for a sandboxed set of objects, allowing you to see exactly how your schedule and Subscriptions will play out.
https://stripe.com/docs/billing/testing/test-clocks
thank you @visual sparrow. I wasn't aware of test clocks