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

146
Visualizações
retrieve subscription by email stripe node.js

I want to access a subcsription, to see if the status is active.

I have this:

    const subscription = await stripe.subscriptions.retrieve({
    email: 'contact@Inderatech.com',
  });
  res.send(subscription)

however, it doesn't let me do it like this. On the stripe docs, it says to do it like this:

const subscription = await stripe.subscriptions.retrieve(
    'sub_icsb2'
  );

but i won't have the subscription id unless i grab it using the customer email. So is this possible?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The API only supports retrieving an object by their id. So when you want to retrieve a Subscription you need its identifier, the sub_123.

It is not possible to retrieve a Subscription by another property today and it applies to all APIs. There are List APIs that you can use to filter specific objects. For example when you list subscriptions you can filter them for a specific Price via the price parameter.

Today, the subscription doesn't have an "email" property so there isn't a way to list subscriptions for a specific email. Usually what you want is to first find the customer(s) that have a specific email address via the email parameter and then you can list subscriptions for that specific customer via the customer parameter.

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