It is typically less profitable for an opportunistic borrower to divert inputs than to divert cash. Suppliers, therefore, may lend more liberally than banks. This simple argument is at the core of our contract theoretic model of trade credit in competitive markets. The model implies that trade credit and bank credit can be either complements or substitutes depending on, amongst other things, the borrower's wealth. The model also explains why firms both take and give costly trade credit even when the borrowing rate exceeds the lending rate. Finally, the model suggests reasons for why trade credit is more prevalent in less developed credit markets and for why accounts payable of large unrated firms are more countercyclical than those of small...