#whizyyy-customer-search
1 messages · Page 1 of 1 (latest)
Hello! I assume you want to use the Search API? I'd recommend looking at https://stripe.com/docs/search#metadata and https://stripe.com/docs/search#charges-metadata-search for examples on how to do this
Let me give it a try
@hot mantle nice it is working! However it appear that the Customer object have subscriptions field to null, but on my dashboard the customer have active subscriptions, why that?
subscriptions on the Customer (https://stripe.com/docs/api/customers/object#customer_object-subscriptions) is an expandable field and will be null by default if you don't expand it (https://stripe.com/docs/expand)
@sullen kelp we do recommend using https://stripe.com/docs/api/subscriptions/list instead
whizyyy-customer-search
Oh really?
This way actually work. I would like to check if a customer retrieved by my custom metadata has a specific subscriptions and if so, get the quantity, which way do you recommend the most for this?
the way @hot mantle mentioned works. I'd personally recommend caching all of this in your database
I am actually caching it
then you shouldn't need to hit our API to know if they have a Subscription
I prefer to fetch your API when my application boot to be sure I didnt missed any of your webhook that could false the subscriptions data. Is this a wrong way to use Stripe?
I would say yes, it's not a great design since it requires you re-ingesting all data all the time. It's not bad, but as you grow/scale you will hit potential issues with rate limits overall
Well, I will reconsider the way I'm managing this, thanks for your fast support
happy to help 🙂