Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stripe: downgrade a user at "period end"

Is it possible to downgrade a user at period end instead of immediately? I've combed through the API Docs but haven't been able to figure out how to accomplish this.

As a workaround I'm currently immediately canceling the user's subscription, then subscribing them to the lesser subscription, trialing until the end of the month. This won't work though - I need to be able to delay the downgrade until the period end (but "record" it w/ Stripe at the time the downgrade is requested).

Clearly there are ways to accomplish this with webhook callbacks and by tracking user subscriptions locally but I'd like to avoid that if possible.


EDIT

Before anyone asks - I'm using Temboo's PHP SDK. However I'm not looking for a language-specific approach, just a high level how-to (if it's possible).

like image 615
Madbreaks Avatar asked May 29 '13 17:05

Madbreaks


People also ask

Can I back date an invoice in Stripe?

You can backdate a subscription to bill customers for time that has already elapsed. This is often used when migrating to Stripe or for record keeping purposes. The backdate_start_date field specifies the date the subscription is backdated to.

Can a customer cancel a Stripe subscription?

You can cancel subscriptions through the API or in the Dashboard. Once you open the subscription, you can choose to Cancel subscription in the dropdown menu. When you click Cancel subscription... you will be able to choose when to end the subscription: immediately, at the end of the period, or on a custom day.

What is prorate in Stripe?

Learn about prorations. Changes to a subscription such as upgrading or downgrading can result in prorated charges. For example, if a customer upgrades from a 10 USD per month subscription to a 20 USD option, they're charged prorated amounts for the time spent on each option.

How do I restart my Stripe subscription?

A canceled subscription can't be restarted, so you must create a new one for the customer if you want to continue billing them. If you choose to cancel at the end of the period, cancel_at_period_end is set to true and the subscription cancels at the end of the current billing period.


1 Answers

As @Safinn and @Martin have mentioned, you can cancel the subscription using at_period_end: true to action the cancellation on a specific date.

In order to downgrade to a different plan, the way I get around it is to do the above and then create a free trial of the new plan ending on the same date/time. This way the old plan will be cancelled on the same date that the new plan's trial will end (causing it to be active).

This lets Stripe handle the downgrade entirely their end (which should be more straightforward IMHO), rather than setting up webhooks or tracking dates in your database.

like image 189
SneakAttaack Avatar answered Sep 21 '22 02:09

SneakAttaack