Splitting fulfilmentOrder for a single line item

david-dotdev
New Member
2 0 1

Hi, I'm trying to find a way to split up fulfilmentOrder for a line item in a Shopify order.

An example situation would be:

  • Shopify store has multiple locations, call them location A (default) and location B, and the store is set to track inventory at locations.
  • A product is created in the store with 1 inventory quantity in both A and B, totalling of 2 items across all locations.
  • A customer purchases the item with quantity 2 from the online store
  • As according to the behaviour set out in this documentation, the line item is being set to location A for both quantities, even though location A only has 1 (because neither A nor B has 2 of the said item)
  • This results in location A's inventory to go -1, and location B to stay at 1.

In the above scenario, the said order will have a fulfilmentOrder attached to it for the line item to be fulfilled at location A. What I wanted to do is to actually split it out (via GraphQL API) so that 1 is assigned to location A and the other to location B, resulting in both locations having 0 inventory at the end and none having negative inventory.

The only GraphQL mutation I can find that might be relevant is fulfilmentOrderMove, but it does not allow splitting an existing fulfilmentOrder. Does anyone know how to achieve this? Many thanks!

_JB
Shopify Staff
Shopify Staff
750 86 163

Hey @david-dotdev,

In the scenario you described, the recommended workflow is to first create a fulfillment for 1 unit at the assigned location. Once the fulfillment is created, the existing fulfillment_order will have it's fulfillable_quantity updated to 1, at which point it can be moved to the new location using the  fulfilmentOrderMove mutation.

JB | 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

0 Likes