- [JSON representation](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TransitPreferences#SCHEMA_REPRESENTATION)
- [TransitTravelMode](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TransitPreferences#TransitTravelMode)
- [TransitRoutingPreference](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TransitPreferences#TransitRoutingPreference)

Preferences for `TRANSIT` based routes that influence the route that is returned.

| JSON representation |
|---|
| ``` { "allowedTravelModes": [ enum (`https://developers.google.com/maps/documentation/routes/reference/rest/v2/TransitPreferences#TransitTravelMode`) ], "routingPreference": enum (`https://developers.google.com/maps/documentation/routes/reference/rest/v2/TransitPreferences#TransitRoutingPreference`) } ``` |

| Fields ||
|---|---|
| `allowedTravelModes[]` | ``enum (`https://developers.google.com/maps/documentation/routes/reference/rest/v2/TransitPreferences#TransitTravelMode`)`` A set of travel modes to use when getting a `TRANSIT` route. Defaults to all supported modes of travel. |
| `routingPreference` | ``enum (`https://developers.google.com/maps/documentation/routes/reference/rest/v2/TransitPreferences#TransitRoutingPreference`)`` A routing preference that, when specified, influences the `TRANSIT` route returned. |

## TransitTravelMode

A set of values used to specify the mode of transit.

| Enums ||
|---|---|
| `TRANSIT_TRAVEL_MODE_UNSPECIFIED` | No transit travel mode specified. |
| `BUS` | Travel by bus. |
| `SUBWAY` | Travel by subway. |
| `TRAIN` | Travel by train. |
| `LIGHT_RAIL` | Travel by light rail or tram. |
| `RAIL` | Travel by rail. This is equivalent to a combination of `SUBWAY`, `TRAIN`, and `LIGHT_RAIL`. |

## TransitRoutingPreference

Specifies routing preferences for transit routes.

| Enums ||
|---|---|
| `TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED` | No preference specified. |
| `LESS_WALKING` | Indicates that the calculated route should prefer limited amounts of walking. |
| `FEWER_TRANSFERS` | Indicates that the calculated route should prefer a limited number of transfers. |