Unlike previous research, this study develops an integrated inventory model for controllable lead time with defective items, errors in inspection, and variable lead time considering sustainability. The research investigates the effect of controlling lead time and capital investment in the setup cost. We assume that the buyer receives a lot size that may contain some defective items with a known defective probability. The buyer’s inspector conducts a 100% quality inspection and may incorrectly classify a non-defective item as a defective item (type one (I) error) or incorrectly classify a defective item as a non-defective item (type two (II) error). The mathematical inventory model considering carbon emission cost is developed, and the solution procedure is designed using the heuristic algorithm to derive the optimal or near optimal solution. Finally, numerical examples and sensitivity analysis are given to illustrate the results. The results show that the defective rate, and type I type II inspection errors, have a significant impact on the shipment lot. This leads to the changes in the total cost, lead time, and the carbon emissions. Our study provides cost savings of 4.39% and carbon emission savings of 28.44%.Graphic abstract