#nitin_61278
1 messages · Page 1 of 1 (latest)
Hello! You can use expansion to find the Charges in a Payout: https://stripe.com/docs/expand/use-cases#charges-in-payout
Would that work for your use case?
Is there any better solution
I would need to know more details, like why that's not a good solution for you, what you would consider better, etc.
We have payout ID and based on that we want to find tranfer ID for that payout
That's covered by the second part of the section I linked to, right?
Or am I misunderstanding what you're trying to do?
balance_transactions = Stripe::BalanceTransaction.list({
payout: 'po_1Gl3ZLLHughnNhxyDrOia0vI',
type: 'charge',
expand: ['data.source'],
})
No, the second one.
#<Stripe::BalanceTransaction:0x19564 id=txn_1OdMrKDWklh8LgDYeDKTL69u> JSON: {
"id": "txn_1OdMrKDWklh8LgDYeDKTL69u",
"object": "balance_transaction",
"amount": -42531,
"available_on": 1706486400,
"created": 1706404110,
"currency": "usd",
"description": "STRIPE PAYOUT",
"exchange_rate": null,
"fee": 0,
"fee_details": [
],
"net": -42531,
"reporting_category": "payout",
"source": "po_1OdMrKDWklh8LgDYpXBYGVDR",
"status": "available",
"type": "payout"
}
You're looking at the first part, look at the second part.
both are giving same output
What are you specifying for expand in the second version?
(undefined method `data' for #Stripe::BalanceTransaction:0x00007f957026b580)
(undefined method `data' for #Stripe::BalanceTransaction:0x00007f957026b580)
Stripe::BalanceTransaction.list({payout: payout.id,type: 'payment',expand: ['data.source.source_transfer.source_transaction']})
You need to also specify the connected account ID using stripe_account as shown in the example.
The request needs to be made on the connected account.
i have only payout object. how can i get account ID from that
Do you know what account this payout happens on?
If it's a connect webhook, it will contain the account ID: https://stripe.com/docs/api/events/object#event_object-account
Are you doing this on your Platform account?
What event type are you listening to.
payout.paid
Could you please share the Event ID evt_xxx?
evt_3OeNVJDWklh8LgDY1rgMDQVq
That's a charge.succeeded event on the Platform account.