In my application users are subscribed (and billed) each month for 24 months. Is there any way to have Stripe automatically end the subscription after the 24th month when I initially create the subscription?
What you describe is possible in Stripe, but not as an out-of-the-box solution (as of August 2014). You'll need a little bit of programming logic on your end, too.
First, you'll need to have a web hooks endpoint:
https://stripe.com/docs/webhooks
Next, you'll want to subscribe the customer to a plan like normal. We'll notify your site, via the web hooks, of when payments are made on a recurring subscription. Specifically, you'll want to watch for invoice.payment_succeeded
events:
https://stripe.com/docs/api#event_types
Once a specific customer has hit the right number of payments (which you'll track on your end), you'd then issue a cancel subscription request:
https://stripe.com/docs/api#cancel_subscription
Hope that helps! Larry
PS I work on Support at Stripe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With