Shopify · Inventory setup

Validate Shopify inventory before updating stock

Run a read-only check for one inventory item at one location. The checker runs on your own computer or integration host; it never sends your Shopify token to this website or changes stock.

Prepare Shopify access

Use a store-issued read-only token

Create or use a Shopify custom app with the read_inventory Admin API scope. Keep its Admin API access token in the environment of the computer or server running the checker. Do not paste it into this page, a browser form, or a public repository.

Choose one inventory level and location. The checker needs that level's Shopify global ID so it can read the matching SKU and available quantity. Resolve the ID with your Shopify Admin API tooling and the InventoryLevel API reference.

Run locally

Configure the checker on your host

Requires Node.js 20 or newer. Keep the downloaded files together in a private working directory.

Download the inventory checker and its rule module. Then set these variables in the same local shell session. Replace every placeholder with your own store values.

# PowerShell
$env:STORE_HOST = "your-store.myshopify.com"
$env:SHOPIFY_READ_TOKEN = "<store-issued-token>"
$env:SHOPIFY_INVENTORY_LEVEL_GID = "gid://shopify/InventoryLevel/<id>"
# macOS / Linux
export STORE_HOST="your-store.myshopify.com"
export SHOPIFY_READ_TOKEN="<store-issued-token>"
export SHOPIFY_INVENTORY_LEVEL_GID="gid://shopify/InventoryLevel/<id>"

Create a rule file named inventory-rule.json with your approved age limit:

{
  "platform": "shopify",
  "trimSku": false,
  "maxAgeSeconds": 300
}

Run node inventory-check.mjs inventory-rule.json. Exit code 0 means the record passed; 2 means the rule blocked it for review; 1 means the check could not complete. Confirm the result before any downstream write.

Choose what happens next

Interpret a Shopify inventory freshness check

For one SKU at one location, a count of four read at 09:58 UTC passes a five-minute age limit at 10:00. At 10:04 the same snapshot is six minutes old. Read that inventory level again before deciding whether to write. The adapter timestamps the Shopify read; an upstream supplier timestamp is needed to assess the supplier feed itself.

This checker only reads inventory. Your integration remains responsible for confirming the source, authorizing changes, and safely handling failures. For a one-time paid preflight, see the inventory preflight guide; for a guarded workflow, use the integration guide below.