A
A
Alexander Savchuk2015-05-25 01:41:54
Google
Alexander Savchuk, 2015-05-25 01:41:54

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>

Gives an error message:
{
    "error":  {
    "errors":  [
            {
                "domain": "global",
                "reason": "required",
                "message": "Login Required",
                "locationType": "header",
                "location": "Authorization"
            }
        ],
        "code": 401,
        "message": "Login Required"
    }
}

What is the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Savchuk, 2015-05-28
@MrLinch

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 question

Ask a Question

731 491 924 answers to any question