location_id is coming as null for orders

location_id is coming as null for orders

OriginScale
Visitor
3 0 1

Hello Shopify Team,

We are facing one issue while calling shopify order API (/admin/api/2021-04/orders.json) where some (old) orders are populated with location_id whereas some (new) orders location_id are coming as null.

Can you please help us in identifying the root causes why in some orders location_id is coming as null.

For your reference, please find attached API response.

Looking forward your quick response for this request.

Thanks,
Atul

Reply 1 (1)

CalD
Shopify Staff
140 22 36

Hey @OriginScale,

Take a look at the Order API docs: https://shopify.dev/docs/admin-api/rest/reference/orders/order

"location_id": 49202758
The ID of the physical location where the order was processed. This property refers to the POS location. location_id will always be set to null for online orders. If you need to reference the location against an order, then use the FulfillmentOrder resource. 

CalD | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog