We develop a structural demand model that endogenously captures the effect of out-of-stocks on customer choice by simulating a time-varying set of available alternatives. Our estimation method uses store-level data on sales and partial information on product availability. Our model allows for flexible substitution patterns, which are based on utility maximization principles and can accommodate categorical and continuous product characteristics. The methodology can be applied to data from multiple markets and in categories with a relatively large number of alternatives, slow-moving products, and frequent out-of-stocks (unlike many existing approaches). In addition, we illustrate how the model can be used to assist the decisions of a store manager in two ways. First, we show how to quantify the lost sales induced by out-of-stock products. Second, we provide insights on the financial consequences of out-of-stocks and suggest price promotion policies that can be used to help mitigate their negative economic impact, which run counter to simple commonly used heuristics.