#sheisty6_73310-portal-cancel-subscription

1 messages · Page 1 of 1 (latest)

obsidian turtleBOT
worldly thicket
#

Hi there 👋 I believe that can fluctuate slightly based on how you have your portal configured. Have you tried making a change to a testmode Subscription the portal and see what Events are fired for your configurations?

I believe you'll be looking for either customer.subscription.updated or customer.subscription.deleted.

graceful tundra
#

Ok, I'll try test mode out

worldly thicket
#

The retroactive look may be more challenging, since Events are not stored for more than 30 days. Instead you'll likely want to list your Subscriptions and step through the results.

graceful tundra
#

"Step through" in what sense?

worldly thicket
#

That also depends on how your Subscriptions are being modified by the your portal configuration. If they're being immediately canceled, then you can filter for canceled Subscriptions:
https://docs.stripe.com/api/subscriptions/list#list_subscriptions-status
but you can't filter based on what surface the Subscription was cancelled from. So you would need to look through all the returned Subscriptions and determine how to identify which ones were cancelled by from the customer portal.

The contents of cancellation_details may be helpful there:
https://docs.stripe.com/api/subscriptions/object#subscription_object-cancellation_details

#

If your portal configuration is setting Subscriptions to cancel at the end of their current billing period, then you may also need to look at currently active Subscriptions as well, depending on what exactly you're trying to accomplish.

graceful tundra
#

Ok, thanks. Can I come back to this thread with further questions?

worldly thicket
#

If it's still open then yes you can, but I will close it after a while (usually 15-20 mins, depending on server volume, since these threads are intended for synchronous discussions). If it's not open though, you're welcome to ask your follow-up question in our main channel and a we'll take a look.