#AlessandroMontanari

1 messages · Page 1 of 1 (latest)

lilac badgerBOT
brazen solar
neon star
#

For listing:

    const { data } = await stripe.subscriptions.list({
        limit: 1
    })
#

For search:

    const { data } = await stripe.subscriptions.search({
        limit: 10,
        query: `status:"trialing"`
    })
brazen solar
#

Try it without the quotes. status is an enum, rather than a string so it might behave differently.

neon star
#

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`
    })
brazen solar
#

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?

neon star
#

With

    const { data } = await stripe.subscriptions.list({
        limit: 1,
        status: "trialing"
    })

it returns the correct value, at least 1 subscription with { status: "trialing" }

brazen solar
neon star
#

Retrying with the same code now works...

brazen solar
#

🤔

neon star
#

The subscription that I'm searching was created at 17:24

#

Can be linked to this problem?

brazen solar
#

So you are using the Search feature and it is now returning the correct results?

neon star
#

the problem seems to have disappeared

#

yes

brazen solar
#

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

neon star
#

caught the problem. Thank you very much, I'll move on to using the listing at this point