On a schedule
Plan reorders from Shopify sales in a sheet
Each morning your Reorders sheet shows every product's stock, daily sales rate, days left and how many to reorder.
- Runs
- On a schedule
- Apps
- Google Sheets, Shopify
- AI
- Not needed
- Access
- Shopify read_inventory, read_orders; Sheets write
Send this to your assistant
Create a ClickRuntime automation: every morning, work out each Shopify variant's sales per day over the last 30 days, write stock, days left and a suggested reorder quantity to my Reorders sheet, and email me the ones under 14 days.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A pet supplies shop orders from four suppliers with lead times from one to five weeks. The buyer guesses quantities from memory and the Shopify stock page, and the result is either an empty shelf or a stockroom full of the wrong thing.
A reorder sheet that recalculates every morning from real sales gives the buyer a starting point grounded in demand. They adjust for promotions and seasons, but no longer start from a guess.
What you get out of it
Order quantities based on demand
Suggested quantities come from how fast each item actually sells. Cash goes into stock that will move, not into items that sit.
Everything on one sheet
Stock, sales rate, days left and suggested order sit side by side for every variant. Sort by days left and the priorities are obvious.
Room for your own judgement
The sheet is yours to annotate with supplier, lead time or notes about promotions. The automation only rewrites its own columns.
An email for the urgent ones
Items with under two weeks of stock are emailed each morning. You know what needs ordering today without opening the sheet.
How it works
What happens, step by step
Every morning, ClickRuntime reads stock levels for each product variant in your Shopify store.
It counts how many of each were sold in the last 30 days to get a daily sales rate.
It works out the days of stock left and a suggested reorder quantity for each one.
The figures are written to your Reorders sheet, replacing yesterday's.
Items with less than 14 days left are emailed to you as a short list.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
- Connect Shopify
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Google Sheets and Shopify steps into one automation
Under the hood
The code that runs this automation
from datetime import date, timedelta
from collections import Counter
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, notify
STORE = "your-store.myshopify.com"
def gql(query, variables=None):
resp = http.post(f"https://{STORE}/admin/api/2025-07/graphql.json", json={"query": query, "variables": variables or {}},
headers={"X-Shopify-Access-Token": credentials.connection("shopify", "store")})
return resp.raise_for_status() or resp.json()["data"]
SHEET_ID, COVER_DAYS = "your-spreadsheet-id", 45
@on_trigger
def run(event):
orders = gql("""query($q: String!) { orders(first: 250, query: $q) { nodes { lineItems(first: 50) { nodes { quantity variant { id } } } } } }""",
{"q": f"created_at:>={date.today() - timedelta(days=30)}"})["orders"]["nodes"]
sold = Counter()
for o in orders:
sold.update({li["variant"]["id"]: li["quantity"] for li in o["lineItems"]["nodes"] if li["variant"]})
rows, urgent = [], []
for v in gql("{ productVariants(first: 250) { nodes { id sku displayName inventoryQuantity } } }")["productVariants"]["nodes"]:
rate = sold[v["id"]] / 30
days = round(v["inventoryQuantity"] / rate) if rate else ""
reorder = max(0, round(rate * COVER_DAYS - v["inventoryQuantity"]))
rows.append([v["sku"], v["displayName"], v["inventoryQuantity"], round(rate, 2), days, reorder])
if days != "" and days < 14:
urgent.append(f"{v['displayName']}: {days} days left, reorder about {reorder}")
sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
sheets.spreadsheets().values().update(spreadsheetId=SHEET_ID, range="Reorders!A2", valueInputOption="USER_ENTERED", body={"values": rows}).execute()
if urgent:
notify.email_me(f"{len(urgent)} products to reorder", "\n".join(urgent))
return {"variants": len(rows), "urgent": len(urgent)}FAQ
Common questions
How is the suggested quantity calculated?
Does it place orders with suppliers?
What about seasonal products?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Log late Shopify orders to a sheet
Every hour, paid orders that have missed your dispatch time are added to a sheet, and you get a Slack alert for each new one.
See how it worksLog weekly Shopify sales to a sheet
Every Monday a new row in your sheet records last week's orders, revenue, average order value and top product.
See how it worksDraft blog posts from products, tracked in a sheet
Each week one product gets a blog draft in Shopify, and your content sheet records the title, date and link.
See how it worksKeep exploring
Set up “Plan reorders from Shopify sales in a sheet” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.