#Peony
1 messages · Page 1 of 1 (latest)
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
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
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.
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
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?
I want to know the destination
const account = await stripe.accounts.retrieve(accountId);
It's the bank account or card ID, not the account ID.
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
Can you give me a request ID showing the failed request you're trying to get working? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
???
Are you able to get the request ID?
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.
How to get bank account?
const account = await stripe.accounts.retrieve(accountId);
destination: account.external_accounts.data[0].id
???
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?
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.
Okay, then you need to create a Payout on the connected account, not on your platform account.
yes
Use this approach to create the Payout on the connected account: https://stripe.com/docs/connect/authentication
const paymentIntent = await stripe.paymentIntents.create(
{
amount: 1000,
currency: 'usd',
automatic_payment_methods: {
enabled: true,
},
},
{
stripeAccount: '{{CONNECTED_ACCOUNT_ID}}',
}
);
is this correct?
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.
How can I change the setting as instant, not automatic_payment_methods
People want to payout instantly
???
Have a look here: https://stripe.com/docs/connect/instant-payouts