Users attempting to set up the Google Address Autofill module on their store can use the following steps to set up the proper API keys for their account.
Set up a Google Cloud Platform account
The first step in the process is to create access to the Google Cloud Service. This is a service that lets you have access to various Web APIs and tools offered by Google.
Please note that - while the initial cloud service access is free of charge - the use of some APIs may incur monetary charges. This guide assumes you already have an account created and access to the Cloud Service console.
Once you have access to the Google Cloud Platform, proceed with the following:
Look towards the top right and click on the Console link.
If you are not signed into your Google account, you will be prompted to do so. To continue:
3. Once you're signed into the Console, look towards the top left and select your project from the drop-down menu.
4. Once your project is selected, look again towards the top left and click on the "hamburger" menu.
5. Select APIs & Services.
6. Then select Library.
7. In the library, click on the Places API tile.
8. Then enable the API on your project.
When you enable the Places API, you'll be taken to a list of your project's enabled APIs. At this point, you should only see the one you just added (Places API). Below this listing, in the "Additional APIs" section, you will see a listing of related APIs. Let's continue:
9. Locate the Maps JavaScript API and click on it to enable it as well.
10. Once you have both APIs enabled on the project, click on the" hamburger" menu again to open up the menu.
11. Click on APIs and Services.
12. And select Credentials from the flyout menu.
13. On the next page, click on the Create credentials button.
14. Select API key.
You will be shown your API. This is the API key that you will place into the Google Address Autofill module of your Shift4Shop store.
15. Click on the copy icon to copy it to your clipboard.
16. Enter this API key onto your module in the Shift4Shop Online Store Manager.
Restricting Access
To prevent unauthorized use of your API key, you'll want to restrict it so that it is only used by your website. The following steps will allow you to restrict the access.
Log into your console.
Select your project.
Click on the "hamburger" menu at the top left and go to "APIs & Services."
Then select Credentials. You will be presented with a list of your API key credentials.
Locate your API key and click on its "edit" icon.
On the next page, look on the "Application restrictions" section.
6. Select HTTP referrers (web sites).
7. Scroll down to the "Website restrictions" section and click on ADD AN ITEM.
8. Specify your store's secure URL.
9. Click Save to complete the setup.
Optional
Technically, the generated API key can be used for any other enabled APIs that you might have on the same project. If you'd like, you can also place a restriction on the API key so that it only calls upon specific APIs of your choosing. To do this:
Scroll down to the API Restrictions section of the page.
Select Restrict key.
Using the drop-down menu, select the Maps JavaScript API and Places API options (and any other APIs you'd like to restrict the key to).
Click Save to complete the process.
The key will now only use the selected APIs. Again, this portion is completely optional.