#Anh-expand

1 messages · Page 1 of 1 (latest)

jaunty bolt
sharp sparrow
#

could help to check anything wrong?

jaunty bolt
#

Could you share the request ID (req_xxx)?

sharp sparrow
#

wait ah

#

req_CtdncCbFbRAPWK

#

@jaunty bolt this is my request id

#

i just tried another one

#

req_U2y8Si3QSjl61m

#

still cannot expand the source

#

oh wait i think req_U2y8Si3QSjl61m works

#

but there's no payment intent (pi_...)

jaunty bolt
#

Thanks for the info, I'm having a look.

sharp sparrow
#

thanks

#

hi @jaunty bolt any findings?

jaunty bolt
#

I'm sorry but I need to step out. My colleague ynnoj will have a look soon.

serene junco
#

Hey @sharp sparrow ! Just catching up here. Can you share that py_xxx ID please?

sharp sparrow
#

py_1KMUByQbfl7QxFrMxoLqFSEL

#

can try this

serene junco
#

So that specific py_xxx object pertains to a transfer between connected accounts (from a destination charge), not directly a Payment Intent

#

What are you trying to achieve?

sharp sparrow
#

hi @serene junco we are trying to do a recon btw the payout and the payment intent. Our system records Stripe's payment intent. Whenever we receive the payout from stripe, we wanted to map the payout back to the payment intent so that we can transition our status from "Paid" to "Completed" (aka we have received the money)

#

could u recommend us how to get the payment intent from the payout?

#

or how to map py_xxx to pi_xxx?

serene junco
#

Who is we in this instance? The platform?

sharp sparrow
#

yep the platform

#

@serene junco

serene junco
#

What kind of charges are you using?

sharp sparrow
#

what do u mean what kind of charges?

serene junco
sharp sparrow
#

we are using destination-charges

serene junco
#

Ok so that API you're calling will return all Balance Transaction types relating to a specific Payout

#

When in reality you just want actual payments/charges. Right?

sharp sparrow
#

i want to link the payout to the pi_xxx

#

so that we know what payment intent is being paid out for a payoutid

serene junco
#

Right, but you don't want objects relating to refunds etc (which is what that object is in the screenshot above ☝️ ) object: 'refund'

sharp sparrow
#

i want the refund also. Basically we want to a way to map the py_xxx to pi_xxx

serene junco
#

You'll probably need an additional level of nested expanding then: https://api.stripe.com/v1/balance_transactions?payout=po_1KOwHLQbfl7QxFrMqDVC4Dvh&type=charge&expand=[data.source.charge]

sharp sparrow
#

i just tried but got this error

serene junco
#

Let me try, only really every use our libraries and not curl

#

https://api.stripe.com/v1/balance_transactions?payout=po_1KOwHLQbfl7QxFrMqDVC4Dvh&type=charge&expand[0]=data.source.charge

#

Should now have a payment_intent field with the pi_xxx ID for the corresponding charge

sharp sparrow
#

now i get this

serene junco
#

Ah, you're passing the Stripe-Account header

#

So yeah, there won't be any charges on that account with destination charges

#

You said you were acting as the platform

sharp sparrow
#

im tracking the payout to the connected account's bank account

#

sothats why im using the Stripe-account header

#

so u mean there's no way to map the py_xxx (from connected account) to pi_xxx (from platform account)?

serene junco
#

Let me test

serene junco
#

Hey!

#

Yes, was just about to share that!

#

Took me a while to get the test scenario setup

#

https://api.stripe.com/v1/balance_transactions?expand[0]=data.source.source_transfer.source_transaction&payout=po_1KOwHLQbfl7QxFrMqDVC4Dvh

sharp sparrow
#

nice, thanks so much, let me check it

#

🙏

serene junco
#

Did it work?