#Vadzim
1 messages ยท Page 1 of 1 (latest)
The refunds list is no longer included by default when retrieving a Charge if you use the latest API version (2022-11-15). You'll need to expand refunds when retrieving the charge: https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
what key should I provide to expand array in order to retrieve refunds ? expand: ['refunds'] does not seems to work (
Can you share your code (omitting any secret key) or the request ID for your request?
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Looking at the logs, I don't see us receiving the expand array
ok, my node js function call looks like that const charge = await stripe.charges.retrieve(chargeId, { stripeAccount: stripeAccountId, expand: ['refunds'], });
Hm, my function looks very similar (I've omitted the account ID header) but I can see the expand piece coming through
I think you need to do somethign more like this:
const charge = await stripe.charges.retrieve(chargeId,
{expand: ['refunds']},
{stripeAccount: stripeAccountId,});
you are genius ๐
nice - glad it worked!
@cunning magnet if you have another question feel free to ask here
When I create a refund through dashboard I get a webhook event of type charge.refunded. What I want is to get an refund id of the refund that triggered that webhook. I can retrieve a charge where refunds are listed in an array, but the question is: can i always rely on that the webhook was triggered by the refund with index [0] in this array ?