Try ERPNext Buy Support Partners Foundation

Custom Script API Keys

Hi is there someone can guide me to right direction to proper execute the API keys here in erpnext. i already created an api key and i try to put it on hooks.py and also enable my google settings with the details needed. but still im having issues on API keys Warning. kindly check the image below for your reference.

PS
I follow this guide Google Maps with Location Distance Integration Tutorial but it looks that google map is required to have api keys.

Thank you

You need to have Billing also enabled for the project in Google Cloud Console.
Add this in app_include_js in hooks.py.
In hooks.py use like below. Replace the text after = with your api key and it should work then.

https://maps.googleapis.com/maps/api/js?key=yourKEYhere
1 Like

@yhenn I would suggest you to read through the replies in the tutorial as I’ve mentioned that it needs API keys from Google in order use such features now, and yes you need to setup billing before you’re able to use such API from Google, but Google is generous enough to allow quite a large volume of request for free before it start to charge you, and there’s no way not to setup billing to enjoy this feature (As I received quite some enquiries about how to avoid setup the billing and use Google APIs)

You can refer the link below to get started with Google APIs:
https://developers.google.com/maps/documentation/javascript/get-api-key

As @kartik mentioned above, after received your API key from Google, you can use it by placing your key at the end of the js api link.

https://maps.googleapis.com/maps/api/js?key=yourKEYhere

Hope it helps!

Regards
Seng

1 Like

Thanks Sir. The reason API keys are not working because Billing was not yet setup for my account. :slightly_smiling_face::slightly_smiling_face::slightly_smiling_face: