# How to Automate Shopify Inventory Updates using the API

- Tool: API Automations
- Difficulty: Intermediate
- Fix time: 30-60 minutes
- Compatibility: Shopify Standard plan or higher; custom app via Dev Dashboard or Shopify CLI; requires write_inventory scope
- Last updated: May 2026

## TL;DR

Automate Shopify inventory updates using the GraphQL Admin API's `inventoryAdjustQuantities` mutation. Send adjustments per SKU and location with a POST to `https://{shop}.myshopify.com/admin/api/2026-04/graphql.json`. The key rate limit: 1,000-point GraphQL bucket on Standard plans with 50 pts/sec restore — each mutation costs ~10 points, giving you a sustained rate of ~5 inventory updates per second.

## Best practices

- Use `inventoryAdjustQuantities` (delta) over `inventorySetQuantities` (absolute) for concurrent-safe updates when multiple systems touch inventory.
- Always check `userErrors` in GraphQL responses — HTTP 200 does not guarantee a successful mutation.
- Implement idempotency by tracking which supplier feed batches have been applied — use a hash of the feed file as a deduplication key.
- For stores with 1,000+ SKUs, prefer `bulkOperationRunMutation` which submits a JSONL file and bypasses the point bucket entirely.
- Include the `reason` field on every inventory adjustment (e.g., 'correction', 'received') — Shopify logs this for store owners and it aids debugging.
- Test with a staging store before running against production — Shopify's sandbox environment uses canned data but the GraphQL schema is identical.
- Monitor `X-Shopify-API-Version` response header to catch silent version fall-forward if your pinned version gets retired.
- Set up the `inventory_levels/update` webhook to detect manual inventory changes in the Shopify admin that might conflict with automated syncs.

## Frequently asked questions

### Does Shopify still support REST inventory endpoints?

Yes, REST inventory endpoints (inventory_levels/adjust.json, inventory_levels/set.json) still function for custom apps. However, all new public apps must use GraphQL since April 1, 2025. Shopify has declared REST as 'legacy' — it receives no new features and may be deprecated in a future version. For any new integration, use `inventoryAdjustQuantities` or `inventorySetQuantities` GraphQL mutations.

### What is the difference between inventoryAdjustQuantities and inventorySetQuantities?

`inventoryAdjustQuantities` changes stock by a delta (e.g., delta: -5 removes 5 units). It's safer for concurrent systems because two adjustments won't overwrite each other. `inventorySetQuantities` overwrites to an absolute value (e.g., quantity: 100 sets to exactly 100). Use `inventorySetQuantities` when you have a full snapshot from a warehouse system; use `inventoryAdjustQuantities` when processing incremental changes.

### What happens when I hit the GraphQL rate limit?

Shopify returns HTTP 429 with a `Retry-After` header indicating seconds to wait. For GraphQL specifically, you can monitor the `extensions.cost.throttleStatus.currentlyAvailable` field on every 200 response — this tells you remaining bucket points before you'd be throttled. On Standard plans: 1,000-point bucket, 50 pts/sec restore. A mutation costs ~10 points. Implement backoff logic that sleeps when `currentlyAvailable < 100`.

### How do I handle inventory updates for multi-location stores?

Each `inventoryAdjustQuantities` change object requires both `inventoryItemId` AND `locationId`. For multi-location sync, you need to send separate changes per location in the same mutation. First, fetch your location IDs with `{ locations(first: 10) { edges { node { id name } } } }`. Then build your changes array with one entry per SKU-location combination.

### What is a Bulk Operation and when should I use it for inventory?

Bulk operations (`bulkOperationRunMutation`) let you submit a JSONL file containing thousands of mutations without consuming GraphQL point budget. The operation runs asynchronously — you poll its status or subscribe to the `bulk_operations/finish` webhook. Use bulk operations when syncing more than ~500 SKUs at once, or for nightly full-catalog reconciliations. For real-time adjustments (e.g., after a sale), stick with regular mutations.

### Can I create a custom app from the Shopify Admin anymore?

No. As of January 1, 2026, new custom apps can no longer be created from the Shopify Admin interface. You must create them via the Shopify Dev Dashboard (dev.shopify.com) or the Shopify CLI. Existing custom apps created before this date continue to function normally.

### Can RapidDev help build a custom Shopify inventory integration?

Yes. RapidDev has built 600+ apps including Shopify integrations with multi-location inventory sync, supplier feed pipelines, and 3PL connections. We handle the GraphQL API, webhook infrastructure, and rate limit management. Book a free consultation at rapidevelopers.com.

---

Source: https://www.rapidevelopers.com/api-automations/how-to-automate-shopify-inventory-updates-using-the-api
© RapidDev — https://www.rapidevelopers.com/api-automations/how-to-automate-shopify-inventory-updates-using-the-api
