How can I get the billing_address 'id' field from a call to get Orders?
When I pull Orders from Shopify API, like so
The order.billing_address data returned does not contain the 'id' field.
However when I pull the same address down via Customers, like so
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.
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.
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?