Digital Goods Transaction of Actions on Google (Prepare for Actions API)
Until previous story, you could connect your Actions on Google project to the Android app on the Google Play. To access to digital goods, you need to use an Actions API. The service account is necessary to use the Actions API. You can issue the service account on Google Cloud Platform Console.
I describe about how to issue a service account to use the Actions API in this story.
Get Product ID
First, you need to know the Product ID of your Actions on Google. In the Actions on Google project, click the gear icon on the top of the left navigation menu, and click the “Project settings” menu item on the opened popup menu.
You should see the Project ID on the next page. Copy the Project ID string to your clipboard.
Enable Actions API
Before issuing service account, you need to turn on the Actions API. Open the following URL in your Web browser:
https://console.developers.google.com/apis/api/actions.googleapis.com/overview?project=<YOUR_PROJECT_ID>
The “YOUR_PROJECT_ID” value is the ID you got on the Actions on Google project setting page. You see the page of the Actions API as like the following. Click the “ENABLE” button.
If it is successfully to enable the Actions API, you should see like the following page:
Issue Service Account
Next, issue a service account to use the Actions API. Open the following URL in your Web browser.
https://console.developers.google.com/apis/credentials?project=<YOUR_PROJECT_ID>
You see like the following page.
Click the “Create credentials” dropdown button, and select the “Service account key” menu item.
In the next page, click the “Select…” pulldown menu of the “Service account”, and select the “New service account” menu item.
And, fill in the following fields:
- Service account name: The key name. Here, type the “digitalgoodstransactions”.
- Role: Select the “Project” -> “Owner”.
- Key type: Select the “JSON”.
Then, click the “Create” button. After creating the new service account, the file dialog is opened. To save the JSON file, specify the target directory/file.
The page is refreshed, and you should see the issued service account row.
Next Action
At this story, all preparations are done. You could get all environment to use Digital Goods Transactions. Congratulation!
I intend to describe about how to register digital goods on the Google Play Console.