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

82
Visualizações
Retrieve all products with same metadata value in Stripe

In Stripe (using Next.js and Node.js), I'm trying to retrieve all products with the same key-value pair in their metadata:

example: retrieve all products with metadata: {category: 'foo'}

In attempts to render category-specific pages, I don't want to list and parse through my whole catalog but I also know that products can only be retrieved through id (docs), inferring that I would have to:

list all products 
for all products:
  if metadata matches, 
    add id to array
for id array:
  retrieve each

This is brute forcing though, and not a good idea.

What would be the best way to retrieve conditionally based on metadata?

Any help is appreciated.

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

0

Stripe’s API currently doesn’t support querying Products using metadata. You’d have to retrieve all Products and filter through them. Stripe does have a Search API [2] which is currently in Beta so you might want to write in to see if you qualify.

If you happen to keep a track of Products server-side in a database, you could add an additional column for category. You can query your database by category to find those specific Products and then include just those Product IDs using the ids [2] parameter when you retrieve them through Stripe.

[1] https://stripe.com/docs/search-api

[2] https://stripe.com/docs/api/products/list#list_products-ids

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