#atul-sub-upgrade
1 messages · Page 1 of 1 (latest)
how can be achieved
You want to charge the full amount upfront on upgrade, or a prorated amount?
prorated amount
Sure that will just by passing proration_behaviour on your upgrade: https://stripe.com/docs/billing/subscriptions/prorations
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
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,
}]
});
Is that an upgrade or a downgrade?
You can test all this quite easily with billing clocks: https://stripe.com/docs/billing/testing/test-clocks
downgrade
That will perform the downgrade immediately and immediately invoice prorations for the change, yes
stripe.subscriptions.update( subscription_id, {
cancel_at_period_end: false,
items: [{
id: subscription.items.data[0].id,
price: stripe_price_id,
}]
});
will this work ??
What is 'work'?
Yes, the API call will probably succeed
I don't know what you mean by work
I mean that above code will downgrade the subscription at next billing cycle ??