All constraints have the following members. The constraint_type key is a string that refers to the actual type of constraint. If any unsupported or unknown constraint_types are sent in the request, an error is returned.
|constraint_name||string||N||Human readable name of the constraint.|
|constraint_type||string||N||One of the named types in the constraint list below.|
|penalty_per_violation||double||N||Numeric value that quantifies the amount of penalty assigned to each violation of the constraint.|
|violation_increment||int||Y||For constraints that involve a numerical threshold, an additional penalty_per_violation is assessed for every violation_increment units over the threshold. For example, if a constraint specifies that no route should last more than 500 minutes of total time with a penalty of 100, and you specify a violation_increment of 10, then a route of 523 minutes would receive a penalty of 300. 100 is for the initial violation, and then 2 x 100 more for exceeding the threshold by 23.|
For many constraints, it is possible to fully specify them with just the members above since they may access data inside the order objects for example. However, many other constraint types require additional data specific to that constraint. Each constraint is described with an example in the Constraint API Descriptions.