#joel-alcedo-node-account

1 messages ยท Page 1 of 1 (latest)

paper sorrel
#

Hi there!

timid cave
#

hello!

paper sorrel
#

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

Learn how to add the right information to your API calls so you can make calls for your connected accounts.

timid cave
#

taking a look now! one sec while i wrap my head around this ๐Ÿ˜„

paper sorrel
#

No rush!

timid cave
#

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?

Learn how Stripe account balances work when using Connect.

paper sorrel
#

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'});

timid cave
#

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

paper sorrel
#

Sounds good!

timid cave
#

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!

paper sorrel
#

Double check your platform key and make sure you are using the correct one for that Connected Account!

timid cave
#

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

paper sorrel
#

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

timid cave
#

oh i think i may have made a typo

paper sorrel
#

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

timid cave
#

๐Ÿ’€ javascript ๐Ÿ˜ฌ

#

thank you! looking now ๐Ÿ˜„

paper sorrel
#

๐Ÿ˜‚

timid cave
#

i got it!!!!