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

Module: Mage_Customer

Resource: customer_address

Method:

  • customer_address.update (SOAP V1)
  • customerAddressUpdate (SOAP V2)

Update address data of the required customer

Arguments:

TypeNameDescription
stringsessionIdSession ID
intaddressIdAddress ID
arrayaddressdataArray of customerAddressEntityCreate

Returns:

TypeDescription
booleanTrue if the customer address is updated

The customerAddressEntityCreate content is as follows:

TypeNameDescription
stringcityName of the city
stringcompanyName of the company
stringcountry_idCountry ID
stringfaxFax
stringfirstnameCustomer first name
stringlastnameCustomer last name
stringmiddlenameCustomer middle name
stringpostcodePostcode
stringprefixCustomer prefix
intregion_idID of the region
stringregionName of the region
ArrayOfStringstreetArray of streets
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.update',
array('addressId' => 8, 'addressdata' => array('firstname' => 'John', 'lastname' => 'Doe', 'street' => array('Street line 1', 'Streer line 2'), 'city' => 'Weaverville', 'country_id' => 'US', 'region' => 'Texas', 'region_id' => 3, 'postcode' => '96093', 'telephone' => '530-623-2513', 'is_default_billing' => TRUE, 'is_default_shipping' => FALSE)));
var_dump ($result);
Request Example SOAP V2
$client = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

// If some stuff requires API authentication,
// then get a session token
$session = $client->login('apiUser', 'apiKey');
$result = $client->customerAddressUpdate($session, '8', array('firstname' => 'John', 'lastname' => 'Doe', 'street' => array('Street line 1', 'Streer line 2'), 'city' => 'Weaverville', 'country_id' => 'US', 'region' => 'Texas', 'region_id' => 3, 'postcode' => '96093', 'telephone' => '530-623-2513', 'is_default_billing' => FALSE, 'is_default_shipping' => FALSE));

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->customerAddressUpdate((object)array('sessionId' => $sessionId->result, 'addressId' => '8', 'addressData' => ((object)array(
'firstname' => 'John', 
'lastname' => 'Doe', 
'street' => array('Street line 1', 'Streer line 2'), 
'city' => 'Weaverville', 
'country_id' => 'US', 
'region' => 'Texas', 
'region_id' => 3, 
'postcode' => '96093', 
'telephone' => '530-623-2513', 
'is_default_billing' => TRUE, 
'is_default_shipping' => TRUE
))));   
var_dump($result->result);

Table of contents