#SuperMagicCow
1 messages · Page 1 of 1 (latest)
Hi, that is correct.
I used to use attempt_count = 4 as a final because i think stripe used to make 4 attempts
but I think the spec has changed and Im missing some stuff now
What do you mean? Can you add more details?
well we have a subscription product
and basically it autorenews every month
if the charge fails (final fail) then the user's subscription needs to be cancelled.
the way i was doing it, was i set up a webhook on invoice.payment_failed
and if object.attempt_count = 4, then boot them out
which obviously is a bad way of doing it now
but many years ago, stripe specs said they would try 4 times
and then it meant it failed permanently
but i have no idea when that changed over so now i have a bunch of freeriders in my system i need to boot out
Is there a way to download retroactively all the invoice.payment_failed webhooks so i can identify who needs to be kicked out
using next_payment_attempt = null (the right way) instead of attempt_count = 4 (the wrong way)
it's been a very long time so I'm not sure why i was using attempt count to find out if it was a final fail
but thats clearly wrong
I see, so essentially, you're trying to cancel any subscription that has a failed payment on the final retry. I think there is a Setting on your Dashboard that handles this. Let me confirm this
yes, but the problem is that i don't really need stripe to cancel it, i need to know the list of user ids it applies to because that was how i was cancelling it in the app
stripe has a combination of "outstanding invoice" and "cancelled"
for these folks
We do handle this for your on this settings in the DB: https://dashboard.stripe.com/settings/billing/automatic.
unfortunately we have 16k failed payments (most are not final attempts) I downloaded the excel file for that but there's no indication which are final
on that
However, you're wanting to do this on your end so let me confirm how you'd do this
Yeah, really I just need a way to export all final failed payments to date
i think going forward, i can use all of the solutions you've provided
So I think you could use the List all Invoices API, https://stripe.com/docs/api/invoices/list and "next_payment_attempt". You could also filter these by 'created' date, https://stripe.com/docs/api/invoices/list#list_invoices-created.
Happy to help, have a great weekend!
the problem is that it only returns 10 at a time
is there a way to mass export all of them?
with a max of 100
if there's not then don't worry about it
because I can write some code to iterate over all customers and do them one by one to verify
but if there's some way where i can jsut dump the whole thing, would be easier
You can use our auto pagination, https://stripe.com/docs/api/pagination/auto. This feature easily handles fetching large lists of resources without having to manually paginate results and perform subsequent requests.
Here is a helpful video: https://stripe.com/docs/videos/developer-foundations?video=pagination&lang=node
hmm okay I can try that