#emenike-connect-external-account

1 messages · Page 1 of 1 (latest)

fair laurel
vital mason
#

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?

#

^^

fair laurel
#

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

vital mason
#

OH I see where is exacctly is that code I am having trouble finding it

fair laurel
fair laurel
#

@vital mason did you figure it out?

vital mason
#

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

fair laurel
#

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',
  }
);```
vital mason
#

will imlement now thank you

fair laurel
#

sure!

vital mason
#

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.

fair laurel
#

yes, otherwise you'd just get money and never provide the information