Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

179
Vistas
create customer for stripe connected account node.js

I have this:

 const paymentMethod = await stripe.paymentMethods.create({
    type: 'card',
    card: {
      number: '4242424242424242',
      exp_month: 1,
      exp_year: 2024,
      cvc: '123',
    },
  });

  console.log(paymentMethod.id)
  const customer = await stripe.customers.create({
    payment_method: paymentMethod.id,
  });

what this does is creates a payment method and links it to the customer in which i create on the spot. However, I need to create the customer for a stripeAccount, instead of my own. I am also programmatically creating stripe accounts for my merchants, so now I want to link the customer i create to the specific merchant.

here's what I found you can do for paymentIntents, that I thought you may be able to do for stripe accounts, but it doesn't seem so:

const paymentIntent = await stripe.paymentIntents.create({
    amount: 2000,
    currency: 'usd',
    customer: customerid
  }, {
    stripeAccount: 'myaccount_id',
});

so how can i use stripeAccount within creation of customer?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use stripeAccount for any API request, it works the same way on all of them. There's an example directly in Stripe's documentation: https://stripe.com/docs/connect/authentication#stripe-account-header

const customer = await stripe.customers.create(
  {email: 'person@example.edu'},
  {stripeAccount: '{{CONNECTED_STRIPE_ACCOUNT_ID}}'}
);

As an aside, note also your integration seems a little wrong — you should never be calling stripe.paymentMethods.create with raw card details like that unless you want large PCI compliance headache(https://stripe.com/docs/security/guide#validating-pci-compliance under "API Direct"). You should use Stripe's frontends like Elements/Checkout.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda