#atul-sub-upgrade

1 messages · Page 1 of 1 (latest)

smoky basin
#

Sure, that should be possible

idle relic
#

how can be achieved

smoky basin
#

You want to charge the full amount upfront on upgrade, or a prorated amount?

idle relic
#

prorated amount

smoky basin
#

As for the downgrade happening at a specific time, you should be able to achieve this by setting billing_cycle_anchor to the desired timestamp when you update the subscription

idle relic
#

If i dont want billing cycle to be changed below code wil wor k??

#

stripe.subscriptions.update( subscription_id, {
cancel_at_period_end: false,
proration_behavior: always_invoice,
items: [{
id: subscription.items.data[0].id,
price: stripe_price_id,
}]
});

smoky basin
#

Is that an upgrade or a downgrade?

idle relic
#

downgrade

smoky basin
#

That will perform the downgrade immediately and immediately invoice prorations for the change, yes

idle relic
#

stripe.subscriptions.update( subscription_id, {
cancel_at_period_end: false,
items: [{
id: subscription.items.data[0].id,
price: stripe_price_id,
}]
});

#

will this work ??

smoky basin
#

What is 'work'?

#

Yes, the API call will probably succeed

#

I don't know what you mean by work

idle relic
#

I mean that above code will downgrade the subscription at next billing cycle ??