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

236
Views
retrieve all customers email address stripe node.js

I have this function that tries to retrieve all the customer's emails in stripe:

 const customers = await stripe.customers.list({
  });

    var customerEmail = customers.data[0].email;
    console.log(customerEmail)

I am trying to return all the email addresses of the users from stripe. the problem is, when I log it, it only returns the first one, due to teh fact that I have data[0]. I need all of them, but i can't put it in a loop because what am i looping through. is there any way to do this properly?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The data property you are indexing is an array you can iterate through[1].

const customers = await stripe.customers.list({});

customers.data.forEach(customer => {
  console.log(customer.email);
});

[1] https://stripe.com/docs/api/customers/list

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!