Edit Order API addVariant mutation does not respect locationID property

snakeyyy
Shopify Partner
1 0 1
Hi guys,
 we’re dealing with an issue on Edit Order API (version 2021-10), specifically with orderEditAddVariant mutation:
 
When specifying locationID in the request, the line item is successfully added to the order but the fulfillment location does not match with the one in the request. The location with the highest fulfillment priority is used instead
 
.Observations:
  • When inserting invalid locationID Shopify API raises an error
  • When inserting valid locationID but the variant_id is not on stock there, Shopify raises an error. After adding it on the stock in the given location and repeating the API request, the item is successfully added but the fulfillment location with the highest priority is used instead.
 
So far it seems like a regular bug in the API to me but maybe we’re missing something. Thanks for any help / ideas!
Replies 2 (2)

jakelous
Shopify Partner
3 0 4

Thank you for your Observations, I'm having the same problem, but you explained it. The docs say the locationId is:

The ID of the location to check for inventory availability. A default location ID is chosen automatically if none is provided.

Which based on your tests makes me assume the argument is simply there to throw an error for some fun reason. Maybe this feature was never implemented and they just rolled with this temp implementation?

 

Either way, I am struggling with this as well. How can you add an item to an order with the fulfilment location specified?

Jake

Thomotron
Shopify Partner
6 0 2

This issue has been giving me grief lately as well, particularly when trying to deal with multi-location fulfilments. 

 

We need to be able to add a line item to an order and fulfil it via the generated fulfilment order for that location. Without the location ID taking effect in the calculated order, we're forced to mangle the fulfilment order that the new line item gets dropped into just to fulfil it from the location we want.

 

It would be nice for this field to affect which location the line item is fulfiled from.

 

From what I know about the Admin panel though, there isn't any easy way to change where an item is fulfiled from without moving the entire fulfilment. So in favour of Shopify, the API is still consistent relative to the tools available in the web UI.