Buddha's Mind
Buddha's Mind

Reputation: 31

How can I get total amount of payouts for a stripe connect account?

Is there a way to get the total amount of payouts for each stripe connect account?

I mean amount for the payouts which still in transit to bank. not the completed ones.

On stripe dashboard, I can confirm that amount for each connect account, but im not sure how I can get that amount on my app by using the API.

Upvotes: 2

Views: 561

Answers (2)

Yuki Asano
Yuki Asano

Reputation: 31

I believe you have to specify the connected account id and external account id when you retrieve connected account's payout list.

Stripe::Payout.list({destination: external_account_id}, {stripe_account: connected_account_id})

When you retrieve specific one payout, like below.

Good:

Stripe::Payout.retrieve('po_**********', {stripe_account: 'acct_**********'})

Bad:

Stripe::Payout.retrieve('po_**********')

Upvotes: 3

korben
korben

Reputation: 1146

If they're automatic payouts, you need to actually use webhooks and log this data locally so it can be retrieved. You'd listen for payout.created, payout.paid, payout.updated, payout.failed, and payout.cancelled events on a Connect Webhook Endpoint. When you received one, you'd note the amount in your database and access it from your app whenever you needed that information.

Upvotes: 0

Related Questions