#falkhe

1 messages · Page 1 of 1 (latest)

ruby skiffBOT
plucky pulsar
#

Hello

#

Generally you would use metadata for this

chilly mural
#

Are metadata sub-keys queryable?

plucky pulsar
#

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

chilly mural
#

This would require to store the Stripe ID within our Apps. Unfortunately this is not possible in some cases.

plucky pulsar
#

Not sure what you mean by that

#

Why do you have to store the object ID anywhere?

chilly mural
#

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 )

plucky pulsar
#

Right so you set the user-id as metadata on the Customer

#

Important to note though that the Search API is not meant for read-after-write flows

chilly mural
#

ah 💡 something like: query="metadata['app-xy-uuid']:'e422559e-6287-411e-84a4-5b750990af7c'"

plucky pulsar
#

Yes

chilly mural
#

should do the trick ... thanks