Avoiding split/merge conflicts

We have a use case for splitting orders into multiple fulfillmentOrders, and we like using the fulfillmentOrderSplit endpoint for doing so.

But we’ve also noticed that Shopify sometimes splits orders into multiple fulfillmentOrders, then merges them again. This seems to happen with fraud holds, and with Shopify Flow actions being executed, and probably various other situations.

We’d like to avoid any conflicts that might arise from initiating a split or merge while Shopify is still resolving its own splitting and merging.

So, the question is, are these always resolved before the order is removed from a hold? If so, could we just wait until that occurs, and only then proceed with splitting for our own purposes?

1 Like

Hey @rzd , I’ll see what I can find out for you on the expected behaviour here. First, for clarity, when you mention being removed from a Hold, are you talking about the fulfillment order status being on HOLD?

Yes, that’s right. Thanks!

Hey Rob!

I tested this out by placing a fulfillment order on hold and attempting to split it. The order had a fulfillment order with status ON_HOLD, and when I queried the supportedActions, the available actions were RELEASE_HOLD, HOLD, and MOVE.

When I attempted the split anyway using the fulfillmentOrderSplit mutation, I got back a clear error: “Fulfillment order: [ID] is currently not in a splittable state.”

Your approach of waiting until the fulfillment order is released from hold before attempting splits is good. The FulfillmentOrderAction enum will tell you exactly what operations are available at any given time, so querying supportedActions before attempting mutations would be recommended.

Sounds great, thanks!

1 Like