Reputation: 1078
We are writing a Saas application that users will only use for 10 months. Is there a way to define in the payplan API to limit the number of payments to take from the customer?
I have spent some time looking over the API but I just can't see it. Perhaps I'm just overlooking it.
Upvotes: 0
Views: 519
Reputation: 1
Now we can use a subscription schedule and set the phases.iterations
property: https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases-iterations
And set the end_behavior to "cancel"
Here's the full guide: https://stripe.com/docs/billing/subscriptions/subscription-schedules
Upvotes: 0
Reputation: 8727
Stripe's subscriptions will always charge indefinitely by default so you'd need some custom development to cancel the subscription after a certain number of payments. The solution would be to use webhooks to be notified about events that happen in your Stripe account.
If you listen for the invoice.payment_succeeded
event you can count how many times your customer has paid and then cancel the subscription when you want to stop the payments.
Upvotes: 2