'Retrieve the balance for a Stripe Connect connected account?

How can the balance on a connected account be retreieved? (e.g. a connected account is like the 'host' in the Airbnb example).

I checked the balances docs, and hoped there'd be something like:

stripe_account = 'acct_lsdkjflsdkjflkj'
Stripe::Balance.retrieve(stripe_account)

but the docs only show how to get the balance for the platform's account, rather than that of a connected account.

I also tried Stripe::Account.retrieve('acct_lsdkjflsdkjflkj') but that returns info about the account but the not balance.



Solution 1:[1]

You would want to use the Stripe-Account header [0] to make API requests for connected accounts.

Example

$balance = Stripe::Balance.retrieve({stripe_account: 'acct_...'})

[0] https://stripe.com/docs/connect/authentication

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 alex