Permission issue Google Play
Asked Answered
N

4

22

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.

Nocturn answered 26/6, 2014 at 14:11 Comment(1)
Requests without a "person" param also result in the above error. Fix suggested in this related post #24307178Duckworth
N
33

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

Nocturn answered 27/6, 2014 at 6:36 Comment(6)
i am having the same issue, but i didn't understand, where to put it . which settings ? my request is : googleapis.com/androidpublisher/v1/...?access_token=...Dizon
Go to google play console and add service acount email adress from google developer console to settings -> permissions or something like that. I can't tell you exactly the path 'cause I have no longer access as administrator to this app. Hope this help.Nocturn
Yes fixes, but only for "Purchases.subscriptions: get" . when i calling "Purchases.subscriptions: cancel" getting same permission permissionDenied issue (i already give Administrator permission) ?Catalysis
For me adding the specific app as a new column in the Users and Permissions page in Google Play Console did the trick - afterwards I didn't have to set the service account to Admin, it worked with just a few relevant check boxes checked.Spinnaker
Actually not in google play settings , but at play.google.com->settings->API access -> service accounts -> grant permissionAirdrie
Created a new service account in play console with Administrator permission but still getting same error. Any other suggestions ?Finedrawn
P
11

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! :)

Protuberancy answered 4/6, 2017 at 13:48 Comment(0)
B
4

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
Battledore answered 26/10, 2016 at 15:19 Comment(2)
Doesn't administrator user contain View financial information?Shogunate
I am not sure. At the time we had this problem, we had one user that has this access, so I wanted to make sure I bold that access name here.Battledore
P
2

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

Pl answered 1/4, 2021 at 1:55 Comment(1)
Updating the Main Store Listing (e.g. the app title or description as shown in the Play Store) also seems to make the changes take immediate effect rather than having to wait.Jiva

© 2022 - 2024 — McMap. All rights reserved.