#pieknu_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1339567265846267924
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Regarding the discrepancy between Webhook and the Event Tab, via the shell I'm allowed to filter through events listed in the Event tab. But as u can see, these are back from 2024, while the Webhook tabs failed events wont be listed in the shell
Sure, appreciate your help ๐
unfortunately it's not possible to resend the events that are older than 30 days
they are just a week old
This one for example; event ID: evt_3QprwoKsO9xkCfbk12rdXCmu
Oh ๐คฃ what I ment with the ones from 2024, is when I go on the "Event" tab on the workbench, these are the latest that are getting shown
on the other hand the "Webhook" tab, gives me the one I need.
but, I'm unable to bulk fetch all failed events via the shell:
example is given pzthon code:
`# Fetch failed events for the specific webhook endpoint
failed_events = stripe.Event.list(
delivery_success=False,
)
Resend failed events
for event in failed_events.auto_paging_iter():
if event["id"] in resent_events:
print(f"Skipping already resent event: {event['id']}")
continue
print(f"Resending event: {event['id']}")
try:
stripe.WebhookEndpoint.resend(event["id"])
print(f"Successfully resent {event['id']}")
# Track resent event
resent_events.add(event["id"])
with open(TRACKING_FILE, "w") as f:
json.dump(list(resent_events), f)
except Exception as e:
print(f"Failed to resend {event['id']}: {str(e)}")`
But dthe data of failed_events is always 0
you don't have to resend these events manually. if you've already fixed the issue the events will be sent back to you
but, the documentation states Stripe is only retrzing to send failed ones for up to 3 days. or am I getting soemthing wrong here ?
no worries one of the screenshots above with a latest example wasn't a good example :))
but in case of this one here:
evt_3QprwoKsO9xkCfbk12rdXCmu
I can see there's a resend button.
But I have like thousends of those, so I tried to follow the documentation to do a bulk resend
https://docs.stripe.com/webhooks/process-undelivered-events
but when following these steps, the response is always empty. Like in, there arent any failed ones
events = stripe.Event.list(
delivery_success=False,
)
this code snippet that's given, always returns 0 failed ones
Do u have an idea or a suggestion, how I'm able to bulk fetch all the ones that have failed. Because it seems like I'm doing something wrong ๐ฅฒ
oh I see the issue now
you're listing the events that are undelivered on your own account
whereas the events that you are trying to resend are on your connected accounts
OHHHHH
do u know if there's a wildcard to fetch all events from all connected accoutns? or is that something I have to take into account in the shell?
but if you have multiple connected accounts you need to fetch for each connected account separately by passing the stripe-account header
heh, the last thing I would have tried, was using the stripe-account :))
stripe events list --limit="999" --delivery-success=false --stripe-account=acct_1QXOXXXXXXXX
now it also lists the ones that are failed.
and I thought by simple not stating it, it would work as a wildcard.
AHHH, I new I overlooked something ๐ฅฒ
thanks for the help tarzan!
Do u know if there's a CLI command to fetch all "connected accounts" ?
as in getting a list with all their ID's
yes
so basically you can do that for any resource type
you can do stripe accounts list
Ah thanks, just found this here aswell; https://docs.stripe.com/api/accounts/list
Thanks for the help Tarzan. I think thats about it :p
Have a wonderfull day ๐
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
sure you too