Shopify Stock API transaction Issue

Hi,

a merchant informed us that they oversold a product due to a faulty stock update performed by the live sync of our ERP system. After investigating in our logs we discovered what I believe to be a transactional issue in Shopify.

In the inventory history of the product we see that it started out with an On Hand stock of 8, which was then set to 11 by our system. However our logs of the write which updated the stock to 11 report that we sent a quantity of 8 and a compareQuantity of 5. This indicates that the GraphQl API returned an On Hand value of 5. It must then have incorrectly applied the diff of 3 on top of the preexisting 8 and thus arrived at 11.

We exhaustively explored the logs on our side and could not determine any fault in our system. We would appreciate if someone with access to the logs on Shopify’s side would assist in fully explaining the behaviour in the merchants systems.

Best regards
Benedikt Brunner
Pickware GmbH

It might be worth sharing some request ID’s so the Shopify team will be able to identify/locate those requests.

Not sure if we store request ids, but I am happy to share any relevant information that we can provide. However I would prefer to not share any merchant specific information publicly

To elaborate on our API config, we are currently running on API version `2026-01`. That’s why we still use the deprecated compareQuantity field.

After some further investigation, it seems like we currently don’t retain the request ids of mutations we send to Shopify :smiling_face_with_tear:

Hopefully we could still identify the request based on the data we do store.

@liam-shopify could you help us dig into this one? We’d really appreciate a pointer on how to identify and eliminate the root cause.

On our side, we can pinpoint exactly which inventory movement in the merchant’s inventory history is the faulty one and are happy to share timestamps, for example.

As a stock management system, making sure the correct stock is synced to Shopify is essential for us — incorrect stock leads directly to oversells or false out-of-stock situations for the merchant’s customers. What makes this bug particularly painful is that it fails silently: neither we nor the merchant gets any signal that the stock is off, so it can sit broken for days before anyone notices.