Getting Orders based on location (reference_location_id)

garyrgilbert
Excursionist
22 1 3

 

If a shop has multiple fulfillment locations you can filter the orders (in the shop admin) based on a selected location. Unfortunately, it looks as though reference_location_id is not a filter option for the ORDER REST API.

 

By inspecting the post headers when I change the location I see a rather complex graphql query being sent to core "OrderListData" somewhere in there is an additional query ordersList() that returns the filtered results based on the order locationID.

 

Anyone out there know if its possible to do similar? I'm guessing it will be a rather expensive query but would be interested nevertheless.

 

Cheers

 

0 Likes
sabross
New Member
2 0 0

@garyrgilbert wrote:

 

If a shop has multiple fulfillment locations you can filter the orders (in the shop admin) based on a selected location. Unfortunately, it looks as though reference_location_id is not a filter option for the ORDER REST API.

 

By inspecting the post headers when I change the location I see a rather complex graphql query being sent to core "OrderListData" somewhere in there is an additional query ordersList() that returns the filtered results based on the order locationID.

 

Anyone out there know if its possible to do similar? I'm guessing it will be a rather expensive query but would be interested nevertheless.

 

Cheers

 



Could u use https://shopify.dev/docs/admin-api/graphql/reference/shipping-and-fulfillment/fulfillmentorder

0 Likes
garyrgilbert
Excursionist
22 1 3

Fulfillment order is specific to an order. 

It answers the question. "Which locations will fulfill the items on this order?"

The question I want answered is "Which orders have items that will be fulfilled from this location?"

or in other words:

"Give me the X number of orders that have items that can be fulfilled by Y location_id."