Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

173
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda