Geo Fence and Time Based Delivery Price Setup
In reservety you can setup shipping/delivery based on time to the customer using a vehicle. Delivery cost is calculated based on the what Google API return as travel time between the store and the delivery destination.
When reservety support agent do the setup for you, we are using our own API key. The first 150 calls each month to the API are free, after that you will be charged $7 per 1000 calls. 1 call is done every time a user checkout. This can add extra charges to your account.
Another alternative is to pay directly to Google by setting up your own API key. You will also have 1000 free calls each month and the price will be the same.
For this purpose, we would need the Google Map APIs and live location APIs. Follow the steps below.
1. APIs We Need
For the time-based shipping calculation, we use distance rate shipping. For it to work, we need an API key: Google Maps API key
2. Go to Google Cloud Console
To start creating APIs go to https://console.cloud.google.com/ and create an account or use an existing Google account
3. Add a Billing Account
4. Link Billing Account or Add New
You can link a Google Adword account or add a new account by entering your details.
Note: The billing details are used to ensure you are not a robot and services are not spammed or misused. You are charged only when the services are used prolifically.
5 . Add New Project
After you have added a billing account. Create a New Project by first clicking on the dropdown right of the Google Cloud Platform logo and then clicking on ‘New Project’
6 . Enter a Project Name
Next enter your project name. You can enter your store name.
7 . Select Your Newly Created Project
Now select your project from the notification on the top-right.
8 . Go to Explore and Enable APIs
Scroll down to find the Getting Started section and click on Explore and enable APIs. And Then Click on Enable API on the top
9. Search and Enable All APIs Services
Now search each of the required API services one by one and then click on enable.
Required APIs are:
Distance Matrix API
Maps Embed API
10. Review Enabled APIs
Once you have enabled all APIs services, you will be able to view them all under Enabled APIs.
11. Create Credentials
The next step is to go to Credentials > and Click + Create Credentials
12. Select API Key
From the dropdown select the API key.
13. Edit API Key
From the Pop-up select ‘Close’ and then click on the pencil icon to edit.
14. Enter API Details
Enter API key detail:
Name: Google Maps API Key
Application Restriction: IP
Enter this IP: 2a04:3542:1000:910:4c56:f6ff:fe7c:69a4
API Restriction: Select Restricted Radio Button
and then search and checkmark Distance Matrix API and click Maps Embed API
Finally Click Save button
17. Use API Keys
Use API Keys by copying from the key section
Setting Up Distance Rate Delivery for Time Travelled
1. Go To Shipping
Go to settings > store> shipping > Shipping Zone. Add a New Shipping Method.
Choose Distance Rate Shipping
2. Edit Distance Rate Shipping
Click edit on Distance Rate to start setting it up.
3. Enter API Keys
Enter the newly created API.
4. Route Settings
Enter Route settings
Tax Status: Whether shipping is taxable or not
Travel Mode: Driving
Avoid: Choose appropriate based on your travel
Distance Unit: Metric
Check Mark the boxes: Show distance and time (If you want to show the details on the checkout page)
Finally enter your store address or the address from where you will ship the item
5. Enter Rules
Now Enter Rules based on the cost you want to charge customers. See below!
Click on the ‘save changes’ button to save settings.