# setRouteOptions

Command (Guidance).

Sets new route options

Sets how BeNav computes routes and presents them: fastest or shortest, whether motorways, tolls,
ferries, unpaved roads and border crossings are allowed, whether traffic is used and whether the route
is recalculated when it changes, plus units and map theme.

This is how a client application applies its own routing policy to every journey, instead of
depending on whatever each driver happens to have set. Only the fields sent are changed (everything
omitted keeps its current value) and if a journey is already running it is recomputed straight away
with the new settings.

**Worth knowing**

- Nothing stops the driver changing these back afterwards. Pair it with
  [`lockSettings`](https://docs.benomad.com/benav-rnc/commands/lock-settings.md) when the configuration has to hold.
- If any value in the command is not recognised, nothing at all is applied and the response names
  the offending fields: the settings never end up half-changed.

**Example: enforcing a no-toll policy**

A haulier does not reimburse tolls. Its application sends `setRouteOptions` with
`toll: false` when the driver starts a shift, then [`lockSettings`](https://docs.benomad.com/benav-rnc/commands/lock-settings.md) so the toll
switch is greyed out on the device. Every route BeNav computes that day avoids toll roads, and the
setting cannot be quietly turned back on.

> **Note:** `routeMode` accepts only `FASTEST` and `SHORTEST`; `ECO` is rejected. If any provided value is unrecognised the command answers `-32700` with a message naming the offending fields (e.g. `parse.error: routeMode, units`) and **nothing is applied**.

## Command

```json
{
  "jsonrpc": "2.0",
  "method": "setRouteOptions",
  "params": {	
    "routeMode": "FASTEST",
    "crossing": true,
    "ferry": true,
    "motorway": true,
    "sideArrival": false,
    "toll": true,
    "traffic": true,
    "autoReroute": true,
    "unpaved": true,
    "altRoutes": true,
    "units": "IMPERIAL",
    "showVehicleProfileName": false,
    "showRestrictions": false,
    "mapDisplayMode": "DARK"
  },
  "id": "1"
}
```

- `routeMode` Possible values \[`FASTEST`\|`SHORTEST`\].
- `crossing` Allow or disallow border crossing (if possible) \[`true`\|`false`\] (default `true`)
- `ferry` Ferry allowed \[`true`\|`false`\] (default `true`)
- `motorway` Motorway allowed \[`true`\|`false`\] (default `true`)
- `sideArrival` Arrival on defined destination side or not \[`true`\|`false`\] (default `true`)
- `toll` Toll roads allowed \[`true`\|`false`\] (default `true`)
- `traffic` Take into account traffic jams during route calculations (if traffic service available) \[`true`\|`false`\] (default `true`)
- `autoReroute` Auto-reroute when traffic information is updated (if `traffic` is enabled) \[`true`\|`false`\] (default `false`)
- `unpaved` Unpaved roads allowed \[`true`\|`false`\] (default `false`)
- `altRoutes` Alternative routes enabled or disabled \[`true`\|`false`\] (default `true`)
- `units` Possible values \[`METRIC`\|`IMPERIAL`\]. (default `METRIC`)
- `showVehicleProfileName` Show vehicle profile's name on the map (default `false`)
- `showRestrictions` Show vehicle restrictions on map (default `true`)
- `mapDisplayMode` Possible values \[`LIGHT`\|`DARK`\|`AUTO`\]. (default `LIGHT`)

## Response

Generic Command responses.
