#Vadzim

1 messages ยท Page 1 of 1 (latest)

muted yokeBOT
long crane
cunning magnet
#

what key should I provide to expand array in order to retrieve refunds ? expand: ['refunds'] does not seems to work (

long crane
#

Can you share your code (omitting any secret key) or the request ID for your request?

cunning magnet
#

i beleave that to be the one: req_RAqxJG9zx828uR

#

no sorry

#

req_kzR3vJxktSig79

long crane
#

Looking at the logs, I don't see us receiving the expand array

cunning magnet
#

ok, my node js function call looks like that const charge = await stripe.charges.retrieve(chargeId, { stripeAccount: stripeAccountId, expand: ['refunds'], });

long crane
#

Hm, my function looks very similar (I've omitted the account ID header) but I can see the expand piece coming through

muted yokeBOT
latent sedge
#

I think you need to do somethign more like this:

const charge = await  stripe.charges.retrieve(chargeId, 
       {expand: ['refunds']},
      {stripeAccount: stripeAccountId,});
cunning magnet
#

you are genius ๐Ÿ˜

latent sedge
#

nice - glad it worked!

#

@cunning magnet if you have another question feel free to ask here

cunning magnet
#

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 ?