Set Shopify Inventory (absolute)
shopify_set_inventorySets stock to an exact quantity at one or more Shopify locations for stocktakes or syncing from a source-of-truth system. Uses compare-and-set to reject writes if inventory changed concurrently.
Instructions
Set stock to an EXACT number at one or more locations — e.g. quantity: 42 means "there are now 42".
Use this for stocktakes and when syncing from a system that is the source of truth. For relative changes ("we sold 3"), use shopify_adjust_inventory instead.
Concurrency: by default this uses compare-and-set — pass compareQuantity (the quantity you believe is currently there) and Shopify rejects the write if someone changed it underneath you. Set ignoreCompareQuantity: true to force the write regardless, which risks clobbering a concurrent update.
The variant must already be stocked at the location — activate it first with shopify_set_variant_locations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sku | No | Exact variant SKU | |
| name | No | Which quantity to set | available |
| reason | No | correction | |
| quantities | Yes | ||
| inventoryItemId | No | InventoryItem GID — alternative to sku | |
| referenceDocumentUri | No | Traceability URI e.g. 'logistics://warehouse/stocktake/2026-01-14' | |
| ignoreCompareQuantity | No | Skip the compare-and-set safety check |