#emenike-connect-external-account
1 messages · Page 1 of 1 (latest)
The external account is on the connected account. But you are creating the Payout on the platform so it won't work
You're forgetting to pass the connected account's id into the call as documented in https://stripe.com/docs/connect/authentication#authentication-via-the-stripe-account-header
what do you mean by creating the payout on the platform?
const payout = await stripe.payouts.create({
amount: 20,
currency: 'usd',
method: 'instant',
destination: cardID,
source_type: 'card',
});
add conencted ID as a aramter?
^^
The code you have here is using your own API key (the platform) to create a Payout to your own bank account or debit card with your own balance
that's not what you want though. That card_12345 is on a connected account, you want to use the balance of the connected account and send their funds to their debit card
but the code you wrote never said that.
The way you fix it is by telling our API that you are platform A and doing a call on behalf of your connected account acct_ABC
OH I see where is exacctly is that code I am having trouble finding it
this is done by doing exactly what is on https://stripe.com/docs/connect/authentication#authentication-via-the-stripe-account-header
@vital mason did you figure it out?
Thank you for replying back to me. I am currently trying to do it now. Getting a few errors. DO I need to pass in the stripe account as a paramter instead
or initlize stripe with the connected account
var stripe = Stripe('{{PLATFORM_PUBLISHABLE_KEY}}', {
stripeAccount: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
});
as such ^^
i am just trying to do a payout directly to a card
hmmm
you're mixing things up here
you read the client-side example, Payouts are created server-side with a Secret API key
const payout = await stripe.payouts.create(
{
amount: 20,
currency: 'usd',
method: 'instant',
destination: cardID,
source_type: 'card',
},
{
stripe_account: 'acct_123',
}
);```
will imlement now thank you
sure!
this was my error
{
success: 'failed',
error: 'Cannot create payouts: this account has requirements that need to be collected.. Please provide those fields to re-enable payouts.'
}
question: do you need to complete the onbiarding process in order to do payouts.
yes, otherwise you'd just get money and never provide the information