Intuitive Shipping uses Google Directions and Geocoding APIs when calculating distance-based shipping rates or when applying distance conditions. If you want to create a Local delivery shipping method, which calculates rates by measuring distance between your shipping origin location and the customer’s address, or if you want use a Delivery distance condition in a Scenario to restrict when a shipping method can be activated, you will need to create a Google API account for both Directions and Geocoding APIs, then connect your Google API account to Intuitive Shipping.
Create A Billing Account
Google requires you to have a Billing Account set up and linked to your API Key project in order to use your Google API key, even if you don’t anticipate being billed for usage.
If you already have a Google Maps Billing Account, skip ahead to Get A Project API Key. If you haven’t yet set up a Billing Account, continue to Step 1.
1) Sign in to the Google Maps Platform with your Google credentials – the same credentials you use to sign in to Gmail or Google My Business.
2) Click the Get started button.
3) Check the boxes beside Routes and Places, then click the Continue button.
4) Click the drop-down arrow beside Select or create project, then select + Create a new project from the list.
5) Enter the project name, such as ‘Intuitive Shipping’, to name the project that will hold your API credentials, then click Next.
6) Click Create Billing Account and follow the steps provided to complete the Billing set-up process.
Google generally provides a one-time credit of USD $300.00 for new billing accounts.
In addition, Google provides a monthly credit of USD $200.00 worth of API requests – equivalent to roughly 35,000 distance-based calculations with Intuitive Shipping. This credit renews every month, with no term limit.
Get A Project API Key
1) Visit the Google Cloud Platform Console.
2) Click the Select a project drop-down.
3) Select an existing project or create a new one.
4) Click the menu icon – 3 horizontal lines at the far left of the menu bar – then select APIs & Services > Credentials from the drop-down list.
5) On the Credentials page, click Create credentials, then select API key.
6) Your API key is displayed in the pop-up window. Click Close.
The new API key is listed on the Credentials page under API Key.
7) Ensure that Application restrictions is set to ‘None’ and API restrictions is set to ‘Don’t restrict key’.
For security reasons, Google advises you to add restrictions to your API Key. However, restrictions will limit our ability to connect to your account and will cause errors with distance-based rate calculations. If your API Key is only being added to Intuitive Shipping, there is minimal risk to having an unrestricted key.
Enable Directions and Geocoding APIs
Intuitive Shipping requires both Directions and Geocoding APIs to be enabled. Our system first attempts to calculate distance using Directions – meaning, your store’s shipping origin address to the customer’s address. If that fails, our system will fall back to the Geocoding API to complete the calculation.
1) Click Dashboard on the sidebar menu, then click Enable APIs and Services.
2) Under Maps, find the Directions API box and click it.
3) Click the Enable button.
4) Click APIs in the sidebar menu.
5) From the list under Additional APIs, click Geocoding API.
6) Click the Enable button.
How It Works
Intuitive Shipping uses two types of APIs for distance checks.
Distance API uses your shipping origin address and the customer’s address to look up driving directions with Google Maps.
Geocoding API converts your shipping origin address and the customer’s address into geo-coordinates, and measures distance point-to-point (or ‘as the crow flies’).
By default, we attempt Distance first. If it fails, we attempt Geocoding.
Each time Intuitive Shipping is used to check a Delivery distance condition or calculate a distance-based shipping rate for a Local delivery shipping method, it sends an API request to Google with your Directions API. If the required information is not returned, it sends another API request to Google with your Geocoding API.
That means, each distance-based shipping calculation will result in at least one (1), and periodically, two (2) Google API requests.
Distance API will be successful about 75% of the time.
Each API costs $5.00 per 1000 API requests per month. Google provides a free credit of $200.00 of total API requests per month on an ongoing basis. That means you can use Intuitive Shipping to calculate roughly 35,000 distance-based shipping quotes before you use up your monthly credit.
- 30,000 Directions API requests = $150.00
- 5000 Distance API requests + 5000 Geocoding API requests = $50.00
- Total 40,000 API requests (based on $5.00 per 1000 requests) = $200.00
Once you use up your free credit, Google will not allow API calls, and Intuitive Shipping can no longer return distance-based shipping rates or apply Delivery distance conditions until the next free billing period starts or until you select a paid plan.
Google may require you to set up billing even before you can create an API key.
If you anticipate exceeding 30,000 distance-based shipping calculations per month, we recommend that you select a paid Google Maps plan.
Connect You Google API Account To Intuitive Shipping
Once your API key has been generated and you have enabled both Directions and Geocoding API, you must connect your Google API account to Intuitive Shipping
1) Click the Menu button, then select APIs & Services > Credentials from the drop-down list.
2) Click the Clipboard icon beside your Google API key.
3) Return to the Intuitive Shipping app.
4) Click Settings on the sidebar menu, then select Carrier accounts.
5) Click Add carrier account.
6) Click the downward arrow beside ‘Integrated services’ to display a list of options.
7) Select Google API from the list.
8) Click the Configure account button.
9) Enter a title, such as ‘Google API’ or ‘Google Distance’.
10) Select the status.
You have two (2) settings to choose from:
Off – the account will be ignored by local delivery shipping methods it is assigned to. Distance calculations will not return rates at checkout and Delivery distance conditions checks will not pass.
On – the account can be used by local delivery shipping methods it is assigned to. Distance calculations will return rates at checkout and Delivery distance conditions checks will pass. This is the default setting.
11) Paste your Google API Key into the app.
Save Your Settings
1) Click the Save button to save your Google API Account.
After saving your Google API account, it will be listed on the Carrier accounts page along with any other carriers you have connected to Intuitive Shipping.
And, when you create a new Local delivery shipping method, Google API will be listed as a selectable option in the Carrier accounts section.
Learn how to connect another carrier account.