Quantity Flexibility contract coordinates individually motivated supplier and buyer to the systemwide optimal outcome by effectively allocating the costs of market demand uncertainty. The main feature of the contract is to couple the buyer's commitment to purchase no less than a certain percentage below the forecast with the supplier's guarantee to deliver up to a certain percentage above.
In this paper we refine the previous models by adding some realistic features including the upper and lower limits of the purchase. We also incorporate purchase and canceling costs in a cost function to reflect the real world contracting process more accurately. To obtain the solution of the model, we derive a condition for extreme points using the Leibniz’s rule and construct an algorithm for finding the optimal solution of the model. Several examples illustrating the algorithm show that the approach is valid and efficient.