PurposeThe purpose of this paper is to maximize the average profit of the supply chain by calculating the order quantity, the number of shipments during the production time of the vendor, the number of shipments during the supply cycle of the vendor and the time when the retailer’s inventory level reaches to zero.Design/methodology/approachA production and inventory model for degrading commodities with stochastic demand and two-level partial trade credit in a supply chain is presented. The model’s applicability and the processes' feasibility for solving are verified by GAMS software with BARON.FindingsThe impact of the model’s parameters on the vendor and retailer’s average profit was found through sensitivity analysis. The effect of the model’s parameters on the supply chain’s average profit was also found. Moreover, the reasons for this effect were given.Practical implicationsFirst, decision-makers may use this model to increase the supply chain's average profit. Second, the proposed model takes a general form. Third, the policymakers can also adjust the model’s parameters according to their preferences to get the desired results.Originality/valueFirst, this paper develops an inventory and production model for perishable goods. Second, it is believed that the demand is random because the demand is affected by many factors, which make the study more realistic. Third, this paper studies production and inventory problems from the supply chain perspective. Finally, the interest for partial trade credit is calculated. The interest caused by stochastic shortages is also considered and calculated.