Customer REST API, query:state:enabled not working?

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?

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!