Android Pay API Overview

The Android Pay API offers a quick and easy path to enable secure, one touch payments in your app using your existing payment infrastructure. Once you complete the integration with your app's payment processing flow, Android users will enjoy a rapid, consistent checkout process with Android Pay.

If you wish to:

    1. Have Google process payments for you, or
    2. Sell digital goods such as movies or games
within your app, please use Google Play In-app Billing instead.

If you're looking for in store payment options, please see our Android Pay In Store Merchant Center for more information.

Before you begin

Before you begin the integration process, please review this list carefully to determine if your business and your application can work with the following requirements and limitations:

App developers should consult their processor to be sure that Android Pay is enabled for all countries where their app is live.

lightbulb_outline Contact Us: If you have any questions regarding the integration, please Contact Us.

About the Android Pay API

A significant portion of the Android Pay API's functionality is provided as part of Google Play Services, the core services for developing on Android. If you need to learn about Android development before getting started, work through some lessons in the Training for Android Developers.

The API provides all the Java methods you need to implement your payment process flow, including:

  • create an Android Pay buy button
  • request and receive encrypted shipping and payment information about the user
  • allow the user to change or update their information
  • execute a transaction

Google does not collect payments for your transactions. Payments are handled by your payment processor. Some payment processors impose specific integration requirements. This point is repeated at certain places in the integration guide, but we strongly recommend that you read through the processor's documentation before you begin the integration.

Each request from your app and each response from the Google server encapsulates the necessary payment data in a Java object. In the simplest terms, the flow looks like this:

  1. When the user taps the Android Pay button, the app requests MaskedWallet information. The Masked Wallet contains partial payment information such as billing address, shipping address, masked backing payment instrument number, and cart items.
  2. Google returns a MaskedWallet response containing the user's wallet information. The app uses this information to present order review screens and other options. For example, the user might want to change their selected payment instrument or add a new shipping address.
  3. To complete the order, the app requests the FullWallet.
  4. Google passes back FullWallet information, which includes the detailed Android Pay payment credentials for the transaction.

For an introduction to the API methods and how they are used to create a sample payment process flow, see Introducing the API Classes.

Integration Outline

Design

To craft a great user experience and ensure a smooth payment flow, please follow our recommendations. Here is a short list of points to keep in mind:

  • Display Android Pay early and prominently as a payment method.
  • Display all relevant purchase information, including final price and items/services purchased, before confirming an order.
  • Allow users the option to edit their Android Pay payment method and/or shipping address on subsequent transactions.
  • Use Google branded Android Pay UX assets.

Please visit our Branding requirements and Best Practices.

Setup

To prepare for the integration, follow these basic steps:

  1. Install Android Studio if it is not already installed.
  2. Import the Google Play Services library

See Project Setup for the details.

Implement and test

  1. Configure your project to enable Android Pay.
  2. Install Android Pay on the Android device you will use for testing, and add a payment card
    from our ever growing list of participating banks and supported cards.
  3. Review the payment page for your payment processor and follow any specific instructions given by your payment processor.
  4. Implement your purchase flow:
    1. Check if the user is ready to pay to determine whether to show or hide the purchase button.
    2. Render the purchase button on your shopping cart and payment pages.
    3. Display the user's selected payment and shipping information on your purchase review page.
    4. Retrieve full payment information when the user confirms the purchase.

These steps are covered in detail in the tutorial.

Deploy

Once you complete the test implementation, you have a little more work to do before you start accepting payments. This is a good time to Download the Android Pay API checklist and compare your app against it. And once again, please review your payment processor's requirements:

  Adyen Bank of America Merchant Services Braintree Cardstream Creditcall Cybersource Elavon First Data Global Payments Judo Klarna Simplify Stripe TapPay Vantiv Worldnet Worldpay Zooz

In addition, you need to generate a client id for production, sign your app with the release key, and target your environment to production.

To learn how to complete the process and start accepting payments, see the Deployment guide.

lightbulb_outline Contact Us: If you have any questions regarding the integration, please Contact Us.

More Resources

API Reference Guide
Code Lab
Sample App

Send feedback about...

Android Pay API
Need help? Visit our support page.