# Google API

## Make a Google Project and enable APIs

To use the Maps JavaScript, Places API and Geolocation API you must have an API key. The API key is a unique identifier that is used to authenticate requests associated with your project for usage and billing purposes.

To get an API key:

1. Go to the [Google API Console](https://console.developers.google.com/).

&#x20;  2\. Click the project drop-down and select or create the project for which you want to add an API key.

![](https://2886676663-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M15aAl8UGIPUvccCl0n%2F-M8FTOU35UQDkXcz7TAB%2F-M8FWhdJnt9I3A8q4Cx1%2FScreenshot.png?alt=media\&token=05a1b9f9-64db-447b-a9de-418dfb975c3f)

&#x20;3\. Click the menu button and select **Library**.

![](https://2886676663-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M15aAl8UGIPUvccCl0n%2F-M8FTOU35UQDkXcz7TAB%2F-M8FX9gVDk8bf6JV6ruy%2FScreenshot.png?alt=media\&token=4b2d65e4-7ab9-4ce2-b1fa-f33d729ecaa8)

4\. Find **Maps JavaScript API** and enable it.

![](https://2886676663-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M15aAl8UGIPUvccCl0n%2F-M8FTOU35UQDkXcz7TAB%2F-M8FXbYvvEVPe5f-xb2C%2FScreenshot.png?alt=media\&token=81351ad9-833b-4d46-8333-0b33a6907ce1)

5\. Go back to the Library menu, find **Places API** and enable it.&#x20;

![](https://2886676663-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M15aAl8UGIPUvccCl0n%2F-M79zg87BW80Ly23yUOk%2F-M7A-JIbwBmiIEBEHEyb%2FScreenshot.png?alt=media\&token=c765e5a0-d5f8-4393-8fef-ecabd79a14c8)

6\. Go back to the Library menu, find **Geocoding API** and enable it.

![](https://2886676663-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M15aAl8UGIPUvccCl0n%2F-MDRmVnzdhIOChtKNqo9%2F-MDRnNyLEaCXesc67i-J%2FScreenshot.png?alt=media\&token=52b776cb-6d97-4fcf-b3ff-15e039b9786c)

7\. Click the menu button and select **Credentials** and click **Create credentials > API key**.

![](https://2886676663-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M15aAl8UGIPUvccCl0n%2F-M8FTOU35UQDkXcz7TAB%2F-M8FZ0RHVqwL8F6F6FFJ%2FScreenshot.png?alt=media\&token=0905842c-9649-48ba-8143-c664e96b15fd)

The **API key created** dialog displays your newly created API key.

![](https://2886676663-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M15aAl8UGIPUvccCl0n%2F-M8FTOU35UQDkXcz7TAB%2F-M8FZQxIfB7meFk2qhX-%2FScreenshot.png?alt=media\&token=d9bb3327-1f49-4973-b92f-d970c5a230b0)

The new API key is listed on the **Credentials** page under **API keys**.\
(Remember to [restrict the API key](https://developers.google.com/maps/documentation/javascript/get-api-key#restrict_key) before using it in production.)&#x20;

7\. Click on **RESTRICT KEY**.

An application restriction controls which websites, IP addresses, or applications can use your API key. You can set one application restriction per key.

* Select **HTTP referrers (web sites)**
* Click on **ADD AN ITEM** and add your domain.\
  Your domain should look like this: `https://yourdomain.com/*` and `yourdomain.com/*`

![](https://2886676663-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M15aAl8UGIPUvccCl0n%2F-M98Db4Sx36vMMYbG102%2F-M98FUL7fdTH6UQESICs%2FScreenshot.png?alt=media\&token=56a7f9f1-031f-4ac0-b4c6-02688a03a5b5)

* Select **Restrict key**.
* Click on **Select APIs drop down menu** and select **Maps JavaScript API** and **Places API** and **GeoCoding API**

![](https://2886676663-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M15aAl8UGIPUvccCl0n%2F-M8FTOU35UQDkXcz7TAB%2F-M8F_tuv8p4RaLYFc0RK%2FScreenshot.png?alt=media\&token=311ec0e6-c374-4685-b059-1fa5012360f3)

Now your API Key is ready for use.

8\. Copy the API Key and paste in your `.env` file

```
GOOGLE_MAPS_API_KEY="" //API KEY
```

### Possible problems

{% hint style="info" %}
**IMPORTANT:** Please make sure that everything is working okay (showing maps and adding new client address in order checkout page).

You must enable Billing on the Google Cloud Project at [https://console.cloud.google.com/project/\_/billing/enable](https://console.cloud.google.com/project/_/billing/enable%20Learn%20more%20at%20https:/developers.google.com/maps/gmp-get-started)

[Learn more at ](https://console.cloud.google.com/project/_/billing/enable%20Learn%20more%20at%20https:/developers.google.com/maps/gmp-get-started)\
\
[https://developers.google.com/maps/gmp-get-started](https://console.cloud.google.com/project/_/billing/enable%20Learn%20more%20at%20https:/developers.google.com/maps/gmp-get-started)
{% endhint %}

\
1\. **Change application restrictions** \
\
Depending on your server/domain configuration the script maybe won't accept the **HTTP referrers** restrictions so try with changing the application restrictions back to **None**&#x20;

![](https://2886676663-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M15aAl8UGIPUvccCl0n%2F-M98Db4Sx36vMMYbG102%2F-M98HtbUwNdKfJD6TLiP%2FScreenshot.png?alt=media\&token=3475e804-743b-44e9-938d-d99d54ef980b)

2\. **Enable Billing on your project.**

Sometimes after adding the key these features maybe won't work again. Then depending on the google account associated with the project created and maybe you will need to enable Billing.<br>

Learn more here about it: [Billing](https://console.cloud.google.com/project/_/billing/enable) or here [Getting started with Google Maps Platform](https://developers.google.com/maps/gmp-get-started)

If you have still problems with this configuration write us on our [support chat](https://help.mobidonia.com/#foodtiger) for help/assistance.

## Allow us to configure Google project for you

Go to the [Google Cloud Platform](https://console.cloud.google.com/).

Click the project drop-down and select your project.

From the left menu select **IAM & Admin**.

![](https://2886676663-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M15aAl8UGIPUvccCl0n%2F-MBidrGEiGvpm6cU_ZNn%2F-MBifZCBToFTeHE-p0gW%2FScreenshot.png?alt=media\&token=66a86184-20eb-4442-9774-45f1f7c25d9e)

Now click on the **Add** button.

![](https://2886676663-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M15aAl8UGIPUvccCl0n%2F-MBidrGEiGvpm6cU_ZNn%2F-MBifudi4O0ojgIWRUJg%2FScreenshot.png?alt=media\&token=d4033a58-ee9c-4ea9-9c92-35161671f4f7)

Add our email **<mobidonia@gmail.com>** and give us **Editor** role.

![](https://2886676663-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M15aAl8UGIPUvccCl0n%2F-MBidrGEiGvpm6cU_ZNn%2F-MBigDFfFbmPn6hvH7Gs%2FScreenshot.png?alt=media\&token=05a3ca69-286e-4164-9db7-04ad89e334d3)

In the end click **Save**.

Write us on our [support chat ](https://help.mobidonia.com/#foodtiger)for your project details.
