#tbhaxor-subscriptionschedules
1 messages · Page 1 of 1 (latest)
If the user downgrade the subscription item (decrease item or choose lower plan), I want it to be effective when the next billing cycle starts. How can I do this?
You can use subscription schedules to schedule an update : https://stripe.com/docs/billing/subscriptions/subscription-schedules
Is there any way to tell webhook that send me expanded object in the request?
You can't tell the webhook to send you an expanded object in the request. You would need to make a subsequent request after receiving the event.
Hi alex, I looked the subscription schedule api. It is bit confusing to get started with.
from_subscription is the field of subscription for which I want to create the subscription schedule. Is that right?
yep
you can look at the use cases for examples : https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases
PLease dont close this thread. I am reading both docs
Just to confirm since the downgrade of plan happen for once. This functions is correct.
const subscription = await this.stripe.subscriptions.retrieve(id);
return this.stripe.subscriptionSchedules.create({
customer: customerId,
from_subscription: id,
end_behavior: 'release',
start_date: subscription.current_period_end,
phases: [{ items: [{price: oldPriceId, quantity: 0}, {price: newPlanId, quantity: 1}], iterations: 1 }],
});
Also please update the thread topic to tbhaxor-subscriptionschedules
tbhaxor-subscriptionschedules
you wouldn't provide the oldPriceId as an item at all
But I have multiple items in the subscription :/
why would you set the oldPriceId for quantity 0?
if you want to do an upgrade/downgrade, you would essentially just not pass the oldPriceId in at all which would remove the oldPriceId from the subscription
also, you can't do both creating a subscription schedule from an existing subscription AND updating the phases at the same time
you need to do them separately
Let me re-read the documentation again. Will come back to you
But iterations thing is correct. Right? I want it to be take effect only once
fyi, this is my first time with subscription schedules, so this thread would continue for longer time. Please bear with me 😅
yep. I'd suggest you just test it out. You can use https://stripe.com/docs/billing/testing/test-clocks
I am checking, please don't close this thread.
Can I create subscription schedules from dashboard? Is it supported now?
yes, you can schedule updates via the Dashboard
in the Subscription editor, you'll see Schedule update button on the upper right hand corner
Yeah, I am checking
When I click on schedule
I am getting this error Each phase must be at minimum 1 second long. Phase 0 has the same start_date and end_date of 1654038000.
hard to say without seeing more context of how exactly you're using the dashboard
Test clock
I need to schedule the subscription to downgrade at end of this current period
should be possible but I don't really have time to dive into this I'm afraid, we help with the API here, not the dashboard
I'd suggest just playing around with it more, I'm sorry
there's no one else
Alex is in another timezone and it's my shift now. Sorry! if you need more support contact https://support.stripe.com/?contact=true , we can only give a best effort here and digging into some dashboard bug would take a lot of 1-on-1 effort. There's probably something simple here though, you have most context on what you're doing so I'd just keep playing around, you'll figure it out
yeah I am doing trial and working on it. please dont close this thread
I will ask you when to do it
Is there any way I could check the scheduled updates on the dashboard?
yep there should be a label that you can hover over at the top
or not
I guess they changed this, you used to be able to hover on that grey "update scheduled" badge and it showed the schedule
ah now you have to "manage scheduled update"
I got this event evt_1LGJv4Hn3Zy4ma8uCYfkeb1O
subscription schedule created but can't see the option you shared
try looking at https://dashboard.stripe.com/test/subscription_schedules instead
my screenshots are for looking at updates to a subscription that already exists, maybe what you're doing is scheduling the creation of a subscription? (didn't fully look)
ok no you are using an existing subscription
nope, maybe it is not for the test clocks :/
I am not sure, could you confirm this from the dev team
you haven't scheduled any changes though(you created the schedule from the subscription but haven't adjusted any phases yet) so. I guess that's why theres nothing
nope, they're all in the US and in any case it takes days to get an answer really
don't need them anyway, I answered above
Oh, yeah let me create a test subscription then
?
you already have a test subscription, that's fine
I'm just saying the reason why you don't see any details of any scheduled updates is there isn't any yet, as far as I can tell
gotta go, my colleague @hidden egret will take over
Sure no worries
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!
Yeah will do