At 9:00, a warehouse system prepares a stock correction for a lamp at one fulfillment location. Shopify shows eight units available. The correction would set that count to nine. Before the update reaches Shopify, an order for one lamp drops available stock to seven. What should the integration do when Shopify rejects the correction?
In this fictional store, I would preserve the order and investigate the correction. Reading seven and immediately resending “set to nine” is not a safe retry. It merely changes the condition under which an old decision can overwrite a newer one.

What the Shopify guard checks
In Shopify Admin GraphQL 2026-04, inventorySetQuantities sets an absolute quantity. For this single item, location and available state, send changeFromQuantity: 8 and quantity: 9. If the stored value is seven at execution, the mutation reports CHANGE_FROM_QUANTITY_STALE rather than changing it. The field must be supplied; explicit null disables the comparison. Shopify also requires an idempotency key through @idempotent for this mutation in 2026-04. Inspect the mutation’s userErrors, not just the HTTP status.
The comparison checks a number, not the history that produced it. If a later receipt brings the destination back to eight, the numeric comparison alone can pass even though the order and receipt both occurred after the warehouse prepared its correction. An idempotency key does not detect this. It lets Shopify recognize a retry of the same request, not decide whether a previously unsent correction is still valid.
Recover the decision, not just the request
Before sending, record the source correction ID and version, the item and location, the inventory state, which movements the source included, the expected and desired quantities, and the request key. If the connection drops and the result is unknown, Shopify’s idempotency guidance supports retrying the same request with the same key and parameters within 24 hours of the original request. After that, reconcile before attempting another write. Keep outcome recovery separate from approving another write. If the correction has been superseded, reconcile the uncertain outcome before sending anything new rather than replaying an obsolete instruction.
On a confirmed stale-quantity error, retire that attempt. Check the source version and reconcile the order, receipts and other changes against the warehouse record. Make sure both systems mean the same thing: Shopify distinguishes available from on-hand inventory. If nine was an available target before the one-unit order, and that order is the only missing movement, the reconciled target would be eight. If the warehouse already recorded the order, subtracting it again would be wrong. Send a fresh expected value and a newly calculated target with a new key only after confirming the correction is still warranted. If the evidence is incomplete, hold this item for review.
Track the latest known source revision and the last one applied for each item, location and state. Serialize dispatch for that scope so two integration workers don’t send competing corrections. Check the latest known revision immediately before dispatch and reject superseded revisions, even when the destination quantity matches. Advance the applied revision only after confirming the write succeeded. This helps your integration reject out-of-order source work; it does not make Shopify’s numeric check a cross-system version lock. Use absolute sets on behalf of the system that owns the quantity. For a verified movement rather than a replacement total, Shopify documents a delta adjustment. Do not turn an unexplained difference between two snapshots into a delta.
Four tests I would run before rollout
- No overlap: Eight is still current and the source correction is valid. One write sets nine.
- Sale arrives first: Shopify shows seven, rejects the write, and seven remains until reconciliation.
- Count cycles back: Shopify moves eight → seven → eight, but the source revision is now superseded. The old request is not dispatched.
- Reply disappears: Within 24 hours of the first request, retry the unchanged request with its original key to recover the outcome. After that window, reconcile before sending again.
The operator should be able to show why nine was proposed, which changes happened afterward, and why the next write is justified. A fresh read gives you a current number. It does not give an old correction a new reason to run.
Join the discussion
You must be logged in to post a comment.