We develop a structural demand model that captures the effect of out-of-stocks on customer choice. 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. We estimate our model using sales data from multiple stores for twenty-four items in the shampoo product category. In addition, we illustrate how the model can be used to assist the decisions of a retailer 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 simple policies that can be used to help mitigate the negative economic impact of out-of-stocks.