1

We are trying to build an action that takes gifts. The amount of the gift is provided by the user (in a slot).

To achieve this, we are creating in-app products with the Google Play API through the following resource : https://developers.google.com/android-publisher/api-ref/rest/v3/inappproducts/insert

After creating the product, we are creating the purchase : https://developers.google.com/assistant/transactions/digital/dev-guide-digital-consumables#create_purchase_from_user_selection

However, I get the following error from the Google Assistant : "Sorry, an error occurred, please try again later." (I translated it from French). There is no logs errors reported in Log Explorer.

If I edit the webhook code to use an in-app product created or edited from the Play Console UI, the payment is working as intended.

The prices inserted from the API are the same as the one generated by the Play Console UI.

Do you know why this is not working ? Are products inserted by the API not usable by actions ?

Thanks !

Chris32
  • 4,716
  • 2
  • 18
  • 30
Letik
  • 520
  • 5
  • 11
  • Did you get digital transactions sample to work? This sample should be useful narrowing down issues in your implementation. https://github.com/actions-on-google?q=transactions&type=&language= – Diego Dec 17 '20 at 00:49
  • Hi @Diego, the samples on the Github repo either uses the Google Pay API (in private beta only) or is for physical transactions (I need digital transactions). I was able to make this sample works with products created from the UI : https://developers.google.com/assistant/transactions/digital/dev-guide-digital-consumables – Letik Dec 17 '20 at 10:08
  • There may be a flag or another field in the product metadata created through the Play Console UI and the API. Can you try retrieving the metadata through the API for a product created through UI and another through the API? Comparing both payloads can give you a hint of what's missing. – Diego Dec 18 '20 at 20:20
  • I thought that too but unfortunately the models created from the UI and the API are exactly the same. – Letik Dec 21 '20 at 20:15
  • Hi, may I ask if you are able to query the dynamically added products in your app immediately after inserting to the Play Console via the API? I have an issue which I've posted in this link https://stackoverflow.com/q/66299505/11725250 and was wondering if this is something that other developers are also experiencing or if it's just me. – sammy Apr 02 '21 at 17:30

0 Answers0