Recommender systems are the basic component for e-commerce platforms. They offer consumers personalized product or content recommendations that align closely with their interests. Existing studies mainly focus on designing personalization techniques to improve the accuracy of recommendation results. When making recommendation, they often overlook product inventory information or assume unlimited product availability. This leads to situations where massive of recommended product are out of stock, thus impacting the shopping experience for users. In this study, we aim to consider both users’ personalized preferences and product inventory constraints, to optimize the recommender system. Specifically, we propose a neural collaborative filtering recommendation method via incorporating inventory constraints. Using the neural networks, the proposed model effectively infer users’ preferences for unconsumed products via learning the complex and nonlinear relationships between users and products. Using the inventory-aware penalty loss function, the propose model reduces the likelihood of low inventory being heavily recommended. Experimental results demonstrate that the proposed model can make accurate recommendations while concurrently reducing the occurrence of suggesting out-of-stock products. The proposed model provides important practical implications for e-commerce platforms, e.g., the matching of product demands and sellers’ inventory, and improving user shopping experience.