# Maximum Driving Distance

## Maximum Driving Distance Method&#x20;

The maximum driving distance method checks if the customer's location is eligible for delivery by checking the address that he put in the widget. That address will need to be within the driving distance you specified in your delivery condition settings

{% hint style="success" %}
To use this feature, you need a **Distance Matrix API key**
{% endhint %}

<mark style="background-color:purple;">How to get the API key:</mark>

**Step 1: Choose or create a new project**

1. Go to the [Google Cloud Console](https://console.cloud.google.com/home/dashboard)
2. Click the project drop-down and select or create the project for which you want to add an API key&#x20;

**Step 2: Create an API key**

1. Click the menu button and select Google Maps Platform > Credentials
2. On the Credentials page, click + Create Credentials > API key&#x20;

**Step 3: Enable Distance Matrix API**

1. Click the menu button and select APIs
2. On the APIs page, choose Distance Matrix API and enable it

{% embed url="<https://www.youtube.com/watch?v=oVoHv7EQvGs>" %}

{% hint style="success" %}
You have to own a paid Google Cloud Project to be able to get a valid API key.
{% endhint %}

{% hint style="success" %}
You can use the same API key and enable **Places API** if you also use Store pickup function and want to show your store location on the map.
{% endhint %}

## How Does The Maximum Driving Distance Method Work?

You will need to **enter your key location** and **pick the maximum driving distance** approved to deliver in the delivery conditions setting.

<figure><img src="/files/KQewBXL2Mk3qdguzHhQG" alt=""><figcaption></figcaption></figure>

Your customers will need to enter their address in the widget to check if delivery is available

![](/files/dG0SD2jsC19HGaXfql8T)

If the address that the customer entered in the widget falls within the driving distance you specified in your delivery condition settings, he will be able to proceed

![](/files/Y99VoeXw0WgoDMNZzmOb)

If the address that the customer entered in the widget is out of the radius you specified in your delivery condition settings, he will be unable to proceed further

![](/files/QTvYCyiHaIB0kue0ayFt)

## ​How To Enable The Maximum Driving Distance Method?

**Step 1**: At the DELIVERY LOCATION VALIDATOR section, tick to choose **Maximum driving distance**

**Step 2**: Enter your valid Google API key

**Step 3**: Type your key location to set the driving distance for

**Step 4**: Pick the country for your key location

**Step 5**: Pick the state/city for your key location

**Step 6:** Tick to choose means of transportation that wouldn't be counted in driving distance

**Step 7**: Decide to check radius restriction by **km** or **mile** and then pick the maximum radius that you allow to deliver

**Step 8**: Click the **Save** button

<mark style="background-color:purple;">\*Note:</mark>&#x20;

All of the fields must be filled in to have the method make sense. Therefore, kindly complete all fields without omitting any of them.

<figure><img src="/files/gaOrcDFDf8a9Yxk86bhf" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Reach out to us via the email <contact@omegatheme.com> if you stumble upon something hard to solve. Any messages from you are greatly appreciated!
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dingdoong.io/local-delivery/delivery-validator/maximum-driving-distance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
