#obo - cancel subscriptions
1 messages ยท Page 1 of 1 (latest)
Hello! Just starting a thread for you -- I'll review and respond as soon as I can ๐
Nothing automatic, no, you'd control this in your backend based on the includes products/prices and set the cancellation on individual subscriptions as needed.
could you elaborate on that last part?
I mean based on your business logic, you would decide which subscriptions should be cancelled or not, then call the API to perform this cancellation when needed
I see, so on that note, are there any patterns you can suggest that will allow us to easily query these subscriptions that have failed the 30 day window?
Because currently we can set subscriptions to auto-cancel after X-retries or X-time
but it seems this wouldn't be the case
Do you use ~monthly invoicing?
Yes, monthly subscriptions
actually, doesn't matter, one sec
If this is your default use case, you can update every subscription after creation to either cancel_at_period_end or cancel_at a timestamp of your choosing:
https://stripe.com/docs/api/subscriptions/update#update_subscription-cancel_at
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
This will then cancel if no other changes are made
You can then
- either not do this or update your preferred subscriptions to not cancel
- listen for
invoice.paidwebhook events and update and subscriptions where the invoice was paid to undo the pending cancellation
is there a webhook that we can set up to call before a cancellation?
so if a subscription is about to cancelled, this webhook gets called, and then we basically take an action based on that
so if it's a normal subscription, we cancel, if it's enterprise, we don't
Nope, there is not. To do things that way you'd need to track the subscriptions yourself.
Okay so if I set something up like this:
would there be an easy way to query those subscriptions
Sure, you can list the subscriptions by status: https://stripe.com/docs/api/subscriptions/list#list_subscriptions-status
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
okay, good to know