#Sven
1 messages · Page 1 of 1 (latest)
there is also a refund ID you can record
the refund object has a reference to the charge it corresponds to:
https://stripe.com/docs/api/refunds/object#refund_object-charge
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I see. But it's not transmitted via webhook? When I hit "refund" in the stripe dashboard, I only receive the charge.refunded webhook, no refund.created or similar
I issued now a refund via test mode on the dashboard and only a charge.refunded event was arrived via webhook: evt_3N8Ol7KykkNsEbHP2kwyU0p2
I'd expect a refund.created event as well, such as payment_intent.created. But maybe it'll be created only when created via API, not via Stripe Dashboard? But I'd consider this inconsistency then.
Ah right, ok
So if you need the refund objects/IDs, you will need to retrieve that charge and expand refunds to get those:
https://stripe.com/docs/api/charges/object#charge_object-refunds
https://stripe.com/docs/api/expanding_objects
https://stripe.com/docs/expand
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Learn how to reduce the number of requests you make to the Stripe API by expanding objects in responses.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
okay, will do that. So it's normal behavior to just receive a charge.refunded webhook event.
Basically we only have to listen to two major webhook events: charge.succeeded, charge.refunded. And + dispute handling
to proper save transactions in our database
Yes, because your account was created after 2022-11-15 thats the default API version
Previously, that refunds object would have been populated for inspection, but this was changed in the latest api version
Charge no longer auto-expands refunds by default. You can expand the list but for performance reasons we recommended against doing so unless needed.
Okay. thank you for your great support!