Order with customer has null location_id.

Ludmila_Dokhnen
Shopify Partner
3 0 0

Hi, everyone!

I get paid order by API and see one thing: the orders without customer have location_id as default location but orders with selected customers have null location_id. Is it correct behaviour?

 

 

0 Likes
Zameer
Shopify Staff (Retired)
Shopify Staff (Retired)
295 32 76

Hey Ludmila,

Zameer here from the Shopify Developer Experience team.

As the documentation suggests, the `location_id` parameter is the ID of the physical location where the order was processed. It's value is independent of whether or not there is a customer associated with the order.

What's most likely the case is that you are retrieving a combination of orders that were created through the storefront and the API. When creating orders through the API, no `location_id` is required, which will result in a null value being returned on lookup. 

0 Likes
Ludmila_Dokhnen
Shopify Partner
3 0 0

Hi, Zameer !

I created both orders (with customer and without) in Admin Panel.

0 Likes
Zameer
Shopify Staff (Retired)
Shopify Staff (Retired)
295 32 76

In that case it sounds like you've found a bug in the system. I've been able to replicate it myself as well and have let our development team know about the issue.

I'll be sure to update you here once we have a fix implemented.

Thanks Ludmila!

0 Likes
nick_But
Shopify Expert
3 0 0

Hi,

 

Is this still an open issue or it has been fixed? Currently having similar issues with orders made from the shopify website.

0 Likes