Shipping by distance calculates delivery charges based on how far the customer is from your store. This is done using either the Google Maps API or Azure Maps API, depending on your preference. Inside the WebStore Manager (WSM), you can define custom rate rules that apply per kilometer or mile.
This guide walks you through how to obtain an Azure Maps API key, integrate it with your WSM shipping rules, and configure your distance unit settings (miles or kilometers).
How to Get an Azure Maps API Key
1. Log in to the Azure portal.
If you do not have an Azure subscription, please create a free account first at https://azure.microsoft.com.
2. Access Your Azure Maps Resource
After logging in, go to All resources under Azure Services and click on your Azure Maps account.
3. Locate Authentication Settings
In the left-hand menu, under the Settings section, click on Authentication. Here, you’ll find your primary key, which you’ll use to connect with WSM.
Entering the API Key into WebStore Manager
Once you’ve obtained your API key:
Open WebStore Manager.
Navigate to All Config Options.
Find the setting Enable Azure Maps Integration.
Enter your Azure API key in the provided field >Click Save to apply the changes.
To configure a shipping method that calculates delivery rates based on distance using the Azure Maps API, follow these steps:
- Go to Fulfillment & Taxes in the WebStore Manager.
Select the country where the delivery method applies.
In the Fulfillment Methods section, locate the shipping method you want to configure.
Next to Shipping Integration, click Change....
In the Configure Shipping Integration window that appears:
Under Shipping Carrier, select Charge by Distance (Azure API).
Under Shipping Service, select Calculate Distance Using Azure Maps API.
Click Save Settings to apply the integration.
This will enable the selected delivery method to dynamically calculate shipping rates based on the customer's distance from your store using Azure Maps.
Shipping Rules
When using Azure Maps for distance calculation, you can also set up shipping rules based on how far the delivery address is from your store.
For example:
Charge different prices based on distance (e.g. $5 for up to 5 km, $10 for up to 15 km).
Units of distance
To set the units of distance for your store's shipping options, you can choose between imperial (miles) or metric (kilometers). This setting is available in the WSM under All config options-> Set Distance BAsed Shipping Method Units. The option is called Set Distance Based Shipping Method Units and Set Bing Distance Based Shipping Method Units , where you can specify whether Google/Azure will return distances in miles or kilometers based on your preference.