Hi,
I'd like to get the profile of a customer from their email address.
The REST API doc says I can do this:
GET http://magentohost/api/rest/customers |
Is it possible to use filters to get the customer using the email? For instance something like this:
GET http://magentohost/api/rest/customers?email=name@company.com |
Thanks!
Yes, I think you can.
in http://devdocs.magento.com/swagger/index_20.html#/
go to:
customerCustomerRepositoryV1
and use:
GET /V1/customers/search
This retrieve customers with match a specified criteria.
For criteria parameters, you should use:
searchCriteria[filtergroups][][filters][][field] - > Name of the field (in your case 'email')
searchCriteria[filtergroups][][filters][][value] - > Name of the field (in your case 'mail@domain.com') - > field value
searchCriteria[filtergroups][][filters][][conditiontype] - > Name of the field (in your case 'eq') - > equals
The code depends on if you are using PHP, C# or ASP.NET...
Good Luck!