Search code examples
androidgoogle-apigoogle-play-consolegoogle-play-developer-api

Get users history transactions for Android Subscription via API


We have an Android app that implements subscriptions and for analysis purposes, we need all the transactions made by our users.

We want to get all the transactions via API but we cannot find any Google endpoints that return this information.
In the Google Play Console, we can see these transactions.

From the inspector, I saw that Google uses a private endpoint in order to have this data but I couldn't find any public API endpoint.

Google private endpoint is v1/developer/{devId}/orders:fetchUserLatestOrders but I didn't find any public references for orders:fetchUserLatestOrders or similar.

Has anyone had and solved this problem before?


Solution

  • After some research, I found the solution to this problem.
    In order to have all the Android transactions, you have to download the financial reports from Google Play via API.

    @icoder answer explain the correct steps:
    Access Google play account reports through Google API Client PHP Library

    Note that you should wait some hours (24 for me) when you create the service account because Google does not assign you the permissions on the fly.