Calculate Stockout-Adjusted Replenishment & Reorder Points
calculate_replenishment_planComputes stockout-adjusted reorder points, safety stock, and carton-rounded order quantities for each SKU, helping prevent stockouts and excess inventory.
Instructions
Replaces Shopify Stocky's retired forecasting brain. Computes margin-weighted ABC classes, stockout-adjusted daily sales velocity, demand + lead-time variability safety stock (SS = Z * sqrt(LTsigma_d^2 + d^2sigma_LT^2)), reorder points, inventory position (On-Hand + On-Order - Committed - Backorders), days of cover, and carton-rounded order recommendations. Free Local Sandbox processes up to 25 SKUs per call; Pro/License unlocks unlimited SKUs and Live Shopify sync.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| skus | No | Structured SKU inventory + velocity rows. | |
| demo_mode | No | Run immediately against the built-in US Shopify merchant dataset (no API keys required). | |
| window_days | No | Lookback window in days when parsing CSV or querying live Shopify orders. | |
| inventory_csv | No | Raw CSV exported from Shopify Admin Products or merchant reorder spreadsheet. | |
| service_level | No | Target cycle service level used for Z-score safety stock calculation (85%=1.04, 90%=1.28, 95%=1.65, 97.5%=1.96, 99%=2.33). | 95% |
| supplier_rules | No | Optional supplier rules (e.g. from migrate_stocky_csv_snapshot) to apply vendor lead_time_days overrides. | |
| use_live_shopify | No | Pull live variants and paid order velocity from configured Shopify Admin GraphQL API (Pro / License). | |
| review_period_days | No | Days between purchasing review cycles (e.g., 7 for weekly, 14 for bi-weekly). |