I've gone through the docs and haven't been able to spot a way to query balance info for Stripe managed accounts. Here's the use case: a 3rd party sets up a managed account through my Stripe Connect enabled platform; I create some charge objects on their account after a few customers buy goods/services (so their balance is now positive); now they want a payout BUT I want to query their balance before issuing the transfer to ensure they're not asking for more than is in their account.
Surely I'm missing something obvious. Thanks in advance.
So for Ruby, based on Ywain's answer, I figured that instead of doing what's documented:
Stripe.api_key = CONNECTED_STRIPE_ACCOUNT_SK
Stripe::Balance.retrieve
a better way, that is not documented, is to do:
Stripe::Balance.retrieve(stripe_account: CONNECTED_STRIPE_ACCOUNT_ID)
as long as the current api_key is your platform account with the managed accounts option enabled.
PHP
\Stripe\Balance::retrieve([
'stripe_account' => CONNECTED_STRIPE_ACCOUNT_ID
]);
Python
stripe.Balance.retrieve(
stripe_account=CONNECTED_STRIPE_ACCOUNT_ID
)
Ruby
Stripe::Balance.retrieve(
:stripe_account => CONNECTED_STRIPE_ACCOUNT_ID
)
Node
stripe.balance.retrieve({
stripe_account: CONNECTED_STRIPE_ACCOUNT_ID
}, function(err, charge) {});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With