0

I'm using Magento version 1.9, and i'm trying to get all my customers, via the REST API.

That is working fine. But i also need the phone number for each customer, and then have to make a seperate API call, per customer, to get their address, and extract the phonenumber from that address.

Is there a way to either get the phone number, or their address, in the same call, that gets the list of customers? Maybe with a parameter.

0

You would need to be able to query two separate endpoints (for customer and customer address) in the same request in order to that and because of the the REST is designed, that is impossible.

If you really want to get both the customer and customer address in one REST call, you will need to create a new module which exposes a new API endpoint which offers this feature.

That is way beyond the scope of this answer though. There are plenty of resources on the web to tell you how to create a new module and how to add your own API endpoints.

0

Dunno for M1,I'm working with REST API in M2 and just calling

GET /customers/search?searchCriteria=''

returns all customer's details, along with all their addresses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.