Answer the question
In order to leave comments, you need to log in
How to check the status of google play in-app purchase on the server?
You need to check the status of the purchase on the server. An application has been created in the Google Console. In the API's tab, the Google Play Developer API has been enabled. The Server key was generated in the Credential tab for the Public API.
When requested:
https://www.googleapis.com/androidpublisher/v2/applications/<packageName>/purchases/products/<productId>/tokens/<token>?key=<apiKey>
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Login Required",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Login Required"
}
}
Answer the question
In order to leave comments, you need to log in
And so, it turns out that the problem was that it was not possible to access the purchase data through the Public API, for this you need to create an OAuth Service Account. In the settings of the Google Play Console, give this account permissions: Finance . Plus, the project from the Google Play Console must be linked to the project from the Google Console.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question