#joel-alcedo-node-account
1 messages ยท Page 1 of 1 (latest)
hello!
So retrieving an Account is a bit different from retrieving the balance of hte account. Retrieving the account itself is done on your platform so you pass the account ID as you are doing. But when retrieving the Balance, you are actually doing this on the Connected Account. For that, you need to use the Connected Account header as we show here: https://stripe.com/docs/connect/authentication
taking a look now! one sec while i wrap my head around this ๐
No rush!
i'm still a little confused about this, for example in this link https://stripe.com/docs/connect/account-balances the example given is
const balance = await stripe.balance.retrieve({
stripeAccount: '{{CONNECTED_STRIPE_ACCOUNT_ID}}'
});
how is that any different than the example i provided above?
if my function currently takes in just the connected account ID, what else do i need to add to make it work?
You are just passing the account ID, as opposed to the Stripe Account Header as an option. So instead of
await stripe.accounts.retrieve('acct_123');
you want:
await stripe.accounts.retrieve({stripeAccount: 'acct_123'});
i see. let me give that a try - could have sworn i did that for the balance.retrieve function and it didn't fire as i thought it should have but maybe there's something i overlooked...will circle back
Sounds good!
now i have a new error message ๐
provided key 'sk_test_*********************************************************************************************6ZmzcQ' does not have access to account '{{acct_1LcYDd2eGQuGn8Bo}}' (or that account does not exist). Application access may have been revoked.
looks like i'm getting closer, really appreciate your help!
Double check your platform key and make sure you are using the correct one for that Connected Account!
for my use case i have built a custom account creation flow, think of it like uber drivers having their own connected account that are separate from each others' but they are all created in the app through the drivers' onboarding process.
when you say, "double check your platform key" i've always been using the same secret key stored on my server...are you saying that each custom account has its own key that i should be using instead? if yes, i assume that is generated around the time the connected account is generated
Nope, should be the same secret key
But the only reason you should hit the above error is if you aren't using a secret key with access to that Connected Account
oh i think i may have made a typo
Meaning the platform isn't connected to that account or there is a typo
Yep
Sometimes folks have multiple platforms for testing and they mix up keys as well
So that is why I said to double check
๐
i got it!!!!
๐ฌ