Knowledgebase: Modules

How do I set up my Google Places API?

 

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.

Please Note:
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:

  1. Go to https://cloud.google.com/
  2. 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:

  1. Once you're signed into the Console, look towards the top left and select your project from the dropdown menu.

  1. Once your project is selected, look again towards the top left and click on the "hamburger" menu
  2. Select "APIs & Services"
  3. Then select "Library"

  1. In the library, click on the "Places API" tile
  2. 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:

  1. Locate the Maps JavaScript API and click on it to enable it as well.

  1. Once you have both APIs enabled on the project, click on the hamburger menu again to open up the menu
  2. Click on APIs and Services
  3. And select "Credentials" from the flyout menu

  1. On the next page, click on the "Create credentials" button
  2. 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.

  1. Click on the copy icon to copy it to your clipboard.
  2. 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.

  1. Log into your console
  2. Select your project
  3. Click on the "Hamburger" menu at the top left and go to "APIs & Services"
  4. Then select "Credentials"

You will be presented with a list of your API key credentials.

  1. Locate your API key and click on its "edit" icon.

On the next page, look on the "Application restrictions" section

  1. Select "HTTP referrers (web sites)
  2. Scroll down to the "Website restrictions" section and click on "ADD AN ITEM"
  3. Specify your your store's secure URL as shown below

  1. Click "Save" to complete the set up.

Optional
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:

  1. Scroll down to the API Restrictions section of the page
  2. Select "Restrict key"
  3. Using the dropdown menu, select the Maps JavaScript API and Places API options (and any other APIs you'd like to restrict the key to).

  1. Click "Save" to complete the process.

The key will now only use the selected APIs. Again, this portion is completely optional.


Help Desk Software by Kayako fusion