Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stripe - after changing plan, don't bill for the new subscription until current cycle ends

I want to let user to change their subscription plan. However, they won't be refunded after switching. If i set the prorate to false, stripe will bill for the new subscription right away.

For example, if the user is subscribed to a yearly plan in Jun 2018, and wants to change to monthly in Oct 2018. They will be charged with monthly plan after Jun2019, as current cycle hasn't ended yet.

How can I do with stripe api when i am updating the current subscription?

in the stripe api docs (https://stripe.com/docs/api/subscriptions/update) "if you set prorate to false when switching between different billing intervals (monthly to yearly, for example), we won't generate any credits for the old subscription's unused time—although we will still reset the billing date and will bill immediately for the new subscription."

like image 427
user1978333 Avatar asked Mar 05 '23 23:03

user1978333


1 Answers

In 2019 Stripe shipped support for Subscription Schedules which allow you to control multiple sequential phases on a Subscription. You can read more about this in the docs: https://stripe.com/docs/billing/subscriptions/subscription-schedules

With this API, you can now explicitly schedule a future change of a Subscription. The idea would be to use the Create SubscriptionSchedule API a schedule from your Subscription and plan a second phase to move the Subscription to the new price on the next billing cycle.

Past answer, which still work but less optimized:

One solution for this would be to follow those steps:

  • Mark the current subscription to cancel at the end of the current period so that you don't attempt to charge that customer again.
  • Create a new subscription to the monthly plan but put the customer on a trial period until the end of the current subscription (June 2019 in your example). This allows you to not charge him until the other subscription ends so that you switch the customer to the monthly plan as expected.
like image 177
koopajah Avatar answered Mar 13 '23 17:03

koopajah