Create Google API for your store
Even the API key is not compulsory for the app but it will help the app run smoothly, therefore we still recommend you to create an API key on your own for your business. There are 6 main steps to create an API key:
1. Create a billing account
The first step that you need to take is creating a billing account. If you already owned a billing account, you can skip this step.
First, you go to the Google Cloud Platform Console and sign in to your account. Then, you click on the menu button and select Billing.
After that, you will see the Add billing account button on the My billing accounts tab. Click on that button and fill all the required information including Name, Address, Card number,...
2. Enable billing for your project
To let the API work, Google platform asks you to enable billing for your project. One more time, click on the menu button and choose the Billing section.
Then, you just need to link the project with your billing accounts.
3. Enable 5 types of API
As our apps use 5 types of API, which are Direction, Geocoding, Geolocation, Maps JavaScript, and Place APIs, you need to check whether you enable these APIs or not.
Click on the menu button again and select APIs & Services and click on Library .
Then, you click on the View All button and choose these 5 above APIs.
If you have already enabled these APIs, the platform will show the Manage button.
Otherwise, it will show the Enable button for you. Click on that button to enable them for your project.
4. Create an API
The next step that needs to be done is creating an API key. To create an API key, you also click on the menu button and select APIs & Services > Credentials.
On the Credentials page, you click Create credentials and choose API key.
Google platform will automatically create for you an API but you need to restrict this API
5. Restrict the API key
To restrict the API you click on the Edit icon, the platform will bring you to the Restrict and rename API key page.
On this page, you can rename the API as well as restrict it. In case you have many APIs, you can rename it as "Store Pickup", which makes it easier to keep track.
When you scroll down, there will be the Application restrictions and API restrictions parts.
With the Application restrictions, you choose the HTTP referrers and fill your store URL link in the "Website restrictions" field . Please remember to add a wildcard asterisk (*) symbol after your store URL link, so the API can work with all the pages of your store:
And for the API restrictions, you select the "Restrict key" option and click on all 5 types of APIs, including Direction API, Geocoding API, Geolocation API, Maps Javascript API, and Places API.
6. Apply the API key
The final step is applying the API key to the app. To do that, you open the app from your Shopify admin, then go to the Setting section, enable the Google Maps API and enter your API key into the API Key field in the General tab:
Don't forget to click on the Save and Publish to Shop buttons after you add the API Key to the app.
Last updated