header

Magento 1.x Software Support Notice

For Magento Commerce 1, Magento is providing software support through June 2020. Depending on your Magento Commerce 1 version, software support may include both quality fixes and security patches. Please review our Magento Software Lifecycle Policy to see how your version of Magento Commerce 1 is supported.

For Magento Open Source 1.5 to 1.9, Magento is providing software security patches through June 2020 to ensure those sites remain secure and compliant. Visit our information page for more details about our software maintenance policy and other considerations for your business.

Address Info

Module: Mage_Customer

Resource: customer_address

Method:

Retrieve information about the required customer address.

Arguments:

Type Name Description
string sessionId Session ID
int addressId Address ID

Returns:

Type Name Description
array info Array of customerAddressEntityItem

The customerAddressEntityItem content is as follows:

Type Name Description
int customer_address_id
ID of the customer address
string created_at
Date when the address was created
string updated_at
Date when the address was updated
string increment_id
Increment ID
string city
name of the city
string company
Name of the company
string country_id
ID of the country
string fax
Fax
string firstname
Customer first name
string lastname
Customer last name
string middlename
Customer middle name
string postcode
Customer postcode
string prefix
Customer prefix
string region
Name of the region
int region_id
Region ID
string street
Name of the street
string suffix
Customer suffix
string telephone
Telephone number
boolean is_default_billing
True if the address is the default one for billing
boolean is_default_shipping
True 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.info', '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->customerAddressInfo($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->customerAddressInfo((object)array('sessionId' => $sessionId->result, 'addressId' => '2'));   
var_dump($result->result);
Response Example SOAP V1
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:20:08' (length=19)
  'increment_id' => null
  'city' => string 'Las Vegas' (length=9)
  'company' => null
  'country_id' => string 'US' (length=2)
  'fax' => null
  'firstname' => string 'johny' (length=5)
  'lastname' => string 'doe' (length=3)
  'middlename' => null
  'postcode' => string '89032' (length=5)
  'prefix' => null
  'region' => string 'Nevada' (length=6)
  'region_id' => string '39' (length=2)
  'street' => string '3406 Hiney Road' (length=15)
  'suffix' => null
  'telephone' => string '702-283-9556' (length=12)
  'vat_id' => null
  'vat_is_valid' => null
  'vat_request_date' => null
  'vat_request_id' => null
  'vat_request_success' => null
  'is_default_billing' => boolean false
  'is_default_shipping' => boolean true