Products sitting in warehouses need a sales push. You pull inventory levels from Shopify’s GraphQL API, identify high-stock / low-velocity items, and generate marketing copy for those products with urgency-appropriate messaging.
12 priority items--- Wool Blend Cardigan (Charcoal / L) — 340 units ---1. The layering piece you'll reach for every cool morning — at a price that won't last. Italian merino-nylon for warmth without bulk.2. Still searching for the perfect fall layer? Premium merino, relaxed fit, timeless charcoal. Shop now → [link]3. 72 hours only: The cardigan everyone's eyeing is 25% off4. Layer Up for Less — Wool Blend Cardigan, Limited-Time Price
inventoryLevels requires read_inventory scope. Update in Shopify Admin → Settings → Apps → your app → API scopes. Changes take effect immediately.
Velocity estimation is approximate
The code estimates velocity from current stock divided by an assumed time window. For accurate velocity, query order line items per product over 90 days and divide by weeks.