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

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

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 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