#Vespasiano

1 messages ยท Page 1 of 1 (latest)

lusty hollowBOT
raven junco
#

Hi there!

#

What's your issue?

rocky anchor
#

Hello! Thats the error:

Error: Ensure you have properly quoted values while searching. Try updating your query tometadata["product"]:"prod_LCLKvyF1JJpsqr" at line 1 and column 39."

That's my code:
` const prices = await stripe.prices.search({
query: 'active:'true' AND metadata['product']:' + req.body.productId + '',

    });`
raven junco
#

This worked for me:

"active:'true' AND metadata['product']:'" + req.body.productId + "'"

rocky anchor
#

"object": "search_result",
"data": [],
"hasMore": false,
"nextPage": null,
"url": "/v1/prices/search"

#

thats the response

#

prod_MtZk2BQF2lcFaH

#

those are the prices

rocky anchor
raven junco
#

So this time you don't get an error, so we are making progress.

#

Give me a few moments to look into this.

raven junco
#

Can you share a product ID that you think should be returned in the results?

rocky anchor
#

What I'm trying to achieve is to get all the prices from a specific product ID

raven junco
#

You are right. So can you share a price ID that should match your query?

#

Your query is currently asking:

  • Get all the prices that are active and has some metadata set. So I want to make sure you actually set the metadata on the price.
rocky anchor
raven junco
#

This price has no metadata set.

rocky anchor
#

oh

#

alright ahah

#

now it works!

#

Thank you very much! Is there a way I can give you a review?

raven junco
#

Happy to help ๐Ÿ™‚

#

Thanks, but no need for a review ๐Ÿ™‚

rocky anchor
#

Have a nice day!