#Prince-subscriptions

1 messages · Page 1 of 1 (latest)

snow gull
vast wyvern
#

It's the change of subscription plan like maybe monthly to yearly or yearly to day or day to monthly. so as per my issue of immediate payment is because I am changing my billing period. Right?

snow gull
#

yes, that would reset the billing date which requires an immediate invoice

#

the current subscription is getting wasted completely
well, you disable the proration(ProrationBehavior.NONE) so I think that would be why that happens

vast wyvern
snow gull
#

well, it will create an invoice immediately, with proration(a discount for the unused time on the monthly plan), which might be what you are looking for

vast wyvern
#

No, actually I don't want to calculate any proration,
my requirement is basically that if I switched then firstly the amount deduction will not happen immediately and this will(amount) take action on my next invoice after the current subscription period is over.
e.g: I have a monthly subscription(50$) from 1 Nov., to 30th Nov., then if i switch to another subscription of price(100$) then the next invoice is on 1 Dec. will be of price 100$.

snow gull
#

then the only way I think is to cancel out the first invoice

#

for example add a one-time 100% off coupon to the subscription at the same time that you make this change to the yearly plan

vast wyvern
snow gull
#

the coupon can be one-time use only, so it only gets applied to one payment(the one happening when changing to the yearly plan)

vast wyvern
#

got the idea but what about the billing cycle?

snow gull
#

what about it?

#

the next time the user is charged will be now+1 year basically

#

I have a monthly subscription(50$) from 1 Nov., to 30th Nov., then if i switch to another subscription of price(100$) then the next invoice is on 1 Dec. will be of price 100$.

in that example ^^ you don't need a coupon(assuming this $100 plan is also monthly). You just do the API call you posted earlier, with ProrationBehavior.None, and it will do exactly what you're describing there!

#

if you're moving from a monthly to a yearly plan then it's more complicated(since it requires immediately payment) so you might want a coupon to skip that payment if that's what you want. Because it requires immediate payment, it resets the billing data, so the next payment is now+1 year.

vast wyvern
snow gull
#

no, it will charge them $100 on Nov 29 2022

#

if you change to a yearly plan from a monthly one, the billing cycle has changed so now the time you make the API call is the renewal date going forward.

vast wyvern
#

I think you didn't get my requirement, let me explain again
so as the user has a monthly subscription of 50$ from 1 Nov. 2021 to 30 Nov. 2021 then he switched the subscription of price 100$ maybe around on 16th of Nov., 2021. so as he has 14 more days left to complete the current subscription period and as the next invoice is basically on 1 Dec. 2021 then I want the switched subscription will take action when the current monthly period is over and charge the user on 1 Dec. 2021 with 100$.

snow gull
#

yep, I get that!

#

if that's the goal then you don't want that API call you posted, since it does the update now

#

you'd have to use SubscriptionSchedules instead to configure the subscription to change Price at the end of the current cycle

vast wyvern
#

Could you please verify? as I am a little worried about the phase start and endDate?

quick ice
#

Hey there 👋 stepping in and getting caught up on the history of the thread.

vast wyvern
#

hey

quick ice
#

Thanks for your patience while I reviewed the conversation. Just to clarify, are you trying to add a new item to the subscription, or update the price for an existing subscription item?

vast wyvern
#

hi, yes I am trying to update the price for an existing subscription item

quick ice
#

Nothing is jumping out at me as being wrong with that code, is it not doing what you're expecting?

vast wyvern
#

Actually, i have not tried yet

quick ice
#

I would suggest you try it out, and let us know if it still doesn't seem to be doing what you're looking for.

vast wyvern
#

sure