#sneak-jackson_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1230153862975852544
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I believe you can use the search API with number field for this
https://docs.stripe.com/api/invoices/search
https://docs.stripe.com/search#query-fields-for-invoices
I believe I tried this, so maybe I messed up structuring the query? Can you tell me if this is the correct way to structure the code:
const invoices = await stripe.invoices.search({
query: 'number:XXXXXXXX-1234',
});
That looks fine ๐ค
What happens if you do
query: 'number:\'XXXXXXXX-1234\'',
});```
Having trouble with dropping this in because i was using string interpolation
{query: number:${invoiceNumber} }
I'll tee up a test case with the number hardcoded
๐
ok this works with the back slashes!
and the extra quotes
I'm very confused about this syntax
I think I'm starting to get it, it's an escapement of another set of quotes
yeah for text values you'd need quotes
I'm surprised my string interpolation did not work
without quotes, it assumes a numeric value
I guess I just include extra quotes?
Oh
Well that makes sense
Sorry that was not clear to me at first when building this query. Thanks for showing me that!
I think I can get my interpolation to work...
All good! ๐ happy to help