{ "error_message": "You must enable Billing on the Google Cloud Project }

pavan cd picture pavan cd · Dec 15, 2019 · Viewed 14k times · Source

Trying to get Direction route between two points in map

This is the url i am using to get directions

(https://maps.googleapis.com/maps/api/directions/json?origin=16.3064857,80.4418659&destination=27.2038,77.5011&mode=driving&key=MyApiKey)

Also I have enabled my billing account in google cloud console but still getting output as

{

  "error_message": "You must enable Billing on the Google Cloud Project at https://console.cloud.google.com/project/_/billing/enable Learn more at https://developers.google.com/maps/gmp-get-started",

  "routes": [],

  "status": "REQUEST_DENIED"


}

Answer

Philippe picture Philippe · Dec 16, 2019

You first need to verify that the project is linked to the billing account in question. You can check by going into "Google Cloud Console Manage billing accounts page", selecting your billing account and clicking on "Projects linked to this billing account". [1] Then you need to verify if the billing account is linked to the project in question by going into the “My projects” tab and from there, you will see all the projects with their associated billing account. [2] Any project with no billing account associated with it will display “Billing is disabled” as a message. To enable billing, go to the “My Projects” tab and click on the menu of the desired project from the list, select “Change billing”, then choose the desired destination billing account. If you’ve verified the steps above, then please check that the account holds the required permissions [3]

[1] https://cloud.google.com/billing/docs/how-to/view-linked#view_the_projects_linked_to_a_billing_account

[2] https://cloud.google.com/billing/docs/how-to/view-linked#view_the_billing_account_linked_to_each_of_your_projects

[3] https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_an_existing_project