Overview
A Google Maps API key is required for the following;
- Store pickup map
- Driving distance validation
- Max distance validation
- Auto-address suggestions
Important Note
Google provide $200 USD of free credit per month which is more than enough for most merchants. Should you exceed their free limit you will be charged for your usage. You can view their latest pricing & plans at https://cloud.google.com/maps-platform/pricing.
Creating a Google Maps API Key
Visit the Google Maps Platform page and click Get started
Within the Maps APIs and Services page click Maps Javascript API
On the Maps JavaScript API page click Enable
Click APIs in the side bar and select Places API
On the Places API page click Enable
Click APIs in the side bar again and select Directions API
On the Directions API page click Enable
Click APIs in the side bar again and select Geocoding API
On the Geocoding API page click Enable
Click APIs in the side bar again and select Distance Matrix API.
On the Distance Matrix API page click Enable
Enable billing on the Google Cloud Project.
Click on the project you want to manage.
Select the billing account.
Click Set account.
Now you have enabled all the required API's and enabled billing, you can generate an API key. Click the Navigation menu button.
Select APIs & Services and then Credentials
Click the Create Credentials button and select API Key
You should now see your Google Maps API key
Copy and paste your API Key into Store Pickup + Delivery > Settings > Local Delivery > Distance validation > Google Maps API key and click the Save button.
Securing your Google Maps API Key
In order for our app to be able to use your API key you must not enable any restrictions on your API key.
Troubleshooting
Invalid API Key
If you see an error saying that your API Key is invalid please double check the following:
- Double check that you have correctly enabled access to all the required APIs within the Google Maps Platform admin panel. Follow steps 1-10 above to confirm.
- Ensure that you have correctly copied the full API key from Google and have not accidentally copied over any blank spaces at the start or end of the key.
- Make sure that you have added your credit/debit card billing details to your Google account.
- Check if you have enabled Billing on the Google Cloud Project.
Permissions issue
If you are presented with a permission error please double check the following:
- Double check that you have correctly enabled access to all the required APIs within the Google Maps Platform admin panel. Follow steps 1-7 above to confirm.
- Please ensure you have no restrictions set on your API key (under APIs and services > Credentials > Edit API key).
Checking the validity
You can check the validity of your Google Maps API key on this link. Copy the link to your browser and replace the API_KEY with your actual Google Maps API key.
You can also see the errors in the developer console.