#qmathe
1 messages · Page 1 of 1 (latest)
Hi
Is it possible to list payouts for all connected accounts with a single call and without knowing their account IDs?
Nope. You need to specify the AccountId one by one.
When I don't include a stripe account in the request options, it seems I only retrieve payouts for the platform Stripe account.
Correct.
You can create a script that lists all your connected Accounts:
https://stripe.com/docs/api/accounts/list
And for each account you list their payouts.
ok, I see.
Just going to explain what I'm trying to do, so you might have another solution to suggest.
I'm recording payouts I received through Stripe Connect webhook inside a database. I was planning to implement a function that runs at regular interval to ensure no payout is missing in the database due to a lost event. The solution I was envisioning was to start from the last validated payout in my database and then compare my latest stored payouts against a list returned by Stripe.
How would you solve this? If I have to check every connected account every time, it's probably not going to scale well.
As the reference will be the Stripe resources. I think you should better, start by listing all accounts => foreach account you fetch their Payouts => foreach payout you make a getById to your database => if payout exists => ok; else create the missing record in your database
ok, thanks for the suggestion. I was hoping for another way to do this, but I now understand that I cannot avoid to get through every connected account, in order to retrieve the payouts.