to check inapp purchase i have used this api https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token} and got this response.
{
"error": {
"code": 403,
"message": "Request had insufficient authentication scopes.",
"errors": [
{
"message": "Insufficient Permission",
"domain": "global",
"reason": "insufficientPermissions"
}
],
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
"domain": "googleapis.com",
"metadata": {
"method": "androidpublisher.ProductPurchasesService.Get",
"service": "androidpublisher.googleapis.com"
}
}
]
}
}
By any chance, have you been invoking this from a GCE VM? If so, you might want to:
Stop the VM
Go to the GCE VM instances in the cloud console
Click edit on the machine
Go to scopes
Edit the scopes as desired (preferably adding the scope just to a particular API or if you are OK with it - to all APIs, depending on context and risk)
Restart the machine and make the API call again
Some useful references can be found here and here.