API get Orders, Billing_Address does not contain id

Highlighted
Shopify Partner
5 0 0

Hello,

How can I get the billing_address 'id' field from a call to get Orders?

When I pull Orders from Shopify API, like so

     admin/orders.json?id=X

The order.billing_address data returned does not contain the 'id' field.

However when I pull the same address down via Customers, like so

    admin/customers.json?id=X

The customer.address data does contain the 'id' field.

I'm building a relational data model to store shopify data, and I would like to use the Shopify Ids to keep the data in sync.

Thanks for any and all help.

-dvlink

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1129 82 185

Hey David, 

I think the closest that you'll be able to get to what you'd like is using the Customer API separately from Orders to try to cross-reference and match up addresses and get an ID.

Currently on an order, the billing and shipping address IDs are unique each time - so even if we did serialize the ID in the order object I don't think there would be any value in it. The only place you'd find a consistent ID would be on the customer. 

To clarify - a customer could place two different orders on one shop with the same address, and you'd end up with two different address IDs. 

0 Likes
Highlighted
Shopify Partner
5 0 0

Thanks Josh for your reposonse.   

The Shopify APIs are great!   They are very consistant, very reliable and they are fast.  Thank you!

In the end - I'm matching to existing order addresses, using these fields:

        match_columns = ['tenant_id', 'first_name', 'last_name', 'address1',
                         'address2', 'city', 'province_id', 'zip',
                         'country_id']
        a, u, id = DataLoader('addresses')._addOrUpdate(address, match_columns)

I love that you provide long and lat data on each address.

I'm curious why you create separate records for each address, if the same address already exists in the system?

Thanks

0 Likes
Highlighted
New Member
2 0 0

can i know what language are you using ??

0 Likes