#Peony

1 messages · Page 1 of 1 (latest)

tired adderBOT
stable cosmos
#

Hello! I wish I could help, but this chat is focused on developers and technical questions. Our support team will be able to assist you with payout questions better than I can: https://support.stripe.com/contact/email

valid narwhal
#

const payout = await stripe.payouts.create({
amount: 10000, // Specify the payout amount
currency: 'usd', // Replace with your preferred currency
method: 'standard', // Use 'standard' or 'instant' depending on your needs
destination: accountId, // Use the account ID as the destination
});

#

Is this code correct?
I think destinatiin is incorrect

#

Please answer

stable cosmos
#

When creating a Payout via the API the destination is the bank account or card ID where the funds should go, the one linked to the Stripe account for payouts.

valid narwhal
#

const accountId = req.query.accountId; // Pass accountId as a query parameter
// const amount = req.query.amount; // Pass the payout amount as a query parameter
const account = await stripe.accounts.retrieve(accountId);
try {
// Create a payout to the bank account
const payout = await stripe.payouts.create({
amount: amount, // Specify the payout amount
currency: 'usd', // Replace with your preferred currency
method: 'standard', // You can change the payout method
destination: account.default_external_account, // Use the account ID as the destination
});

// Log the payout information
console.log('Payout successful:', payout);

res.status(200).send('Payout successful');

} catch (error) {
console.error('Error:', error);
res.status(500).send('Payout failed');
}

#

is it right?

#

destination: account.default_external_account

stable cosmos
#

I can't review all of your code. Can you ask a more specific question? Like are you trying to do this and getting an error?

valid narwhal
#

I want to know the destination

#

const account = await stripe.accounts.retrieve(accountId);

stable cosmos
#

It's the bank account or card ID, not the account ID.

valid narwhal
#

const payout = await stripe.payouts.create({
amount: amount, // Specify the payout amount
currency: 'usd', // Replace with your preferred currency
method: 'standard', // You can change the payout method
destination: account.default_external_account, // Use the account ID as the destination
});

#

destination: account.external_accounts.data[0].id

#

Which is correct of these destinations?

#

destination: account.default_external_account,
destination: account.external_accounts.data[0].id

stable cosmos
valid narwhal
#

???

stable cosmos
#

Are you able to get the request ID?

valid narwhal
#

req_Fc7OkckF0urVn0

#

this is request ID

stable cosmos
#

In that request you're specifying a connected account ID as the destination. That will not work. It needs to be a bank account or card ID.

valid narwhal
#

How to get bank account?

#

const account = await stripe.accounts.retrieve(accountId);
destination: account.external_accounts.data[0].id

#

???

stable cosmos
#

It seems like you're trying to take funds on your platform account and pay them out to a connected account, not one of your own external bank accounts. Is that correct?

valid narwhal
#

Correct

#

I am going to pay them out to a connected account

stable cosmos
#

It doesn't work that way. You need to first transfer the funds to the connected account. Then, once the funds are available in the connected account's balance, they can be paid out to the external account connected to that connected account.

valid narwhal
#

I already transfered

#

Please conside this image

stable cosmos
#

Okay, then you need to create a Payout on the connected account, not on your platform account.

valid narwhal
#

yes

stable cosmos
valid narwhal
#

const paymentIntent = await stripe.paymentIntents.create(
{
amount: 1000,
currency: 'usd',
automatic_payment_methods: {
enabled: true,
},
},
{
stripeAccount: '{{CONNECTED_ACCOUNT_ID}}',
}
);

#

is this correct?

stable cosmos
#

Again, I can't review all your code. The best way to know if that works is to run it in test mode and see if it does what you want or not.

#

I will say that's to create a Payment Intent, which has ~nothing to do with what you're trying to do.

#

Please read the entire page, top to bottom, that I sent you.

valid narwhal
#

How can I change the setting as instant, not automatic_payment_methods

#

People want to payout instantly

#

???

stable cosmos