Stocktake while the store keeps selling: expected vs counted
How a Restock Ops stocktake stays correct while orders come in: expected on hand, counted, the refresh step, the guarded write to available, and undo.
Nobody closes the shop to count stock any more. The count happens on a Tuesday afternoon with the online store open, a staff member on the till and a courier collecting at four. That is fine for the shelves, which do not care, and awkward for the software, because the number Shopify holds for a product at two o'clock is not the number it holds at half past three, and a count that was right when it was taken can be wrong by the time it is written.
Restock Ops is built around that gap. This post walks through a stocktake from the first scan to the write, and explains what each number on the page is, when it was read, and why the final adjustment is shaped the way it is. If you have ever applied a count and watched a product go negative, this is the mechanism that prevents it.
Expected is a snapshot, taken per line
A stocktake is created for one location, with a name (the placeholder suggests something like Back wall, Saturday cycle count) and an optional note. Lines are added by scanning or searching, and the moment a line is added, Restock Ops reads Shopify's on hand quantity for that item at that location and stores it on the line as Expected. The column is labelled Shopify on hand so there is no doubt about what it is.
This matters because expected is not read once for the whole stocktake. The line you add at two o'clock carries the two o'clock figure; the line you add at three carries the three o'clock figure. Each is a true statement about Shopify at the time you started counting that product, which is the right thing to compare a shelf count against. The line also records whether the item is tracked; untracked items can be counted, and the count is kept for reference, but they are badged not tracked, never adjusted and excluded from every write.
Counting: scans, multipliers and ambiguous codes
The scan box takes a barcode or SKU and Enter. An exact match on either counts one unit immediately and shows a short history of what was just added. Scanning the same code again increments the count rather than creating a second line, so you can scan a shelf item by item and the line simply climbs.
For boxes of identical units the box also accepts a multiplier: 3*CODE or 3 x CODE adds three in one go, up to four digits. If the code matches several variants, for example a SKU that was reused across sizes, the app lists up to ten candidates with product, variant, SKU and barcode, and you pick one. If nothing matches at all, the warning says so and points you to the product search below, which adds lines with a count of zero for you to fill in by hand.
Counts can be typed over directly in the Counted column. Blank entries are ignored, negative numbers are rejected, and whole numbers only. The Difference column recalculates as you go: a green match badge when counted equals expected, a blue plus when you found more than Shopify thought, a red minus when you found less.
Refresh Shopify quantities
Below the lines table there is a button labelled Refresh Shopify quantities. It re-reads on hand for every line at the stocktake's location and replaces each line's expected value with the current one, then lists exactly what moved, as Product: 10 to 12, so you can see which items sold or were received while you were counting.
Use it when a count has run long. If you counted a product at 14 against an expected 14 at two o'clock and two units sold online at three, a refresh brings expected to 12 and the line now shows a difference of plus two, which is correct: the two units are still physically on the shelf, Shopify has already reduced on hand for them when they were fulfilled, and your count is simply newer than that fulfilment. The guide to on hand versus available goes deeper into which Shopify quantity a shelf count actually measures.
What Review and apply writes
The Review and apply button opens a modal that states the whole write in one sentence before you confirm it: one inventoryAdjustQuantities call, with the reason cycle_count_available, at the stocktake's location, changing available by the difference on however many lines disagree, with the units over and the units short totalled. Up to fifteen discrepancies are listed as expected to counted with the signed delta. Lines that match are left alone. Items you never counted are left alone. If every line matches, the button changes to Close stocktake and nothing is written at all.
The write is a delta, not a set. Each line's adjustment is counted minus expected, applied to the available quantity. Because on hand is available plus committed plus the other states, moving available by the delta moves on hand by the same delta without touching units that are committed to open orders, which is exactly the set of units that a shelf count includes but a Set to would have overwritten. Shopify documents the quantity names and the cycle_count_available reason on its inventory states and adjusting quantities pages, and the adjustment appears in each product's adjustment history with that reason and a reference back to the stocktake.
The two guards on the way to Shopify
Pressing the confirm button does not write immediately. First, the app performs the same refresh described above. If any expected value has changed since the page was loaded, nothing is written; instead you get an error that Shopify quantities changed since you counted, listing the items, and the lines now show the updated expected values for you to review. Apply again once you are satisfied.
Second, the write itself carries each line's current available quantity as a change-from value. Shopify compares it with what it holds at the instant the mutation runs, and if a sale slipped in between the refresh and the write, Shopify rejects the whole call rather than applying a stale count to one line. Restock Ops reports that as Shopify rejected the adjustment; nothing was changed, with Shopify's message, and the stocktake stays open. The mutation is also sent with an idempotency key, so a retry after a network error cannot apply the same adjustment twice. Shopify's inventoryAdjustQuantities reference describes both the change-from check and the reason codes.
After the write: the log, undo and cancel
Every write is recorded on the stocktake page under Shopify writes, with the summary, the status and the time, so an applied stocktake carries its own evidence. An applied stocktake has one more button, Undo, which reverses the applied deltas with a correction adjustment that references the original write. Sales since the apply are unaffected because, again, it is a delta. The post on undoing a wrong inventory adjustment covers when that is the right move and when a fresh count is better.
An open stocktake can be cancelled at any time; the counts are kept for reference and nothing is written. The list of stocktakes shows each one as open, applied, undone or cancelled, with the line and unit totals, so a half-finished Saturday count can sit there until Monday without anyone wondering whether it touched Shopify. It did not. Only the apply button does.
A routine that survives a busy afternoon
- Create the stocktake for the location you are standing in, named for the area and the day.
- Scan shelf by shelf. Use 3*CODE for sealed boxes, and pick from the list when a code is ambiguous.
- If the count takes more than an hour or you know orders are being fulfilled, press Refresh Shopify quantities and read what moved before you review.
- Open Review and apply and read the sentence: the location, the number of lines, the units over and short. If it does not match your expectation, Keep counting.
- Confirm. If you get the quantities changed message, look at the updated lines and confirm again; if Shopify rejects the write, nothing changed and you can simply retry.
- Check the Shopify writes section and the adjustment history in Shopify for one product, once, so you trust the mechanism next time.
FAQ
What does Expected mean on a Restock Ops stocktake line?
It is Shopify's on hand quantity for that item at the stocktake's location, read at the moment the line was added. Each line carries its own reading, and the Refresh Shopify quantities button re-reads all of them and lists what changed since.
Why does the stocktake adjust available instead of setting on hand?
A shelf count includes units that are committed to open orders but not yet shipped. Writing counted minus expected as a change to available moves on hand by the same amount while leaving committed units alone, so sales made during the count are preserved. A Set to on hand would overwrite them.
What happens if someone sells an item while I am applying the count?
Two guards catch it. The apply step first re-reads Shopify and refuses to write if any expected value changed, showing you the updated lines. The write itself tells Shopify the quantity it expects to change from, and Shopify rejects the whole adjustment if that no longer matches, so nothing is written and the stocktake stays open for you to retry.
Can I undo a stocktake after applying it?
Yes. An applied stocktake has an Undo button that reverses each applied delta with a correction adjustment referencing the original write. Because it is a delta, orders fulfilled since the apply are not disturbed. A cancelled stocktake never wrote anything, so it has nothing to undo.
Try it on your store. Restock Ops adds purchase orders with partial receiving, supplier notes, cost history, barcode labels, scanner stocktakes and a reorder report on top of Shopify inventory. From $19/month, 14-day free trial.