[BUG] - Restock not working for split fulfillment orders when removing line items — committed inventory gets permanently stuck

Hey everyone,

Been building an order management app for a while now and hit a pretty nasty inventory bug. Reproduced it consistently across multiple stores, so fairly confident this isn’t something on my end.

The bug specifically happens with orders that are split across multiple warehouses. Here’s the exact scenario that triggers it every time:

Starting inventory:

  • California Warehouse — 3 available
  • Texas Warehouse — 4 available

I create an order for 4 units. Based on routing rules, it gets assigned entirely to Texas (can fulfill the whole order from one location, minimizing splits). All good.

I then edit the order and add 1 more unit. Now Texas can’t cover 5 alone, so Shopify splits it — Texas gets 4, California gets 1. Still makes sense.

Now here’s where the workflow comes in. Our app’s approach to changing warehouses on an order is to remove the existing line items and re-add them with the new quantity. This is the cleanest way to let Shopify re-run its routing logic and assign the right warehouses fresh. Simple, straightforward.

So I go into Edit Order, remove the items with Restock checked. Here’s what happens:

  • California (1 unit) — removed and restocked correctly
  • Texas (4 units) — removed, no errors, but inventory never restocked

Texas committed stays at +4. Available stays at 0. The “Restock 4 units” checkbox was checked. The edit committed without any errors or userErrors. But the inventory just didn’t come back.

This is consistent every time — the first fulfillment group restocks fine, the second one doesn’t. Tested through both the Shopify Admin UI (Edit Order → adjust quantity → Restock checked → Update Order) and the GraphQL API (orderEditSetQuantity with restock: true). Both fail the same way.

The downstream effect is that Texas now shows 0 available even though nothing was ever shipped. The product looks out of stock, future orders get routed incorrectly, and the only fix is manually adjusting inventory at the location level — which isn’t sustainable.

Would really appreciate the Shopify team looking into this. Happy to share store details, order IDs, and inventory adjustment history privately.

Thanks

1 Like

Hey @Liam-Shopify - would really appreciate your eyes on this if you get a chance. This is affecting merchants actively and we’ve been able to reproduce it consistently across multiple stores. Any guidance or escalation would mean a lot. Thanks so much!

Bumping this — still actively hitting this bug across multiple stores. Would really appreciate any response from the Shopify team, even just a confirmation that it’s been flagged internally. Happy to jump on a call or share store details privately.

Hey @Shubham_Vats , I’m going to try to replicate this. Before I set up the test environment: are you using default routing rules or have you customized them (ranked priority, proximity-based, etc.)?

Can you share examples of the mutations you’re running and the sequence? For instance, orderEditBegin → what comes next → orderEditCommit. Seeing the actual queries (with any sensitive IDs redacted) would help me run through the exact same flow. Also curious whether the orderEditCommit response is returning clean or if there are userErrors.

If there are any other details about your setup that might be relevant (ie, payment state when you’re editing, fulfillment order status at the time, etc) if could be useful. The more I can mirror your environment, the better chance we have of catching this.

Hey @KyleG-Shopify, super thanks for digging into this! Here’s everything you need.

Routing Rules

Default Shopify routing, no customization:

  1. Minimize split shipments
  2. Stay within the destination market
  3. Ship from the closest location

Store Setup

  • 2 locations:
    • Toronto — Set as the Default Location. Serves only Toronto/Ontario. Has 1 unit of the product.
    • Vancouver — Serves all of Canada. Has 2 units of the product.
  • Default Location: Toronto (Settings → Locations)
  • Shipping address: Toronto
  • Payment status: Captured
  • Fulfillment status: Unfulfilled, all fulfillment orders OPEN
  • All merchant-managed locations, no third-party fulfillment services

Why We Remove and Re-Add

Our app allows customers to modify their order quantities after checkout. When the quantity changes, Shopify needs to recalculate warehouse assignments and shipping rates. We found the cleanest way to let Shopify do this is to remove all existing line items and then re-add the new desired quantity — this forces Shopify’s routing engine to re-evaluate from scratch using the store’s routing rules.

We cannot do the removal and re-addition in a single edit session. If we try to orderEditBeginorderEditSetQuantity(0)orderEditAddVariantorderEditCommit all in one go, Shopify returns a userErrors with “Order cannot be updated.” So we split it into separate sessions: one commit to remove, another commit to re-add.

