A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hey,
Trying to retrieve a list of all "enabled" customers using the REST API.
The API docs imply that I should be able to query the API to return on the accounts where the state = "enabled"
"/admin/api/2021-01/customers.json?query=state:enabled"
However, the results returned are unfiltered and are returning all accounts.
Does anyone know if this is broken, or a suitable work-around where I don't have to fetch ALL customers and filter them manually?
Solved! Go to the solution
This is an accepted solution.
What happens when you modify the URI to end with /customers.json?state=enabled instead?
This is an accepted solution.
What happens when you modify the URI to end with /customers.json?state=enabled instead?
🤦 That works!
Thank you - I'm happy I've got it working, but sad the docs aren't accurate.
The query parameter format you were using looks more along the lines of how it's used in the GraphQL API. The REST API is more straightforward in how it just uses the more traditional ?thisField=thisValue&thisOtherField=thisOtherValue. Glad it's working for you!