AI demand forecasting predicts how many units of each SKU customers will buy, as a range with a confidence level rather than one guessed number, and updates as new sales, prices and promotions arrive. Dynamic pricing is the other half: it uses that forecast, your stock position and your margin rules to decide what to charge and when. Together they replace “last year plus a gut multiplier” with a loop that keeps learning, which is what protects margin in an ecommerce catalog.
Most ecommerce operators are sitting on a prediction problem they solve by hand. A buyer looks at last year’s numbers, adds a percentage for expected growth, and calls it a forecast. That works until a competitor drops prices on a Thursday afternoon, a category trends on a Tuesday, or a supplier delay reshapes availability by the weekend. Then the store overstocks, understocks, or gives away margin trying to react.
I have been writing software since 1994 and spent years as the Magento lead for brands such as Yamaha USA, simplehuman and The Coffee Bean & Tea Leaf. The pattern in every catalog I have worked on is the same: the data to forecast better already exists in the store, the ERP and the warehouse system. It just is not flowing to anything that learns from it. This post covers what AI demand forecasting and AI dynamic pricing actually are, how to build them without ripping out your stack, and where the honest limits are.
What Is AI Demand Forecasting?
Demand forecasting is estimating future unit sales for a product in a place over a period: this SKU, this channel, next week. AI demand forecasting does the same job with machine learning models that learn from many signals at once instead of a single trend line. The model sees sales history, but also price changes, promotions, holidays, stockouts, and the way related products move together.
The useful output is not “we will sell 140 units.” It is a distribution: a likely middle, a plausible low and a plausible high. That is exactly what the M5 forecasting competition, run on Walmart’s hierarchical unit sales, asked of its entrants in the uncertainty track: nine quantiles, from 0.005 to 0.995, that “sufficiently describe the complete distributions of future sales” (Makridakis et al., 2021).
Point Forecasts vs Probabilistic Forecasts
A point forecast gives one number and hides how sure it is. A probabilistic forecast tells you how wide the uncertainty is, and that changes purchasing. A tight range on a high-margin staple says go deep on inventory. A wide range on a trend-driven item says hedge: order less up front and keep a faster reorder option open. Buying against the range instead of the midpoint is where most of the value shows up.
Demand Forecasting vs Demand Planning
These two get used interchangeably and they are not the same thing. Forecasting is the estimate. Planning is the business process that turns the estimate into purchase orders, allocations, promotions and cash commitments. AI makes the forecast better and faster; it does not replace the planner who decides how much risk the business will carry on a given product.
| Term | What it answers | Who owns it |
|---|---|---|
| Demand forecasting | How many units will customers buy, and how sure are we? | Model, checked by analysts |
| Demand sensing | What do the last few days of signals say about the next few? | Model, short horizon |
| Demand planning | What do we order, where do we put it, and when? | Buyers |
| Dynamic pricing | What should this SKU cost right now, given demand and stock? | Engine, inside your rules |
Why Traditional Forecasting Falls Apart at Scale
The problem with spreadsheet forecasting is not that it is unsophisticated. It is that it is static. A forecast built in January reflects January’s data, and by March the business is executing against a model that no longer matches reality.
One Rule for Every SKU
Traditional forecasting also tends to treat every SKU the same way. A bestseller gets the same logic as a slow mover, so both are probably wrong: the bestseller is undersupplied in its peak window and the slow mover is over-ordered and sits in a warehouse. With a small catalog, a good team can manage that by hand. As the catalog grows into thousands of SKUs, the errors multiply faster than people can correct them. Many of those SKUs also sell intermittently, with lots of zero days, which is one of the specific conditions the M5 benchmark was designed to test (Makridakis et al., 2021).
Spreadsheet forecast
last year plus a multiplier
- Granularity
- Category or top sellers
- Update cadence
- Quarterly or seasonal
- Inputs
- Past sales
- Output
- One number
- Stockout days
- Read as low demand
AI demand forecast
a model that keeps learning
- Granularity
- Every SKU, every channel
- Update cadence
- As new data lands
- Inputs
- Sales, price, promotions, calendar, stock
- Output
- A range with confidence
- Stockout days
- Flagged as lost demand
The Compounding Cost of Getting Demand Wrong
Overstock is not just a storage problem. It creates pressure to discount, discounting teaches customers to wait for sales, and that erodes full-price sell-through for seasons afterward. Stockouts are worse: a shopper who cannot find what they came for buys it somewhere else, and if it happens twice they may not come back. Across retail, IHL Group puts the combined cost of out-of-stocks and overstocks at $1.73 trillion annually (IHL Group, 2025). Your share of that number is the budget case for forecasting.
How to Use AI for Demand Forecasting
This is the sequence I would follow for an ecommerce catalog. The order matters, because each step depends on the one before it.
- Audit the data you already have. Order lines, returns, inventory snapshots, price history and promotion calendars usually live in different systems. List where each one is, how far back it goes, and how clean it is.
- Build a SKU-by-day sales history. One row per SKU, channel and day, with the price that day, whether it was on promotion, and whether it was in stock. Days with zero stock are lost demand, not zero demand.
- Set a baseline. Record how accurate your current method is on past periods. Without a baseline you cannot tell whether the model is an improvement.
- Train and backtest the model. Fit it on older history and score it on later periods it has not seen, SKU by SKU, against the baseline.
- Output ranges, not points. Produce a low, middle and high for each SKU and horizon so buyers can decide how much risk to carry.
- Wire it into reorder points. Feed the forecast into the purchasing tools your team already uses, and flag fast movers trending up and slow movers slowing down.
- Monitor and retrain. Track forecast error every week. When it drifts, find out why before you retrain.
What the Walmart M5 Benchmark Teaches
The M5 competition is the best public test of retail forecasting I know of. Entrants forecast 42,840 hierarchical Walmart unit-sales series and submitted 30,490 point forecasts at the lowest level, which were summed up to estimate every level above (Makridakis et al., 2022). Compared with earlier M competitions, it expanded the number of machine learning methods, added explanatory variables alongside the sales data, used grouped and correlated series, and focused on series with intermittent demand (Makridakis et al., 2021). That is a close description of a real ecommerce catalog, and it is why I point clients to those papers before any vendor deck.
The midpoint of a forecast is the least interesting number in it. How wide the range is tells you where to go deep, where to hedge, and where a faster reorder is worth paying for.
How Does AI Dynamic Pricing Work?
Demand forecasting tells you what will sell. Dynamic pricing decides what to charge for it, and when. Most ecommerce pricing is still reactive: a competitor drops a price, someone notices, someone updates a spreadsheet, someone queues the change. By then the window has passed, or worse, you matched a cut you did not need to match because your stock position or your customers are different.
AI dynamic pricing watches several inputs at once: the demand forecast, your inventory by SKU, competitor prices, cost and margin, and how the product converts at its current price. When conditions shift, the engine proposes or sets a new price inside rules your team defines, then writes it back to the store.
Guardrails and Business Rules Still Matter
A pricing system without guardrails is a liability. The version that works is AI-assisted pricing with human-defined boundaries: minimum margin floors, maximum discount depths, and category rules that stop the engine from racing a competitor to the bottom. The system optimizes inside those rules. A pricing manager who used to watch competitor listings by hand defines the strategy once and lets the engine apply it across the catalog, with every change logged and reversible.
When to Raise Prices, Not Just Lower Them
Most talk about dynamic pricing is about cutting prices to compete. A good pricing engine also knows when to raise them. If stock on a high-demand item is tightening, competitors are selling out, and the product converts well without a discount, the signal is to hold or raise the price, not to protect volume you cannot fulfill anyway. That upside is hard to capture on a weekly manual pricing cadence, because the window usually closes before anyone reviews it.
How Prices Reach the Store
The last step is mundane but it is where projects stall. On Magento and Adobe Commerce, the REST API can set base, special, tier and cost prices for many products in one call, and a special price can carry a start and end time so a demand-driven price expires on its own (Adobe Commerce developer docs). A pricing engine that writes through that endpoint needs no new checkout, theme or plugin on the storefront.
{
"prices": [
{
"price": 29.95,
"store_id": 0,
"price_from": "2017-07-15 00:00:00",
"price_to": "2017-07-16 23:59:59",
"sku": "24-WB06"
}
]
}
Is Dynamic Pricing Legal?
This is one of the most searched questions about dynamic pricing, and the answer depends on what the price is based on. Changing prices because of demand, inventory, cost or competitor moves is ordinary retail practice. Setting different prices for different people based on their personal data is a different thing, and regulators are watching it.
In January 2025 the FTC released preliminary findings from its study of “surveillance pricing,” in which “the same product could have a different price or promotion based on a variety of inputs—including consumer-related data.” Staff found that signals like a person’s precise location, browser history, mouse movements and products left in a cart can be used to tailor prices (FTC, 2025).
I build pricing engines on product-level signals: demand, stock, cost and competitor prices. Individualized pricing from personal data carries real regulatory and brand risk. This is not legal advice; check with counsel for the markets you sell into.
The Integration Reality: What You Are Actually Connecting
Demand forecasting and dynamic pricing are not standalone tools. They sit inside a data flow that connects the commerce platform, inventory, purchasing and pricing. The technical lift is real, but it is not a rebuild. Most stores already have the data; the gap is in how it flows, how it is processed, and how it surfaces into decisions. If your data still moves by nightly CSV exports, start with modernizing the data pipeline for AI before you pick a model.
| System | What it contributes | What it gets back |
|---|---|---|
| Store (Magento, Shopify) | Orders, returns, prices, promotions | New prices through its API |
| Inventory or WMS | Stock by SKU and location, stockout days | Reorder flags |
| ERP or purchasing | Costs, supplier lead times, open POs | Order quantities with ranges |
| Marketing calendar | Planned promotions and launches | Expected promo lift |
I take an integration-first approach. I do not propose replacing a working Shopify store or ERP because a new system would be theoretically cleaner. The forecasting and pricing layers connect to what you have: predictions land in the tools your team already uses, reorders go through your existing supplier workflow, and prices update through your platform’s API. For the wider version of that approach, see how to integrate AI into an existing business.
Data Quality Is the Real Constraint
The most honest thing I can tell any ecommerce operator considering this build: the constraint is almost never the model. It is the data. Systems built to process transactions were not built to be queried for forecasting inputs. History is fragmented across platforms, stockout days are not recorded, promotions live in someone’s calendar rather than a table, and SKUs get renamed. That is why the scoping work matters more than model selection. Before any integration code is written, answer four questions: what data do we have, how clean is it, what is missing, and how do we fill the gaps? The answers decide what is possible in month one versus month six.
How to Judge Results Honestly
The AI vendor landscape is full of inflated ROI claims, and I will not add another number to it. Judge a forecasting and pricing build on your own data: forecast error against your baseline, stockout days and overstock on the SKUs it manages, full-price sell-through, and gross margin. Run the new forecast in parallel with the old method for a few cycles before you let it drive purchasing, and roll pricing out to one category with tight guardrails before the whole catalog. A system that is refined over time beats one that is set up and forgotten.
Who Should Build AI Forecasting and Pricing Now
Not every store is ready for custom forecasting infrastructure. The signals that you are: a catalog too large to forecast SKU by SKU by hand, real seasonality or trend sensitivity in your categories, enough clean transaction history to learn from, and buying decisions that still come down to last year’s numbers plus a gut multiplier. If you recognize recurring overstock write-offs, stockout apologies and margin given away on reactive price cuts, the status quo already has a cost.
If you are earlier than that, start smaller. Clean up the data, record stockouts, and put price and promotion history in one place. The same groundwork supports AI personalization for ecommerce and makes every later AI project cheaper.
Frequently Asked Questions
How do you use AI for demand forecasting?
Start with clean SKU-by-day sales history that marks stockout days, add the drivers you control (price, promotions, calendar), and backtest a model against your current method before trusting it. Have it output a range per SKU, not one number, and feed that range into reorder points your buyers already use.
What is the difference between demand forecasting and demand planning?
Demand forecasting estimates what customers will buy. Demand planning is the business process that turns that estimate into purchase orders, allocations and promotions. AI improves the forecast; people and rules still own the plan.
How does AI dynamic pricing work?
A pricing layer reads demand forecasts, inventory positions, competitor prices and margin data, then proposes or sets prices inside rules your team defines, such as minimum margin and maximum discount. The approved prices are written back to your store through its API, often as scheduled special prices.
Is dynamic pricing legal?
Changing prices based on demand, inventory or cost is common and generally lawful, but it is not a legal free-for-all. The FTC has studied surveillance pricing, where personal data such as location or browsing history is used to set individualized prices, so pricing on personal data carries more regulatory risk than pricing on product and market signals. Check with counsel for your market.
How accurate is AI demand forecasting?
It depends on the data, the category and the forecast horizon, so treat any single accuracy number from a vendor with suspicion. The honest test is a backtest on your own history: run the model and your current method over the same past periods and compare the errors SKU by SKU.
What data do I need for AI demand forecasting?
At minimum, order-line history by SKU and day, inventory positions so stockout days are not mistaken for zero demand, and your price and promotion history. Returns, marketing calendars and supplier lead times make the forecast and the reorder logic much more useful.
Want a straight answer on forecasting and pricing?
Tell me about your catalog and your data, and I will tell you honestly what an AI demand forecasting or pricing build would take, and whether it is worth doing yet. The first conversation is free.