In the present study, a mathematical model is provided for inventory management in a three-level supply chain including a supplier, a manufacturer, and a distributor, taking into account the potential for product deficiency. Significant parameters such as the optimal order size for raw materials, optimal production rate, optimal allowed deficiencies at each supply chain level, the of the vehicles and the number of times the products are delivered between the supply chain components have been provided aiming at minimizing inventory management costs in the supply chain. The problem was solved using a heuristic algorithm. The proposed model is implemented for 20 different numerical examples. According to the results, the difference between the solutions obtained from the algorithm and the solutions obtained from the optimal values with the real variables is an average of 1.52%.