#Prince-subscriptions
1 messages · Page 1 of 1 (latest)
@vast wyvern what type of change is it exactly(i.e. which price are you changing to, from which price)? Certain types of change require an immediate invoice to be charged (https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#immediate-payment)
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?
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
so if i remove the proration then will it work as per my requirement?
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
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$.
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
could you please elaborate more on the coupon part, how the coupon will be used, and also charge the user on the next invoice of 100$?
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)
https://stripe.com/docs/billing/subscriptions/coupons#creating-coupons , it's duration:once
got the idea but what about the billing cycle?
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.
so as the coupon will skip the immediate payment then on 1 Dec., will it charge the user for 100$ of yearly switched subscription?
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.
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$.
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
Could you please verify? as I am a little worried about the phase start and endDate?
Hey there 👋 stepping in and getting caught up on the history of the thread.
hey
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?
hi, yes I am trying to update the price for an existing subscription item
Nothing is jumping out at me as being wrong with that code, is it not doing what you're expecting?
Actually, i have not tried yet
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.
sure