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.
The following information refers to screens and steps available on the Google platform. As such, they are subject to change without notice. We will try to keep it up to date as much as possible, but please be aware that the screens shown below may be different than what is currently available on the google side of things.
Set up a Google Cloud Platform account
The first step in the process is to create an 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 article 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:
- Go to https://cloud.google.com/
- 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:
- Once you're signed into the Console, look towards the top left and select your project from the dropdown menu.
- Once your project is selected, look again towards the top left and click on the "hamburger" menu
- Select "APIs & Services"
- Then select "Library"
- In the library, click on the "Places API" tile
- 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 liting of related APIs. Let's continue:
- Once you have both APIs enabled on the project, click on the hamburger menu again to open up the menu
- Click on APIs and Services
- And select "Credentials" from the flyout menu
- On the next page, click on the "Create credentials" button
- 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.
- Click on the copy icon to copy it to your clipboard.
- Enter this API key onto your module in the Shift4Shop Online Store Manager
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
- Select "HTTP referrers (web sites)
- Scroll down to the "Website restrictions" section and click on "ADD AN ITEM"
- Specify your your store's secure URL as shown below
- Click "Save" to complete the set up.
Technically, the generated API key can be used for an 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"
- Click "Save" to complete the process.
The key will now only use the selected APIs. Again, this portion is completely optional.