# Google Distance Matrix API

Google Distance Matix API for calculating dynamic delivery charges has been introduced in Foodomaa from **version 2.0**

### **How to enable Google Distance Matrix API?**

#### Steps:

* Login to your Google Cloud Console and enable the "**`Distance Matrix API`**"<br>
* Login to Foodomaa Admin Panel and enable Distance Matrix API from  **`Admin > Settings > Customer Application > Use Google Distance Matrix API`**

### Important Notes

* Google Distance Matrix  API calculation is only done on the Cart and not for listing the stores on the Homepage. For store listing, we rely on the geographical distance between the customer and the store. <br>
* Google Distance Matrix API only works when the store is configured for dynamic delivery charges. <br>
* If the distance between the customer and the store cannot be covered by Driving, Google Distance Matrix API will not return any value for calculations, so in this case, we fall back to the older method of calculation using the Geographical distance between the customer and the store. \
  **Example**: \
  There is no driving road path between a certain location in NewYork and Brazil, so Google Distance Matrix API doesn't return any data, in such cases, we rely on the Geographical calculations to get the distance between two points.


---

# 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.foodomaa.com/configurations/google-distance-matrix-api.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.
