3

I'm a bit embarrassed at posting this because I think I must be doing something really stupid, but seeing as I'm completely stuck, no choice.

My simple use case is:

  1. Grab orders through the SOAP API. The results include [billing_address_id] and [shipping_address_id], so far so good, no problems
  2. Then, I try to retrieve the address details using the [billing_address_id], as below

$custAddress = $this->soapClient->customerAddressInfo($this->session, $orderObj->billing_address_id);

However, the response I get is that the address doesn't exist? WTF?

Magento has just given me the address_id and then tells me it doesn't exist.

Any help VERY gratefully received, either on why this seemingly simple operation doesn't work and/or how to do it correctly.

Thanks

flarpy
  • 33
  • 2

1 Answers1

6

This is because you are trying to lookup a customer address using an address ID for an order address object. The order tables store addresses separately from actual customer addresses. The billing_address_id you're getting will match a row in your sales_flat_order_address table.

You can get the address details for the order from the order object directly:

$customAddress = $orderObj->billing_address;
Laura
  • 2,700
  • 2
  • 27
  • 52