#Anh-expand
1 messages · Page 1 of 1 (latest)
Hi! Did you use expand: ['data.source'] in your API call as explained here https://stripe.com/docs/expand/use-cases#charges-in-payout
@jaunty bolt yes i tried
curl --location -g --request GET 'https://api.stripe.com/v1/balance_transactions?payout=po_1KOwHLQbfl7QxFrMqDVC4Dvh#balance_transaction_list-payout&expand[data.source]' \
could help to check anything wrong?
Could you share the request ID (req_xxx)?
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_...)
Thanks for the info, I'm having a look.
I'm sorry but I need to step out. My colleague ynnoj will have a look soon.
Hey @sharp sparrow ! Just catching up here. Can you share that py_xxx ID please?
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?
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?
Who is we in this instance? The platform?
What kind of charges are you using?
what do u mean what kind of charges?
we are using destination-charges
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?
i want to link the payout to the pi_xxx
so that we know what payment intent is being paid out for a payoutid
Right, but you don't want objects relating to refunds etc (which is what that object is in the screenshot above ☝️ ) object: 'refund'
i want the refund also. Basically we want to a way to map the py_xxx to pi_xxx
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]
i just tried but got this error
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
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
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)?
Let me test
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
Did it work?