Get the transaction history from Android Pay via API?

Unfortunately, it looks like this is not possible via any API at this moment. It is probably made for security purposes.

The only way to view the transaction history is by:

  • Opening the Android Pay app.
  • Touching the card you used to pay.

But there might be a workaround, though remember that you are responsible for your actions.

  • Create an AccessibilityService
  • Subscribe for AccessibilityEvent (for example focus on element) using onAccessibilityEvent()
  • Advice user to enable your service in Settings and open the Android Pay app.
  • Get focused element's text using getText() method of an AccessibilityEvent
  • Pass it to your activity using an Intent

In the EU, the implementation of an API that offers access to banking data is underway and it will involve all banks, Android Pay as a service will have to comply to it.

Here is some articles worth reading:

https://www.scribd.com/doc/298569302/The-Open-Banking-Standard https://www.mckinsey.com/industries/financial-services/our-insights/data-sharing-and-open-banking

The European Union is rapidly advancing legislation that will, upon implementation in the next two years, require UK banks (subject to consent from individuals and businesses) to open access to their customer data and payments capabilities. The UK has diligently fostered a vibrant financial technology environment and stands ready to reap the benefits of that legislation sooner than many other markets. Other markets (in the EU and beyond) have begun to implement aspects of an open banking standard, but none have produced a definitive outline of such a standard, let alone a roadmap for its implementation. There is, therefore, a significant opportunity for the UK economy if we take a lead in this space. This will require that we invest rigorously in development over the next 6-12 months.

...

Regardless of location, over the next 18 to 24 months banks should capitalize on their incumbent advantages by taking the following actions:

  • Explore data-sharing agreements with fintech and nonfinancial services firms to stay ahead of the curve.

  • Develop a perspective on APIs and their benefit to the bank’s service model, both in leveraging mandated third-party access and potentially extending access beyond statutory requirements.

  • Fully understand both existing data privacy mandates and likely changes, and determine their institution’s appetite for a less conventional approach. And examine how customer messaging would best facilitate any such change.