Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission issue Google Play

I'm having trouble with androidpublisher.inapppurchases.get

My project is just according to https://code.google.com/p/google-api-java-client/wiki/OAuth2#Service_Accounts and it worked fine until I migrated to new Google Play Account. So now when I execute request Server-to-Server I am receiving this response.

{
  "code" : 401,
  "errors" : [ {
    "domain" : "androidpublisher",
    "message" : "The current user has insufficient permissions to perform the requested operation.",
    "reason" : "permissionDenied"
  } ],
  "message" : "The current user has insufficient permissions to perform the requested operation."
}

Anybody is familiar with this response because in google documentation there is no clue about this.

like image 397
stebetko Avatar asked Jun 26 '14 14:06

stebetko


4 Answers

Problem solved adding user service account email address [email protected] as administrator user in google play settings.

like image 54
stebetko Avatar answered Oct 28 '22 20:10

stebetko


From Google Play Console go to (with admin access):

  1. Setting (Left Panel)
  2. Developer Account (Left Panel)
  3. Users & permissions (Left Panel)
  4. Click on the Invite New User button.
  5. Enter the service account email (the same you have in the json file you are using and that google generated when you created the service account)
  6. Select Administrator in the Role DropDown menu.
  7. Click on SEND INVITATION

That's it. No one can stop you now! :)

like image 44
Valerio Avatar answered Oct 28 '22 18:10

Valerio


Unfortunately, the accepted answer did not work for us. For verifying a receipt you would need an Access Token. The Access token is being generated by RefreshToken. RefreshToken has an association to a Google account. That Google account should have View financial information In Google Play console.

  1. Get Redirect Url using Android Client ID
  2. Use Redirect URL with a Financial Access Enabled Account to get Refresh Token
  3. Get Access Token with that Refresh Token
  4. Use Access Token to verify IAP receipts
like image 4
Roozbeh Zabihollahi Avatar answered Oct 28 '22 20:10

Roozbeh Zabihollahi


For those of you that run into this issue and the above solutions don't work and your service account has sufficient permission in Google Cloud and Google Play Console, it can take ~24 hours+ for permissions to propagate (according to other users).

But there's a hack to fix this: update/change/create an in-app purchase in the Google Play Console under the YOUR_APP > Products section.

Fix mentioned on Github

like image 2
brianbhsu Avatar answered Oct 28 '22 20:10

brianbhsu