Get all address of a customer using rest Magento2

2.5k Views Asked by At

How to get all addresses of a customer using rest Magento2? Is there any out of the box API?

1

There are 1 best solutions below

4
sissy On BEST ANSWER

Yes there is, given you have the customer ID:

GET /V1/customers/{customerId}

this will return all the customer addresses

"customer": 
{
  "id": 0,
  "default_billing": "string",
  "default_shipping": "string",
  "addresses": [
    {
      "id": 0,
      "customer_id": 0,
      "region": {
        "region_code": "string",
        "region": "string",
        "region_id": 0,
        "extension_attributes": {}
      },
      "region_id": 0,
      "country_id": "string",
      "street": [
        "string"
      ]
    }
  ]
}