DEV Community

performautodev
performautodev

Posted on

NodeJS - Connected account is required to transfer money from stripe account to another stripe account?

This is my use case:

First, the user pay 100$ with react-stripe-checkout https://www.npmjs.com/package/react-stripe-checkout

I handle the logic on NodeJS server:

So! i want like this:

1- Create a charge (100$) to primary account stripe (A).

await stripe.charges.create({
amount: 100000, currency: 'USD', source: args.token,
});

Then i want to create a transfer of $30 to another stripe account

await stripe.paymentIntents.create({
payment_method_types: ['card'], amount: 3000, currency: 'USD', }, { stripe_account: 'acct_xxx ',
});

or

await stripe.transfers.create({
amount: 3000,
currency: 'USD',
destination: 'acct_XXX',
transfer_group: 'ORDER_95',
});

Like this is correct or is required activate the Connected account and i have to pay for that ?

So i have a *error: No such account: acct_xxx *

What is the best way to achieve it?

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more