#AlessandroMontanari
1 messages · Page 1 of 1 (latest)
Hi 👋
Can you share the syntax you are using? As we point out here: https://stripe.com/docs/api/subscriptions/search you need to pass the string in as the query parameter.
For listing:
const { data } = await stripe.subscriptions.list({
limit: 1
})
For search:
const { data } = await stripe.subscriptions.search({
limit: 10,
query: `status:"trialing"`
})
Try it without the quotes. status is an enum, rather than a string so it might behave differently.
Without string it responds Ensure you have properly quoted values while searching. Try updating your query to status:"trialing" at line 1 and column 8.
*withouth quotes
const { data } = await stripe.subscriptions.search({
limit: 10,
query: `status:trialing`
})
Okay, thank you. This does seem like it should work. Let me test some things.
Quick question, what do you get when you use the status parameter in the Subscription list endpoint?
With
const { data } = await stripe.subscriptions.list({
limit: 1,
status: "trialing"
})
it returns the correct value, at least 1 subscription with { status: "trialing" }
That is frustrating. I would expect the same behavior between the two. Can you do me a favor and share the request IDs for the requests for both Search and List?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Retrying with the same code now works...
🤔
The subscription that I'm searching was created at 17:24
Can be linked to this problem?
So you are using the Search feature and it is now returning the correct results?
Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages.
It is likely a data propagation issue. Above is what our docs say about it
caught the problem. Thank you very much, I'll move on to using the listing at this point