#brotzka_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1375097006166380646
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I want to get all payments/charges that are included in a balance_transaction.
Can you explain a bit more context here?
Each payment will produce a balance transaction adding to your balance
Do you mean included in a payout to your bank account?
Sure! I have ethis payout (po_1RJOSqDuIkt4M6OWp3AWH8LU). This payout is directly related to a BalanceTransaction (txn_1RJOSrDuIkt4M6OWDPXQ1TYm). This BalanceTransaction has multiple charges related to it. Given a specific BalanceTransaction I need all related charges.
Yes, in a payout! ๐
Gotcha, so with the caveat that this is only possible with automatic payouts (not manual), what you want to do is List balance transactions filtered by that payout ID: https://docs.stripe.com/api/balance_transactions/list#balance_transaction_list-payout
this gets your all the BTs rolled up into that payout
then you can used expansion to get the corresponding charge/payment details from the source
You can see an example of this in each server language here: https://docs.stripe.com/expand/use-cases#charges-in-payout
Thank you. Let me have a quick look at it
Perfect! So the workflow would be
- get all payouts from desired date range
- loop through payouts and
- get all balance transactions with the specific payout id
Yep! (plus expand to get the source payment info)
Yes. All right. Thank you! I think that is enough for now ๐