We propose a simple theory of trade credit and prepayment. A downstream firm trades off inventory holding costs against lost sales. Lost final sales impose a negative externality on the upstream firm. We show that allowing the downstream firm to pay with a delay, an arrangement known as “trade credit,” is precisely the solution to the problem. Solving a reverse externality accounts for the use of prepayment for inputs, even in the absence of any risk of default by the downstream firm. We clarify previously unexplained facts including the universal presence of a zerointerest component in trade credit terms, and the non-responsiveness of interest charges to fluctuations in the bank rate as well as market demand. We explain why trade credit is short term credit and why the level of provision is negatively related to sales and profit and inventory, but positively related to the profit margin. Finally, we show that under trade credit, inventory investment is invariant to the real interest rate for a wide range of parameters, explaining the puzzle posed by Blinder and Maccini (1991). This implies that standard empirical inventory models would gain explanatory power by including the subsidy effect of accounts payable.