Best practice for adding a month to a user's subscription?

1,220 views
Skip to first unread message

Alex Mather

unread,
Nov 28, 2016, 8:15:06 AM11/28/16
to Stripe API Discussion
I'm trying to incentivize paid subscribers to take specific actions (like invite friends, buy gift subscriptions, etc.) with a reward of free months added to their subscription. What is the best way to add a single month to a user's subscription without altering the core subscription? The core subscription could be monthly, seasonal, annual.

For example:
Joe signed up for 1 year on May 1st, 2016 and will renew on May 1st, 2017. Joe invited 3 friends and has earned 3 free months. I would like to wait until August 1st, 2017 to charge him again.

I tried updating the current_period_end field on subscription and that was not allowed. It doesn't seem possible to wait for the next invoice and delay that by a month...

Remi J.

unread,
Nov 28, 2016, 10:53:51 AM11/28/16
to api-d...@lists.stripe.com
Hey Alex,

There are 2 ways to approach this situation. The first one is to discount the amount you charge the customer but keep the same billing cycle while the second option is to change their billing cycle.

If we continue with your example, giving 3 free months to Joe could mean that instead of charging him $120 for the year on May 1st, 2017 you can charge him $90. The amount is discounted by $10 for each month they get for free. This means they still pay you on the same schedule but pay you less than the full yearly price. If you go down this road, I usually recommend using Invoice Items [1] for this.

You would create an invoice item [2] for a negative amount corresponding to the amount you want to discount off of your customer's subscription for each referral. Those would get added automatically to your customer's upcoming invoice and give him the expected discount when it's time to renew his subscription.

On the other hand, if you prefer to change the billing cycle so that Joe only pays for the full year once he has exhausted his credit, you'll need to use a trial period [3]. The idea is that you update the subscription [4] and put it back on a trial until the day you want their next charge to happen on. You'd pass the `trial_end` parameter as a unix timestamp corresponding to August 1st, 2017 so that the customer is not charged until then. You'd also pass `prorate: false` to disable any proration during the update.

Hope this helps!
Remi


--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss+unsubscribe@lists.stripe.com.
To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at https://groups.google.com/a/lists.stripe.com/group/api-discuss/.

Jack Royal-Gordon

unread,
Nov 28, 2016, 11:49:19 AM11/28/16
to api-d...@lists.stripe.com
Hey Alex and Remi,

There’s another option: coupons. With a coupon, you could give them 100% off for three months. With this approach, you don’t have to know their monthly subscription cost and you don’t have to change their billing cycle. The coupon will automatically be applied when the next subscription billing cycle comes around. I apply coupons both manually and programmatically in my application.

Jack

To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.

Remi J.

unread,
Nov 28, 2016, 11:53:16 AM11/28/16
to api-d...@lists.stripe.com
Hey Jack,

Coupons would work for a monthly subscription in that example but not for the yearly one. The reason is that coupons don't care about the subscription's billing cycle as they only apply to the invoice's total. IF you were to add a 100% off coupon to a yearly subscription it would be discounted by 100% and the customer would not pay anything for that year. That's where invoice items come in because they are simply added to the upcoming invoice allowing you to change the amount you want to charge.

Hope this clarifies the situation!
Remi
Reply all
Reply to author
Forward
0 new messages