Skip to main content

Google Maps API in Zapiet - Rates by Distance

Jelizaveta avatar
Written by Jelizaveta
Updated over 3 weeks ago

If you’ve been experiencing issues with inaccurate distance calculations using OpenCage—the default provider in Zapiet - Rates by Distance—these discrepancies can lead to incorrect shipping rates or delivery issues, often caused by limitations in the OpenCage API.

To improve accuracy and reliability, many users choose to switch to Google Maps as their distance provider. To switch, you’ll need to set up a Google Maps API key and add it to your Zapiet settings.

Google provides a 90-day free trial or up to $300 USD in free credits, whichever comes first. After that, most merchants can continue using the service at no cost, thanks to the $200 USD in free monthly credit provided by Google.

If you exceed this amount, you’ll be billed based on usage. You can review their pricing plans for more details.


Requirements

  • You need to have an active Google account.


Create a Google Maps API Key

If you have an existing Google Cloud account with open projects, follow the steps for Existing Google Cloud users.

New Google Cloud users

  1. Visit the Google Maps Platform page and click Get started.

  2. If needed, sign in to your Google Account.

  3. Continue to add business and billing details.

  4. Copy the API key and tick Enable all Google Maps API's for this project.

  5. Click Go to Google Maps Platform.

  6. Do not add a restriction. Click Maybe later.


Existing Google Cloud users

  1. Visit the Google Maps Platform page and click Get started.

  2. If needed, sign in to your Google Account.

  3. Click the open project name.

  4. Click New project.

  5. Add a project name, and click Create. You can also add a location if needed.

  6. Click Select project.
    You may have to wait a moment for the project to be created.

  7. Click Keys & Credentials.

  8. Copy the API key and tick Enable all Google Maps API's for this project.
    You can also enable budget alerts.

  9. Click Go to Google Maps Platform.

  10. Do not set a restriction. Click Maybe later.

You can now add the API key you've copied to the Zapiet - Rates by Distance settings.


Add the API key to Zapiet - Rates by Distance

  1. In Zapiet - Rates by Distance, click Settings.

  2. In Route and address provider section, select Google Maps.

  3. Enter your Google Maps API key.

  4. Click Save.


Troubleshooting

If your API key is invalid, you follow the troubleshooting steps below.

You can check the validity of your Google Maps API key through the link below. Copy the link to your browser and replace the API_KEY with your Google Maps API key.

Compare the error messages with the error messages below.


Error message: "This API project is not authorized to use this API."

This could mean that not all of the API's have been enabled, or that the API has been restricted, or both.

To check if the API's have been enabled:

  1. Click APIs and services.

  2. Check the following API's are enabled:

    • Geocoding API

    • Distance Matrix API

  3. If any are disabled, click Enable.

Repeat until both API's are enabled, and then test the API key.

If it is still showing an error, check if any restrictions have been placed on the API.

  1. Click Keys & Credentials.

  2. Under Actions, click ⋮ and then click Edit API.

  3. Disable any restrictions.

  4. Click Save.

You can now test the API key again.


Error message: "The provided API key is invalid."

The API key added in Zapiet - Rates by Distance may be missing some characters, or a blank space may have been added.

  1. Click Keys & Credentials.

  2. Go to API keys and click Show key.

  3. Copy your API key.

Carefully re-enter your API key in Zapiet - Rates by Distance and test again.


Error message: "You must enable Billing on the Google Cloud Project at https://console.cloud.google.com/project/_/billing/enable ..."

  1. Go to https://console.cloud.google.com/project/_/billing/enable and select the project with your Google Maps API.

  2. You may need to create a billing account.

  3. Or you may need to update your payment information.

Once this has been added or changed, test the API key again.

If you are struggling to resolve the issue, reach out to us at support@zapiet.com.


Next step

Did this answer your question?