**European Economic Area (EEA) developers**

> [!NOTE]
> If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](https://developers.google.com/maps/comms/eea/faq.md.txt).

When you are computing a route matrix, you might want to take into consideration
any toll fees on the routes in the matrix. For select cities, you can compute
the estimated toll fee for a route in the appropriate currency.

To get tolls for a route, see
[Calculate tolls fees for a route](https://developers.google.com/maps/documentation/routes/calculate_toll_fees.md.txt).

For the list of supported toll locations, see the reference for
[TollPass](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteModifiers.md.txt#tollpass).

> [!CAUTION]
> **Caution:** Requests that calculate toll fees are billed at a higher rate. [Learn more about billing](https://developers.google.com/maps/documentation/routes/usage-and-billing.md.txt) for the Routes API.

## Route matrix toll example

The following example uses the
[`computeRouteMatrix`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRouteMatrix.md.txt)
method to return toll information on a route with an estimated
price when a toll pass is used:

- Set the `extraComputations` array field to `TOLLS` to enable the calculation
  of toll information.

- Specify the vehicle type and the toll pass type by using the
  `routeModifiers` field of the *origin* waypoints of the request. The toll
  price returned is based on the pricing used by the specified vehicle type
  and pass. If more than one pass is specified, the least expensive pricing is
  returned.

- Use the [response field mask](https://developers.google.com/maps/documentation/routes/choose_fields.md.txt) to configure the method to
  return toll information in the response. Specify
  `routes.travelAdvisory.tollInfo` to return information for the entire route.

> [!NOTE]
> **Note:** Route matrix does not return detailed route information, such as the legs, steps, and polylines of the route. To obtain detailed route information, pass a single origin and single destination to [Compute
> Routes](https://developers.google.com/maps/documentation/routes/compute_route_directions).

### Request for a route matrix toll information

```console
curl -X POST -d '{
"origins": [
  {
    "waypoint": {
      "location": {
        "latLng": {
          "latitude":42.340173523716736,
          "longitude":-71.05997968330408
        }
      }
    },
    "routeModifiers": {
      "vehicleInfo":{
        "emissionType": "GASOLINE"
      },
      "tollPasses": [
        "US_MA_EZPASSMA",
        "US_WA_GOOD_TO_GO"
      ]
    }
  }
],
"destinations": [
  {
    "waypoint": {
      "location": {
        "latLng": {
          "latitude":42.075698891472804,
          "longitude": -72.59806562080408
        }
      }
    }
  }
],
"travelMode": "DRIVE",
"extraComputations": ["TOLLS"]
}' \
-H 'Content-Type: application/json' \
-H 'X-Goog-Api-Key: YOUR_API_KEY' \
-H 'X-Goog-FieldMask: originIndex,destinationIndex,travel_advisory.tollInfo,duration,distanceMeters,status' \
'https://routes.googleapis.com/distanceMatrix/v2:computeRouteMatrix'
```

### Response for route matrix toll information

The response contains information on tolls in a
[TollInfo](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TollInfo.md.txt) (REST) or
[TollInfo](https://developers.google.com/maps/documentation/routes/reference/rpc/google.maps.routing.v2.md.txt#tollinfo) (gRPC) object.

To configure the method to return toll information, use the
[response field mask](https://developers.google.com/maps/documentation/routes/choose_fields.md.txt) to set the `travelAdvisory.tollInfo` field
in the mask.

```json
[
  {
    "originIndex": 0,
    "destinationIndex": 0,
    "status": {},
    "distanceMeters": 150338,
    "duration": "5382s",
    "travelAdvisory": {
      "tollInfo": {
        "estimatedPrice": [
          {
            "currencyCode": "USD",
            "units": "4",
            "nanos": 400000000
           }
        ]
      }
    }
  }
]
```