#steven061609_api

1 messages · Page 1 of 1 (latest)

dire stratusBOT
#

👋 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/1234482975647993886

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

still fog
#

First call:
search is empty
create the user

Second call
search is empty
create the user again

wintry skiffBOT
runic trail
#

This is likely just a race condition and is a limitation of the Search API noted here:

Don’t use search for read-after-write flows (for example, searching immediately after a charge is made) because the data won’t be immediately available to search. Under normal operating conditions, data is searchable in under 1 minute. Propagation of new or updated data could be delayed during an outage.
https://docs.stripe.com/search#data-freshness

Look up objects in your Stripe data.

still fog
#

i see ! makes sense, what is the best way to have fresh data? because i could list the users and then find by metadata.user_id but that's not ideal

runic trail
#

If you're using a metadata field then that's the only option. Alternatively persist the cus_xxx ID you create in your database somewhere then you know that users exists in Stripe