When a buyer and a seller meet in the market, both need to decide quantity and price. However, often they also argue when to transfer the payment. In one extreme, the seller may demand early payment before delivering the goods. In the other, the buyer can demand late payment after receiving the products/services. The former is sometimes called cash in advance, while the latter is called trade credit. Understanding the use of trade credit is essential because it is one of the main sources of short-term finance for firms. Additionally, since each trade contract specifies prices, quantities, and payment delay, the contract is implicitly defining who is responsible for financing the production and who bears the risk of default, which can itself be a deterrent to trade. My dissertation aims to study some of the novel factors that shape the use of trade credit and shed some light on its effects on a firm's decision to trade.The first chapter studies the firm-characteristics that shape the use of trade credit decisions in international trade. Trade credit is widely used in firm-to-firm transactions, domestically, and internationally. The literature has found that country-specific features, such as interest rates, legal institutions, the rule of law, and capital controls, affect the decision to extend trade credit. The literature has not studied additional features that might explain the trade credit provision in the international context; it also has not proposed additional theories.To fill this gap, I exploit transaction-level data from Chilean customs. This data set, available for exporters and importers, includes information that describes if a given transaction was paid in advance or paid post-shipment (trade credit). Additionally, I merge this data with firm-level details provided by the Chilean Internal Tax Service. Using this data, I document new facts. Namely, large firms measured by several metrics are most likely to use trade credit compared to small firms. Motivated by these facts and to guide my empirical strategy, I propose a theory for the use of trade credit. The model has the critical assumption that firms, buyer and seller, may default on their contracts due to liquidity shocks. Depending on the size of the shock, the firm can deplete all its assets, which means it will default. This simple assumption will imply that larger firms will be less likely to default since they have enough assets to absorb the liquidity shock. The predictions of the model are confirmed using regression analysis; therefore, not only country-specific attributes but also firm characteristics affect the contract decision: large exporters (importers) are 15% (40%) more likely to sell (buy) under trade credit compared to small exporters (importers). I also find that a small exporter matched with a large importer is 3-10% more likely to sell under trade credit. In the second chapter, we propose a theory for the use of trade credit that connects the markup that the exporter charges to the decision of extending trade credit. The key idea is that under pre-payment, the buyer needs to pay the full amount to the seller before receiving the goods. This payment requires liquidity equal to the total invoice, which in turn corresponds to the production cost plus a markup. In contrast, extending trade credit might be cheaper since the seller only needs to cover its production costs in advance, which is lower than the intermediate price due to the presence of markups. If financial intermediation is costly and the lending interest rate is greater than the deposit rate, then this difference in liquidity needs between pre-payment and trade credit affects profits, affecting the decision to provide trade credit. We test the implications of the theory using Chilean data. First, we construct markup estimates at the firm-product level, using detailed data on inputs and outputs of Chilean plants using the methodology developed by De Loecker, Goldberg, Khandelwal, and Pavcnik (2016). We then use transaction-level Customs data with information on the payment choice to test the model's predictions. We find that trade credit use increases in the markup and that this effect is larger, the bigger the difference between the buyer's borrowing rate and the seller's deposit rate is. the final chapter proposes and tests an alternative theory. Trade credit is used as a quality guarantee. There are two main facts in existing theories that explain the use of trade credit. First, all these theories focus on explaining the extension of trade credit or not, but not the length of the contract. Secondly, and most importantly, some empirical evidence does not speak to these models. Particularly, most of the existing theories conclude that trade credit is used due to access to cheaper credit or as an enforcement mechanism, then restricting the credit period, say to 30 days maximum, should not alter those incentives. However, the finance literature has found that this type of regulation has effects on the economy. Some authors have found that limiting the trade credit period to 30 days has positive effects, from the seller's perspective, through more competition due to the increase in firm entrance and a decrease in exit rates. However, in the same literature, other papers have shown that these laws also have adverse effects, namely, a reduction in the likelihood and volume of trade. The previous evidence indicates that the length of trade credit is also essential to understand the decision and its impact on the firm's behavior. Following Long, Malitz, and Ravid (1993), I propose the theory that trade credit serves as a signal for the quality of the product. In a nutshell, the model assumes that when the quality is not observable, but verifiable ex-post, trade credit can serve as a signal of the product's quality. The logic of the theory is that a buyer will not pay the transaction until she is sure that what she bought is what was agreed upon. Additionally, in this model, trade credit maturity serves a quality guarantee. Longer maturities imply that the buyer has more time to verify the contracted quality. This theory has the main prediction that the provision and maturity of the trade credit are positively related to the quality of the product.To test these predictions, I use a data set from the Chilean Customs. This transaction-level data set has a unique feature: the number of days at which a transaction was paid, on the addition of the usual measures such as destination, price, and quantity. As for quality measures, I will follow two strategies. First, I will use an off-the-shelf methodology that infers quality from prices and quantities, assuming a particular demand elasticity. Secondly, I will focus my attention on a specific industry, wine. For wine, I web-scrapped information of ratings, awards, andretail prices under the assumption that this data captures wine quality.The data confirms the main predictions of the model. I find that high-quality goods are more likely to be sold under trade credit. Moreover, regarding the other predictions, I find that high-quality products have 20 more days of trade credit, out of an average of 100 days.