# Upsert order-vehicle restriction set

Create or update an order-vehicle restriction set. A unique ID is required to identify the order-vehicle restriction set.
Calling this endpoint with an existing ID will update the order-vehicle restriction set.

Endpoint: PUT /settings/order-vehicle-restriction-sets/{id}
Version: 1.27.0
Security: clientCredentials

## Security:

  - `clientCredentials` (unknown)
    oauth2

## Path parameters:

  - `id` (string, required)
    The unique identifier of an entity

## Header parameters:

  - `If-Match` (string)
    Weak Etag used for optimistic locking.

## Request fields (application/json):

  - `name` (string, required)
    The name of the order-vehicle restriction set
    Example: Heavy goods require large trucks

  - `order_vehicle_restrictions` (array, required)
    List of order-vehicle restrictions in this set

  - `order_vehicle_restrictions.order` (object, required)
    A label condition for order-vehicle restrictions. The `INCLUDING` operator matches items that have the label; `EXCLUDING` matches items that do not have the label.

  - `order_vehicle_restrictions.order.label` (string, required)
    Example: fragile

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

  - `order_vehicle_restrictions.type` (string, required)
    Defines the relationship between the order label and vehicle label:
- `FORBIDDEN_COMBINATION` - Orders with the specified label are penalized when assigned to vehicles with the specified label.
- `ORDER_REQUIRES_VEHICLE` - Orders with the specified label require vehicles with the specified label; a fine is applied if assigned to a different vehicle.
- `VEHICLE_REQUIRES_ORDER` - Vehicles with the specified label require orders with the specified label; a fine is applied if assigned different orders.
    Enum: "ORDER_REQUIRES_VEHICLE", "FORBIDDEN_COMBINATION", "VEHICLE_REQUIRES_ORDER"

  - `order_vehicle_restrictions.enforcement` (object, required)
    The enforcement of an order-vehicle restriction.
When `type` is `SOFT`, `violation_cost` is required. When `type` is `HARD`, `violation_cost` must be absent.

  - `order_vehicle_restrictions.enforcement.type` (string, required)
    The enforcement type of the restriction:
- `HARD` — The restriction is strictly enforced and no `violation_cost` applies.
- `SOFT` — The restriction is enforced with a `violation_cost` applied when violated during planning.
    Enum: "SOFT", "HARD"

  - `order_vehicle_restrictions.enforcement.violation_cost` (number)
    Violation cost applied when a SOFT restriction is violated during planning. Required when `type` is `SOFT`, absent when `type` is `HARD`.
    Example: 42.5

## Response 201:

  - `201` (unknown)
    order-vehicle restriction 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"

## Response 204:

  - `204` (unknown)
    order-vehicle restriction set updated successfully

## Response 204 headers:

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

## 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

## Response 412:

  - `412` (unknown)
    This status is returned when an entity is updated with an outdated version in the If-Match header.

## Response 412 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.

