Wholesale Supplier → Shopify Inventory Sync
A store kept selling products its wholesale supplier had already run out of. We connected the supplier's live stock feed to Shopify, so thousands of products stay correct without anyone touching them.

3,599 products corrected in one run with zero errors; prices and content are never touched.
TL;DR
- 3,599 SKUs updated in a single run, 0 errors.
- Only stock quantities are touched. Never prices, content or products.
- Safe by design: exact SKU matching, a dry-run mode and a full log for every run.
The problem
The store sells thousands of products that are shipped by a large US wholesale distributor. Shopify's stock levels were updated by hand, every now and then. In between, customers could order items that were already sold out at the warehouse. Every one of those orders meant a cancellation, a refund, an apology email and a slightly less loyal customer.
What we built
A small, focused integration between the distributor's data feed and the Shopify Admin API, running on a schedule.
How it works
- 1Download the supplier feed. The distributor publishes a live feed (JSON and CSV) with every SKU and its available quantity. The script loads it into a SKU → quantity map.
- 2Read the Shopify catalogue. All products and variants are pulled through the Admin REST API, 250 per page, following the pagination links and pausing briefly between pages to respect rate limits.
- 3Build a plan. For every Shopify variant:
- not in the supplier feed → leave it alone,
- SKU appears twice in Shopify → skip it as ambiguous,
- not inventory-tracked in Shopify → skip it,
- quantity already correct → nothing to do,
- otherwise → queue an update from the current to the target quantity.
- 4Dry run (optional).
--dry-runprints the plan and the first 20 changes without writing anything. - 5Write in batches. Updates go through the GraphQL
inventorySetQuantitiesmutation, 250 SKUs per call, at the store's primary location, withreason: correction. - 6Log and save state. Every run writes a timestamped log (updates, already correct, skipped and why, errors per batch) and a state file with the last run time and count.
Under the hood
| Decision | Why |
|---|---|
| Inventory only | The client's team owns prices and content. The sync must never overwrite their work. |
| Exact SKU match only | Fuzzy matching on a catalogue this size is how you sell the wrong product. |
| Skip duplicate SKUs | If a SKU exists twice in Shopify, there's no safe answer, so we report it instead of guessing. |
| GraphQL bulk mutation | One call per 250 SKUs instead of 3,599 REST calls. A full run takes seconds. |
| Credentials in an env file | Shop domain and admin token stay out of the code and out of git. |
Plain Python + requests | No framework, nothing to maintain. It runs on any cron or scheduler. |
Results
| Metric | Value |
|---|---|
| SKUs in the supplier feed | 18,429 |
| Products in the Shopify store | 19,029 |
| Already correct | 8,376 |
| Skipped as ambiguous (duplicate SKU) | 307 |
| SKUs corrected in one run (12 Oct 2026) | 3,599 |
| Batches / batches with errors | 15 / 0 |
| Write phase / full run | ~27 seconds / ~3.5 minutes (mostly reading the catalogue) |
| Manual stock updates needed | None |
What we learned
- *Most of the work is deciding what not* to touch.** The core sync is a few dozen lines. The safety rules around it are what make a client trust it on a live store.
- Dry runs sell the project. Showing the client exactly which products would change, before changing anything, turned a nervous "yes" into a confident one.
Connected projects
- Client managed in → Artikuno OS CRM
- Same Shopify Admin API toolkit as → F1 Pit Stop
- Typical Upwork demand for this: inventory sync jobs show up regularly in the Demo Factory feed.
Images.

Ready to build your AI project?
Free 30-minute discovery call. No pitch. Just a conversation about what AI could do for you.
- Free · 30 min
- A concrete first step you can act on
- In German or English, online