#Sen-subscription-update
1 messages · Page 1 of 1 (latest)
Hey there 👋 please bear with me a moment.
Apologies, but I don't readily recognize that syntax, which of our libraries are you using?
It's PHP
Yes that is PHP
@outer flower you're missing a set of brackets, it's an array of object
'items' => [
[
'price' => price_1XXXXXXXXXXXMAqAyO
]
]
is more like what you want
note though if you do it that way you are adding a new price to the subscription, which might not be what you wanted.
if you want to change the existing price you have to pass an ID as well :
'items' => [
[
'id' => $subscription->items->data[0]->id,
'price' => 'price_CBb6IXqvTLXp3f',
],
],
(https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#changing)
Thanks. It works fine.
Set 'proration_behavior' => 'none', But immediatly invoice not generated.
I have seen inside API docs where proration_behavior as create_prorations But i think it will count proration
if you use none then yes, you're telling us to not create any proration , so there's no invoice for the update.
if use create_prorations proration is calculated and is part of the next invoice, whenever that is
But if I want to immediately payment without proration value then??
Like if the switch plan value is $50 then need to immediately payment
payment of what, $50(the price of the new plan), with no prorated discount or debit for the switch?
in that case the easiest way is to pass proration_behavior=>"none" and also billing_cycle_anchor=>"now" to reset the cycle and issue a new invoice, I think that works
Yes, new plan price invoice create.. I will try now
I have tried the above parameters with a subscription update.
It works as wanted.
Thank you!!