Get orders (sales) by location, find out wheter the store is configured for multi-location inventory

Highlighted
Shopify Partner
6 0 0

Hi. Got several questions

 

1. How can I make an api call and get the orders if the products are fulfilling from particular location?

2. How can I find out that the user has or has not configured his store to track inventory by multiple locations?

3. Is it possible to have 2 locations where inventory tracked by location and 1 location that is getting the inventory from 'master' location (like it was before when Shopify didnt have multiple locations)

 

Thanks!

0 Likes
Shopify Staff
Shopify Staff
619 76 139

Hi @simplerfid,

 

If you're making an API call to get all orders that need fulfillment by a particular locations, there's 2 ways you can do it. Using our REST API, you'll need to pull all orders and filter through to check flfillment location. The rest API doesn't offer an option to filter the call based on fulfillment location, so you'll need to get everything. If you're using our GraphQL API, you can make a call to get only orders from a particular location. You can query orders and use the lineItemConnectiion to access the location_id of items on the order.

 

To find out if a store is using multi-location inventory, you can query the shop object and look for the multi_location_enabled (true/false).

 

With regards to your 3rd question, I'm not entirely sure what you mean. I can confirm that the legacy inventory behaviour is set to be fully depreciated by July 1st 2020. That behaviour has been removed from our latest API version (2019-10), and the last version that supports it (2019-07) is set to be depreciated July next year. If you can outline your use case and what behaviour you're looking to accomplish, I might be able to make a recommendation.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Shopify Partner
6 0 0

Thanks JB

 

We will try and get back to you

0 Likes
Highlighted
Shopify Partner
6 0 0

JB

 

We checked out the API and it seems like it doesn't cover all cases. Correct me if I'm wrong

 

1. So using the API we can get the order locations once they are fulfilled. But Shopify UI allows assigning the location right after the order has been paid or pending payment (not yet fulfilled). So Shopify substracts the inventory count from the selected location. But using the API you won't be able to get the location until the order is fulfilled. Is that correct?

 

2. multi_location_enabled is exactly what we need. Thank you

 

3. I think you answered it as well. Thanks

0 Likes
Highlighted
Shopify Staff
Shopify Staff
619 76 139

Hey @simplerfid ,

 

That's correct, the orders endpoint doesn't return the location_id inventory was deducted from. For more granular control over your fulfillments, I recommend checking out the new FulfillmentOrder API in the 2020-01 API version. FulfillmentOrders are a new concept where Shopify automatically groups items on an order which will be fulfilled from the same location. This allows you to query orders based on outstanding FulfillmentOrders, and create fulfillments for each group. For more information, I recommend checking out our documentation here.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes