Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

API: Custom Address Retrieval
 
punkstar
Jr. Member
 
Avatar
Total Posts:  27
Joined:  2008-07-14
Bath, UK
 

Hi.

I’m using the API to get a list of all of the orders, along with the customer’s shipping address.  To do this I am calling “sales_order.list” initially to get a list of all the orders, and then I am calling “customer_address.info” on the “shipping_address_id” that I am getting back.

The problem is that I don’t appear to be getting the correct address id, to be used in the second API call, back from Magento.  For a start, the billing and the shipping addresses are the same, but they are giving me different ids for them, 13 and 14 instead of 1.

Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
punkstar
Jr. Member
 
Avatar
Total Posts:  27
Joined:  2008-07-14
Bath, UK
 

Bump.

Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
dniesen
Member
 
Total Posts:  74
Joined:  2008-04-05
 

I’ve been battling with this myself.  I can’t seem to figure out how to pull the right address based on the billing_address_id from a sales order (or the shipping_address_id) for that matter.

Is the table that these are pulling from not directly built into the API yet?

 
Magento Community Magento Community
Magento Community
Magento Community
 
antcommerce
Jr. Member
 
Total Posts:  19
Joined:  2008-05-06
the Netherlands
 

I just implemented something as follows, seems to give the results asked:

1. call sales_order.list => gives you increment_id for each order
2. call sales_order.info using the increment_id
3. the result from sales_order.info contains Arrays with billing & shipping address

(The bill/ship addresses are stored together with the order, and are not a reference to customer data. This preserves the information over time, even if the customer updates his/her address.)

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jonathan123
Sr. Member
 
Total Posts:  215
Joined:  2008-09-14
 

Yeah, this has caused some problems for me as well. I’d like to be able to update an address via the API, but it doesn’t seem possible to do so. Ideally I’d like to be able to change a customer or guest address… but neither of these seem possible given just the address_id.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top