#birdboy-search-api

1 messages · Page 1 of 1 (latest)

silent stagBOT
astral zealot
#

Hi 👋 is there something specific that is giving you troubles?

vast sluice
#

I'm just not too sure how to set out the query section of the request.

astral zealot
#

Definitely understand, our Search API is still a bit newer and is structured slightly differently from the rest of our fields. query is expecting a string that contains the contents of your query. You can see some examples shown here:
https://stripe.com/docs/search#examples

Look up objects in your Stripe data.

#

birdboy-search-api

vast sluice
#

This is the response from using this code

#

the data object that is returned is empty

astral zealot
#

I believe that query is doing a substring match search for products with the name canvas (case insensitive), do you have any Products in your Stripe account that match that criteria?

vast sluice
astral zealot
#

Are you using your test API key to run the request? Could you share the ID of that request as well?

vast sluice
#

I've now got it working with this code but id like it to pass in the params from the getstaticpaths

astral zealot
#

It looks like you're setting variables with getStaticPaths, so I'd expect you would be able to reference those and use them to build your search query string.

vast sluice
#

since you have to use this formate 'name~"canvas"'

#

could you pass in the params in the spot of the canavs?

astral zealot
#

I'm not sure how exactly to do it in Next.js, but yes, most languages allow you to concatenate substrings into larger strings. You would need to build your query param string, and then pass that string into the request.

vast sluice
#

when using getStaticProps it uses regular node js

#

dont know if that helps

astral zealot
vast sluice
#

Thanks that really helped i've got it working would you like the fix?

astral zealot
#

Glad to hear you got it working!

vast sluice
#

did you want the fix for if you need to help anyone else with that same issue?

astral zealot
#

Thank you for the offer, but I think that's alright.

vast sluice
#

that's alright thanks for the help

astral zealot
#

Any time!