#daan_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/1308360929205026836
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
I know there is a refunds array on the charge object but it's not expanded for webhooks.
two options:
- you could make an extra API call to re-retrive the Charge with expand.
- you could make an extra API call to retrive all Refunds for that Charge: https://docs.stripe.com/api/refunds/list?lang=go
But then how will I know what refund the webhook is for? I have my own refund objects for my API that store a list of products the refund is for, the object also stores the chargeID and the refundID
Is there a way to get the refundID from the charge object?
But then how will I know what refund the webhook is for?
what do you mean? you get a Charge object in the webhook event. so you know the ID of the charge.
then you call https://docs.stripe.com/api/refunds/list?lang=go with the ID of the Charge, and you get all the refunds for that charge.
Yes but you can have multiple refunds for a single charge, so how do I know which refund was successful? Or do I need to fetch all of them after the webhook is received to see which one was successful
the list endpoint will return all refunds in reverse chrolological order. so the first one is the list is the latest one.
Ahh alright, that good to know. I'll probably just loop trough them and find the matching one. Thanks for your help!