#tbhaxor-subscriptionschedules

1 messages · Page 1 of 1 (latest)

daring timber
#

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.

lunar sail
#

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?

daring timber
#

yep

lunar sail
#

PLease dont close this thread. I am reading both docs

lunar sail
#

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

daring timber
#

tbhaxor-subscriptionschedules

#

you wouldn't provide the oldPriceId as an item at all

lunar sail
#

But I have multiple items in the subscription :/

daring timber
#

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

lunar sail
#

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 😅

daring timber
lunar sail
#

I am checking, please don't close this thread.

#

Can I create subscription schedules from dashboard? Is it supported now?

daring timber
#

yes, you can schedule updates via the Dashboard

#

in the Subscription editor, you'll see Schedule update button on the upper right hand corner

lunar sail
#

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.

neat snow
#

hard to say without seeing more context of how exactly you're using the dashboard

lunar sail
#

Test clock

#

I need to schedule the subscription to downgrade at end of this current period

neat snow
#

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

lunar sail
#

No worries I am already doing that

#

Nvm, let Alex jump in here

#

or someone other

neat snow
#

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

lunar sail
#

yeah I am doing trial and working on it. please dont close this thread

#

I will ask you when to do it

lunar sail
#

Is there any way I could check the scheduled updates on the dashboard?

neat snow
#

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"

lunar sail
#

I got this event evt_1LGJv4Hn3Zy4ma8uCYfkeb1O

#

subscription schedule created but can't see the option you shared

neat snow
#

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

lunar sail
#

nope, maybe it is not for the test clocks :/

#

I am not sure, could you confirm this from the dev team

neat snow
#

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

neat snow
#

don't need them anyway, I answered above

lunar sail
#

Oh, yeah let me create a test subscription then

neat snow
#

?

#

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

lunar sail
#

Sure no worries

hidden egret
#

Hey, taking over here. Let me know if there's any follow-up Qs I can answer!

lunar sail
#

Yeah will do