When items are split across multiple warehouses, there’s an additional constraint — we can’t even remove from all warehouses in a single session. If we try to set both the Toronto line item and the Vancouver line item to 0 within one orderEditBeginorderEditCommit, it also throws “Order cannot be updated.” So we have to remove from each warehouse in its own separate session: one commit per warehouse.

The Exact Sequence That Triggers the Bug

This only happens when you arrive at a split fulfillment through sequential order edits — not when you place a split order directly. Here’s the full sequence:

Step 1 — Customer checks out with 1 unit, shipping to Toronto.

Shopify assigns it to Toronto (closest, serves the destination, has stock).
Toronto: 0 available, 1 committed. Vancouver: 2 available.

Step 2 — Customer increases quantity to 3.

Since we can’t adjust and re-route in a single session (as explained above), we do two sessions:

Session 1 — Remove:
orderEditBeginorderEditSetQuantity(quantity: 0, restock: true)orderEditCommit

This removes the 1 unit from Toronto and restocks it. Commit returns clean, userErrors: []. Toronto goes back to 1 available.

Session 2 — Re-add:
orderEditBeginorderEditAddVariant(quantity: 3)orderEditCommit

Shopify’s routing engine kicks in. It needs to place 3 units. Toronto has 1, Vancouver has 2. No single location can fulfill all 3, so it splits: 1 from Toronto, 2 from Vancouver. This is correct — minimize split shipments can’t avoid a split here, so it distributes optimally.

Order state is now: 1 unit at Toronto, 2 units at Vancouver.

Step 3 — Customer decreases quantity to 2. This is where the bug happens.

We need to remove all 3 units and re-add 2. The items are split across Toronto and Vancouver. As explained above, we can’t remove from both warehouses in a single session — Shopify throws “Order cannot be updated.” So we remove from each warehouse in its own session:

Session 1 — Remove 1 unit from Toronto:
orderEditBeginorderEditSetQuantity(quantity: 0, restock: true)orderEditCommit

Toronto’s 1 unit restocks fine. Commit returns userErrors: []. ✓

Session 2 — Remove 2 units from Vancouver:
orderEditBeginorderEditSetQuantity(quantity: 0, restock: true)orderEditCommit

(The order of removal here matters. We remove in ascending quantity order — Toronto first (1 unit), Vancouver second (2 units). If there were a third warehouse with 3 units, we’d remove that last. We discovered through testing that removing in any other order causes Shopify to return “Order cannot be updated.” This ascending sequence is the only one that gets through without a lock error.)

Commit returns userErrors: [] — no error reported. But when you check Vancouver’s inventory after this, the 2 units are not restocked. They remain permanently stuck in “Committed” and never return to “Available.”

Session 3 — Re-add 2 units:
orderEditBeginorderEditAddVariant(quantity: 2)orderEditCommit

Because Vancouver’s inventory is now corrupted (2 units stuck in Committed), Shopify sees reduced available stock across the network and makes incorrect routing decisions.

What Doesn’t Trigger the Bug

If you place a fresh order directly with 3 units (so Shopify creates the split fulfillment of 1 from Toronto + 2 from Vancouver at checkout), and then immediately edit it down to 2, the restock works fine. Both locations restock correctly.

The bug only triggers when the split fulfillment was created through a sequential order edit — checkout with 1, then edit up to 3 (which creates the split), then edit down to 2 (which fails to restock).

Summary

  • The orderEditCommit response is always clean — userErrors: []. There is no error signal. The restock failure is completely silent.
  • This is reproducible through the Admin UI as well. Edit the order manually, reduce the quantity, tick Restock, update — same result, inventory stays stuck in Committed.
  • The Default Location (Toronto) being the same as the shipping destination may be relevant here — we’ve seen this be a factor in our testing.

Let me know if there’s any other information needed, happy to share!

Thanks again, Kyle!

  • Shubham

Hey @Shubham_Vats, really appreciate the detailed steps. That made it much easier to dig into. I was able to reproduce it on my own test store.

I’m digging in to this and will follow up with what I find.

Great to know the issue was replicated @KyleG-Shopify. Please let me know if you need anything else from my end.

Looking forward to seeing the issue resolved. Thank you!!

1 Like

Hey @KyleG-Shopify,

Circling back to know if we have any update on this? Thanks.

We have opened an issue to investigate. I don’t have a timeline, but I will update here when I do.