Back to guides
5
8 min

Inventory & Cash Flow Forecasting

AI-Powered Demand Planning & Working Capital Management

The Cash Flow Problem

Every business owner knows the feeling: revenue is growing, orders are coming in, but the bank account keeps shrinking. The gap between when you pay suppliers and when customers pay you — the cash conversion cycle — is where businesses live or die. AI cannot eliminate this gap, but it can predict it, plan for it, and help you optimize it.

This chapter covers two interconnected topics: inventory forecasting (making sure you have the right products at the right time) and cash flow forecasting (making sure you have enough cash to operate). Both rely on pattern recognition — exactly what AI does best.

Inventory Forecasting: The Goldilocks Problem

Too much inventory ties up cash and risks obsolescence. Too little inventory means stockouts, lost sales, and unhappy customers. The goal is "just right" — and AI gets you closer than any manual process.

The Data You Need

Effective inventory forecasting requires historical data. The more you have, the better AI can identify patterns:

Data TypeSourceWhy It Matters
Sales historyShopify, Amazon Seller Central, QuickBooks, POS systemThe foundation — what sold, when, how much
Seasonality patterns2-3 years of monthly salesReveals predictable peaks and troughs
Lead timesSupplier agreements, purchase order historyHow long between ordering and receiving inventory
Promotional calendarMarketing team, historical promotionsSales spikes from promotions are not organic demand
External factorsWeather data, economic indicators, competitor actionsDemand drivers outside your business

Open data/inventory-history.json in the code panel. This file contains 24 months of SKU-level sales data for an e-commerce business selling home goods. Notice the seasonal patterns — sales spike in November-December (Black Friday, holiday season), dip in January-February, and have a secondary peak in May-June (summer home improvement).

US Seasonal Patterns

Understanding the major demand cycles is critical for inventory planning:

PeriodDriverTypical Impact
**Black Friday / Cyber Monday** (Late Nov)Holiday shopping kickoff200-400% spike in e-commerce
**Holiday Season** (Nov-Dec)Gift buying, year-end spendingHighest revenue quarter for most retail
**Post-Holiday** (Jan-Feb)Returns, reduced spending30-50% drop from Q4 peak
**Back-to-School** (Jul-Aug)School supplies, electronics, clothingCategory-specific spikes
**Amazon Prime Day** (Jul)Platform-specific promotional eventSignificant for Amazon sellers
**Tax Refund Season** (Feb-Apr)Consumer spending boost from refundsModerate lift in discretionary categories
**Summer** (May-Aug)Outdoor, home improvement, travelCategory-specific

AI Forecasting Tools

ToolBest ForIntegrationsPricing
Inventory Planner (Sage)Shopify and e-commerce businessesShopify, Amazon, WooCommerce, BigCommerceFrom $99/mo
NetstockMid-market distribution and manufacturingQuickBooks, NetSuite, SAP Business OneFrom $1,000/mo
Blue YonderEnterprise supply chain and demand planningSAP, Oracle, large ERP systemsEnterprise pricing
Amazon's Demand ForecastingAmazon FBA sellersAmazon Seller CentralIncluded with selling plan
Shopify AnalyticsSmall-medium Shopify storesNative to ShopifyIncluded with plan
ForecastlyAmazon sellers — restock planningAmazon Seller CentralFrom $49/mo

AI Forecasting Prompts

Basic demand forecast: "Using the 24-month sales history in this data, forecast demand for each SKU for the next 3 months (July, August, September). Account for the seasonal patterns visible in the data. Present the forecast in a table with columns: SKU, avg monthly sales, seasonal adjustment factor, and forecasted units for each month."

Reorder point calculation: "For each SKU in this inventory data, calculate the reorder point using this formula: Reorder Point = (Average Daily Sales x Lead Time in Days) + Safety Stock. Use a safety stock of 2 weeks of average sales. Lead time is 21 days for domestic suppliers and 45 days for overseas suppliers. Flag any SKUs where current inventory is below the reorder point."

Amazon and Shopify: Platform-Specific Considerations

Amazon FBA Inventory Management

