Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!