Search code examples
magentomagento-soap-api

Wrong Arguments in customer_address.update SOAP v1 CALL


I have a doubt, i did not find information about it in the internet. In the customer_address.update SOAP V1 call, the soap api documentation (http://www.magentocommerce.com/api/soap/customer/customerAddress/customer_address.update.html) states that one of the arguments is:

Type - array name - addressdata Description - Array of customerAddressEntityCreate.

And the example uses an array with addressId and addressData:

$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);

However, in my magento instance(i’m using community edition v.1.7.0.2) i get number 101 Customer not exists soap fault.

Edited: I changed the attribute from addressId to customerId and it worked. I believe customerId is the right attribute to use. I do not know if i’m right, nor if the documentation is outdated or wrong. Am i right?


Solution

  • Thanks for answering JoshBelke. The customer_address.update really need an addressId as you pointed out. I wanted to replicate addresses in a remote magento instance. I discovered that when you create an address in a remote instance of magento with the info of a local instance, it will probably create an addressId different from the local addressId, and to update the remote address later you will need to know the remote addressId, which I was not storing anywhere. To resolve this we made a complex solution, we created a field in the remote address with the id of the corresponding local address, so we search for the address with the addressId corresponding to the local one and update that address.