Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Module: Mage_Customer

Resource: customer_address

Method:

  • customer_address.list (SOAP V1)
  • customerAddressList (SOAP V2)

Retrieve the list of customer addresses.

Arguments:

TypeNameDescription
stringsessionIdSession ID
intcustomerIdCustomer ID

Returns:

TypeNameDescription
arrayresultArray of customerAddressEntity

The customerAddressEntity content is as follows:

TypeNameDescription
intcustomer_address_idID of the customer address
stringcreated_atDate when the address was created
stringupdated_atDate when the address was updated
stringincrement_idIncrement ID
stringcityCity
stringcompanyName of the company
stringcountry_idID of the country
stringfaxFax
stringfirstnameCustomer first name
stringlastnameCustomer last name
stringmiddlenameCustomer middle name
stringpostcodeCustomer postcode
stringprefixCustomer prefix
stringregionName of the region
intregion_idRegion ID
stringstreetName of the street
stringsuffixCustomer suffix
stringtelephoneTelephone number
booleanis_default_billingTrue if the address is the default one for billing
booleanis_default_shippingTrue if the address is the default one for shipping

Examples

Request Example SOAP V1
$client = new SoapClient('http://magentohost/api/soap/?wsdl');

// If somestuff requires API authentication,
// then get a session token
$session = $client->login('apiUser', 'apiKey');

$result = $client->call($session, 'customer_address.list', '2');
var_dump($result);

// If you don't need the session anymore
//$client->endSession($session);
Request Example SOAP V2
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy->login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

$result = $proxy->customerAddressList($sessionId, '2');
var_dump($result);
Request Example SOAP V2 (WS-I Compliance Mode)
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy->login((object)array('username' => 'apiUser', 'apiKey' => 'apiKey')); 
 
$result = $proxy->customerAddressList((object)array('sessionId' => $sessionId->result, 'customerId' => '2'));   
var_dump($result->result);
Response Example SOAP V1
array
  0 =>
    array
      'customer_address_id' => string '2' (length=1)
      'created_at' => string '2012-03-29 13:20:08' (length=19)
      'updated_at' => string '2012-03-29 13:39:29' (length=19)
      'city' => string 'Las Vegas' (length=9)
      'country_id' => string 'US' (length=2)
      'firstname' => string 'johny' (length=5)
      'lastname' => string 'doe' (length=3)
      'postcode' => string '89032' (length=5)
      'region' => string 'Nevada' (length=6)
      'region_id' => string '39' (length=2)
      'street' => string '3406 Hiney Road' (length=15)
      'telephone' => string '702-283-9556' (length=12)
      'is_default_billing' => boolean false
      'is_default_shipping' => boolean true
  1 =>
    array
      'customer_address_id' => string '3' (length=1)
      'created_at' => string '2012-03-29 13:39:29' (length=19)
      'updated_at' => string '2012-03-29 13:39:29' (length=19)
      'city' => string 'Corpus Christi' (length=14)
      'country_id' => string 'US' (length=2)
      'firstname' => string 'johny' (length=5)
      'lastname' => string 'doe' (length=3)
      'postcode' => string '78476' (length=5)
      'region' => string 'Texas' (length=5)
      'region_id' => string '57' (length=2)
      'street' => string '3672 Boone Street' (length=17)
      'telephone' => string '361-280-8488' (length=12)
      'vat_id' => string 'GB999 9999 73' (length=13)
      'is_default_billing' => boolean false
      'is_default_shipping' => boolean false

Table of contents