For Amazon FBA (Fulfillment by Amazon) sellers, inventory management has additional constraints:

  • Storage fees: Amazon charges monthly storage fees ($0.87/cubic foot standard, $2.40/cubic foot Oct-Dec). Overstocking is expensive.
  • Aged inventory surcharge: Inventory stored over 181 days incurs surcharges ($6.90/cubic foot at 271-365 days)
  • IPI Score: Amazon's Inventory Performance Index penalizes excess and stranded inventory. Below 350, your storage limits are restricted.
  • Restock limits: Amazon limits how much inventory you can send to FBA warehouses
  • Prompt: "My Amazon FBA business has these 15 SKUs with the following 12-month sales history and current FBA inventory levels. Calculate: (1) weeks of cover for each SKU, (2) which SKUs need restocking before Q4, (3) which SKUs are at risk of aged inventory surcharges, (4) estimated storage fees for the next 3 months at current levels. Present as a table sorted by urgency."

    Shopify Inventory

    Shopify's built-in analytics provide basic inventory insights, but AI-powered tools like Inventory Planner add:

  • Demand forecasting by variant (size, color)
  • Automated purchase order generation
  • Multi-location inventory optimization
  • Bundle and kit planning
  • Cash Flow Forecasting

    Cash flow forecasting is arguably more important than profit forecasting. Profitable businesses go bankrupt when they run out of cash — it happens more often than you would think.

    The Three Cash Flow Components

    ComponentWhat It CoversKey Drivers
    Operating Cash FlowCash from core business operationsCollections from customers, payments to suppliers, payroll, taxes
    Investing Cash FlowCash spent on or received from long-term assetsEquipment purchases, property, investments
    Financing Cash FlowCash from or to lenders and ownersLoan proceeds, loan repayments, dividends, equity issuance

    Open data/cash-flow-history.csv to see 12 months of actual cash flow data for a mid-size distribution business. The operating section shows the real working capital dynamics — note how accounts receivable collections lag behind revenue recognition, creating periodic cash crunches despite healthy profits.

    The Cash Conversion Cycle

    The Cash Conversion Cycle (CCC) measures how many days it takes to convert inventory investment back into cash:

    CCC = Days Inventory Outstanding + Days Sales Outstanding - Days Payable Outstanding

    MetricFormulaGood TargetWhat It Means
    DIO(Avg Inventory / COGS) x 36530-60 daysHow long inventory sits before selling
    DSO(Avg Accounts Receivable / Revenue) x 36530-45 daysHow long customers take to pay
    DPO(Avg Accounts Payable / COGS) x 36545-60 daysHow long you take to pay suppliers

    A shorter CCC means cash comes back faster. Amazon's CCC is famously negative — they collect from customers before paying suppliers, which funds their growth.

    Prompt: "Calculate the Cash Conversion Cycle for this business using the last 12 months of data. Show DIO, DSO, and DPO individually. Compare to the industry average for distribution companies (DIO: 45 days, DSO: 38 days, DPO: 42 days). Identify which component is the biggest opportunity for improvement and suggest two specific actions."

    AI Cash Flow Forecasting Tools

    ToolWhat It DoesIntegrationsPricing
    FloatCash flow forecasting and scenario planningXero, QuickBooks OnlineFrom $59/mo
    PulseCash flow management for small businessesManual or QuickBooksFrom $29/mo
    DryrunCash flow forecasting with scenario modelingQuickBooks, Xero, FreshBooksFrom $49/mo
    JiravFP&A platform with cash flow forecastingQuickBooks, Xero, NetSuiteFrom $500/mo
    CentimeAP/AR automation with cash flow forecastingQuickBooks, NetSuiteCustom pricing

    Building a 13-Week Cash Flow Forecast

    The 13-week cash flow forecast is the standard short-term forecasting tool used by CFOs, turnaround professionals, and lenders:

    Prompt: "Create a 13-week rolling cash flow forecast template with these categories: Opening Cash Balance, Operating Receipts (split by customer collections, other income), Operating Disbursements (split by payroll, rent, suppliers, insurance, utilities, taxes, other), Net Operating Cash Flow, Investing (capex), Financing (loan payments, line of credit draws), Net Cash Flow, Closing Cash Balance. Include a 'variance' column comparing forecast to actual for the current week."

    Scenario Planning

    AI excels at running multiple scenarios quickly:

    ScenarioKey AssumptionsPurpose
    Base caseCurrent trends continue, no major changesThe working forecast
    Best case15% revenue increase, DSO improves by 5 daysUpside planning (hiring, expansion)
    Worst case20% revenue decline, largest customer delays 30 daysStress testing — can the business survive?
    Seasonal stressQ1 revenue drops 40% from Q4 (normal seasonality)Planning for predictable cash crunches

    Prompt: "Using this 12-month cash flow history, create three scenarios for the next quarter: base case (current trends), optimistic (revenue +15%, DSO improves 5 days), and pessimistic (revenue -20%, largest customer pays 30 days late). For each scenario, show the weekly closing cash balance and flag any weeks where the balance drops below $50,000."

    Working Capital Optimization

    AI can identify specific levers to improve working capital:

    Accounts Receivable

  • AI-powered collections: Tools like Tesorio and YayPay prioritize collection calls based on payment history, invoice age, and customer risk score
  • Payment prediction: AI predicts which invoices will be paid late based on historical patterns — allowing proactive follow-up before the invoice is overdue
  • Dynamic discounting: Offer early payment discounts to customers who AI identifies as likely to accept (e.g., "2/10, net 30" to customers with strong cash positions)
  • Accounts Payable

  • Payment timing optimization: AI determines the optimal payment date for each supplier — early enough to capture discounts, late enough to preserve cash
  • Supplier risk monitoring: AI flags suppliers showing signs of financial distress (late deliveries, quality issues) — helping you diversify before a disruption
  • Key Takeaways

  • Inventory forecasting is pattern recognition — AI's sweet spot. Feed it 12-24 months of sales history, seasonal patterns, and lead times, and it produces forecasts far more accurate than manual spreadsheet methods.
  • Cash flow is more important than profit. Profitable businesses fail when they run out of cash. A 13-week rolling forecast, updated weekly, is the minimum standard for cash management.
  • The Cash Conversion Cycle is your single most important working capital metric. Know your DIO, DSO, and DPO. Improving any one of them by 5 days can free up significant cash.
  • Platform-specific constraints matter. Amazon FBA storage fees and IPI scores, Shopify multi-location rules, and seasonal demand patterns all affect inventory decisions. Include these in your AI prompts for relevant forecasts.
  • Scenario planning is where AI adds the most value. Running three scenarios manually takes hours. AI can generate base, best, and worst cases in minutes, giving you and your clients the information needed to make better decisions.
  • This is chapter 5 of AI for Commerce & Finance (Global).

    Get the full hands-on course — free during early access. Build the complete system. Your projects become your portfolio.

    View course details