# Create vehicle stop rule set

Create a new vehicle stop rule set

Endpoint: POST /settings/vehicle-stop-rule-sets
Version: 1.27.0
Security: clientCredentials

## Security:

  - `clientCredentials` (unknown)
    oauth2

## Request fields (application/json):

  - `id` (string)
    Example: cb1fb12c-0abc-413c-a69d-63c62566685f

  - `name` (string, required)
    The name of the vehicle stop rule set
    Example: Urban delivery stop limits

  - `rules` (array, required)
    List of vehicle stop rules. When multiple rules match for a single vehicle, all their distinct effects are applied.
If two matching rules set the same effect (e.g., both set a stop cost), only the value from the first matching rule is used for that effect.

  - `rules.name` (string, required)
    The name of the rule
    Example: Sprinter

  - `rules.conditions` (array, required)
    Conditions to match vehicles. A rule matches if any of the conditions matches. At least one condition is required. Use ALL to match all vehicles. Combining ALL with other conditions is not allowed.

  - `rules.conditions.label` (string)
    A vehicle label to match. Required for INCLUDING and EXCLUDING operators, must not be set for ALL.
    Example: sprinter

  - `rules.conditions.operator` (string, required)
    Enum: "ALL", "INCLUDING", "EXCLUDING"

  - `rules.effects` (object, required)
    Effects to apply when the rule matches. At least one of max_stops or cost_per_stop must be specified.

  - `rules.effects.max_stops` (object)
    Maximum number of stops. At least one of per_route or per_trip must be specified.

  - `rules.effects.max_stops.per_route` (integer)
    Maximum number of stops per route
    Example: 20

  - `rules.effects.max_stops.per_trip` (integer)
    Maximum number of stops per trip
    Example: 5

  - `rules.effects.cost_per_stop` (number)
    Cost added per stop for matching vehicles
    Example: 5

  - `excluded_stop_locations` (array)
    Locations to exclude from stop counting. Applies to all rules in this set.

  - `excluded_stop_locations.label` (string, required)
    A location label to match
    Example: warehouse

  - `excluded_stop_locations.operator` (string, required)
    Enum: "INCLUDING", "EXCLUDING"

## Response 201:

  - `201` (unknown)
    vehicle stop rule set created successfully

## Response 201 headers:

  - `ETag` (string)
    A weak Etag (ex `W/"<etag_value>"`) which contains the current version of the entity
    Example: W/"25"

  - `Location` (string)
    Location of the created resource

## Response 400:

  - `400` (unknown)
    Bad request

## Response 400 fields (application/problem+json):

  - `type` (string, required)
    An absolute URI that identifies the problem type.  When dereferenced,
it SHOULD provide human-readable documentation for the problem type
(e.g., using HTML).
    Example: https://developer.conundra.eu/developer-portal/problem/#constraint-violation

  - `title` (string, required)
    A short, summary of the problem type. Written in english and readable
for engineers (usually not suited for non technical stakeholders and
not localized)
    Example: Bad Request

  - `status` (integer, required)
    The HTTP status code generated by the origin server for this occurrence
of the problem.
    Example: 400

  - `detail` (string, required)
    A human readable explanation specific to this occurrence of the
problem.
    Example: Bad request. See violations for more details.

  - `violations` (array)

  - `violations.field` (string)
    A reference to the field in the request that triggered this violation.
    Example: limit

  - `violations.message` (string, required)
    A message explaining the violation in the referenced field.
    Example: Limit must be strictly positive.

## Response 401:

  - `401` (unknown)
    Authentication required

