#Vespasiano
1 messages ยท Page 1 of 1 (latest)
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 + '',
});`
This worked for me:
"active:'true' AND metadata['product']:'" + req.body.productId + "'"
"object": "search_result",
"data": [],
"hasMore": false,
"nextPage": null,
"url": "/v1/prices/search"
thats the response
prod_MtZk2BQF2lcFaH
those are the prices
Nothing. Can't get results.
I get this response
So this time you don't get an error, so we are making progress.
Give me a few moments to look into this.
Can you share a product ID that you think should be returned in the results?
I think I'm reading the docs wrong
What I'm trying to achieve is to get all the prices from a specific product ID
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.
I use this product ID: prod_MtZk2BQF2lcFaH
I expect a few prices: like this: price_1M9mbPEn5mGXCpVKFd5ra26a
This price has no metadata set.
If you are just trying to list all prices for a specific product ID, you can use this endpoint instead: https://stripe.com/docs/api/prices/list
oh
alright ahah
now it works!
Thank you very much! Is there a way I can give you a review?
Have a nice day!