Update or Change subscription state through API
Closed this issue · 4 comments
I have a use case to test subscription state
change via API in test site. For example, we want to change and test a subscription trialing
state to trial_ended
and past_due
so that we can build a necessary feature for our trial and signup pages.
Is there a way to update subscription state through API? I am trying to find it since long and unable to do so. I also tried changing trial_ended_at
for a test subscription via console but no luck
I also came across many such requests on web http://bit.ly/2cLwPxh posted by users for such a feature i.e. ability to change subscription state on test site.
Any updates ?
Subscription states can't be directly changed, the transitions happen as a result of different events in the system.
The easiest way to get a subscription to go past due is to delete the payment profile from the subscription and then change the next billing date to be a few minutes in the future. When it tries to "renew" it won't be able to collect payment, and (depending on your dunning settings) it will become past due.
Some gateways also have "special" card numbers that can be added to a subscription but will fail for any transaction attempts. If you're using Stripe, try the test card ending in 0341 here: https://stripe.com/docs/testing .
@rohandaxini I am going to close this issue as addressed.