#bkrnetic-search
1 messages ยท Page 1 of 1 (latest)
Hi there!
What do you mean by "I don't have search option"? This should be available.
This
Which version of stripe-php are you using? You need at least version 7.120.0 to use the search feature. https://github.com/stripe/stripe-php/blob/master/CHANGELOG.md#71200---2022-03-29
it might be that. I'm using "stripe/stripe-php": "^7.116"
so it is actually possible to use search method to fetch subscriptions by customer and multiple statuses?
Yes you can search subscriptions: https://stripe.com/docs/api/subscriptions/search
Let me test creating a query to check multiple status.
Yes it works! FYI here's my test: query: "status:'active' OR status:'canceled'"
thank you Soma!
Happy to help ๐
is it possible to pass other params usually used in all method? such as customer, expand etc?
Ok I can see it doesn't allow customer parameter. Hm
Yup expand works it seems.
What I want to do is to fetch unpaid and canceled subscriptions by certain customer.
how would query for that look like?
query: "customer: 'customerId' AND (status:'active' OR status:'canceled')"
Maybe like that? I'm not sure if brackets are allowed.
Yeah you can't use customer as a query parameter: https://stripe.com/docs/search#query-fields-for-subscriptions
And you can't pass the customer parameter to the Search endpoint
Hmm, ok then. You might consider adding it as an option in the next release ๐
I'll relay the feedback!
Thanks ynnoj. Have a nice day!
you 2!