To reduce lead-time and its variability, modern supply and transportation contracts often specify the frequency of, and volume available for, future deliveries in advance even when final demand is somewhat uncertain (Yano and Gerchak [Yano, C. A., Y. Gerchak. 1989. Transportation contracts and safety stocks for just-in-time deliveries. Manufacturing and Oper. Management 2 314--330.]). We explore the joint optimization of contract parameters and inventory control policy in such environments. We first model and derive the optimal periodic review inventory policy corresponding to a given supply contract, which generates piecewise-linear convex ordering costs. The optimal policy has two critical levels, and there is a range of stock levels for which the quantity ordered equals the contract volume. To numerically compute the critical levels, we model consecutive inventory levels as a Markov Chain, whose steady-state distribution is used to compute the holding, shortage and transportation costs. We then use the resulting total costs to derive the optimal contract volume. Various examples are provided. The optimal contracted delivery frequency can also be computed.inventory-production, stochastic, transportation, models, dynamic programming, applications, probability, Markov processes