#falkhe
1 messages · Page 1 of 1 (latest)
Are metadata sub-keys queryable?
With the Search API yes. But mostly the recommended route is to set metadata with your own UUID and then ingest the Stripe data into your database based on that UUID that comes through your Webhook handler
This would require to store the Stripe ID within our Apps. Unfortunately this is not possible in some cases.
When I create an invoice via API, I need to assign it to a customer. Therefor I need the Customer ID. But inside the app I only have the apps user-id. Now i need to find the right Stripe Customer for my App User.
( to look up via email is not a good choice, as this might change over time )
Right so you set the user-id as metadata on the Customer
Then, if you aren't going to store this in your own database (which isn't recommended but up to you) you can use the Search API (https://stripe.com/docs/api/customers/search) to Search the Customer based on that metadata
Important to note though that the Search API is not meant for read-after-write flows
ah 💡 something like: query="metadata['app-xy-uuid']:'e422559e-6287-411e-84a4-5b750990af7c'"
Yes
should do the trick ... thanks