#eoghanobrien
1 messages · Page 1 of 1 (latest)
You can check the previous_attributes hash on the event to see what on the subscription has changed. If the user cancels their subscription you will see canceled_at: null in the previous attributes hash and canceled_at: {SOME_TIME_STAMP} on the actual subscription object in the event that shows when the subscription will actually cancel
Not 100% sure what you mean by renew here. Are you talking about them setting the subscription to cancel at some point and then uncanceling the subscription? Or something else?
yeah, that's how the billing portal does it
good call on the previous_attributes hash, I wasn't sure how reliable they were
Gotcha. Yeah that property is reliable, you will definitely get an event that shows this change when a user does something to their subscription in the customer portal
Great! Thank you! We won't get a subscription.status = 'canceled' unless the payment is also "canceled"/refunded/failed - is that correct? Or said more clearly, when do we get subscription.status = 'canceled'?
It sounds like you have your customer portal set to cancel these subscriptions at the end of their current period. So, when they would normally renew they will instead cancel. The canceled_at timestamp will give an exact time for this
Yeah, the whole cancel_at_period_end thing
I would change that to immediately in order to have it change the status to canceled?
Yes, in that case the subscription would immediate cancel when the user clicks submit on the customer portal
And you will get a customer.subscription.deleted event right away
Oh and for the cancel_at_period_end flow you will also get a customer.subscription.deleted event when the subscription actually ends
Looks like we missed some webhooks because of our misunderstanding of how to handle cancel/uncancel via the Billing portal. Is there a way to look up how many customers have canceled via the billing portal?
or renewed
Not that I'm aware of, no
Could I look up all subscriptions and filter by customer ids
Yeah, that's definitely possible either via the Dashboard or the API
Here's the dashboard link : https://dashboard.stripe.com/subscriptions
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Can I filter by 340 customer IDs?