Start a new topic
Answered

Scheduled subscription changes are removed if I update the subscription.

I guess what I want is not supported, but I'd like to describe my use case anyway and solicit some input.


My user can switch between two plans, say, Basic and Pro. If the user upgrades Basic -> Pro, I let chargebee prorate. If the user downgrades from Pro -> Basic, I update the subscription with "end_of_term", such that Chargebee "schedules" the changes for the end of the billing term. That is, my customers can cancel to the end of the term.


So far so good. What complicates this is that for a Pro subscription, the plan  has a"quantity" that factors in. If the user schedules a downgrade to "Basic", and that downgrade is scheduled for two weeks from now, in those two weeks the user still would have the ability to downgrade the quantity of his Pro plan.


I expected Chargebee to handle this for me. In particular, since the docs for a subscription update state "Only the parameters that are passed are modified for the subscription. Rest will reflect the existing values".


However, what happens when I run the UpdateSubscription API call, even when I do not give ANY data to change, the existing "scheduled changes" are always removed entirely.


Best Answer

Hi Michael, 


In this scenario, the best approach for you would be to use the retrieve with scheduled changes API before calling the update subscription to see if there any scheduled changes to the subscription, store these temporarily on your end, update the quantity, and then schedule the changes again. 


With the current workflow in our system, when you update the plan quantity, you're also including the current plan's ID, in which case the update a subscription API would update the subscription with the current plan and quantity, removing the scheduled changes. 



1 Comment

Answer

Hi Michael, 


In this scenario, the best approach for you would be to use the retrieve with scheduled changes API before calling the update subscription to see if there any scheduled changes to the subscription, store these temporarily on your end, update the quantity, and then schedule the changes again. 


With the current workflow in our system, when you update the plan quantity, you're also including the current plan's ID, in which case the update a subscription API would update the subscription with the current plan and quantity, removing the scheduled changes. 



Login or Signup to post a comment