JSON response objects

  • This reference describes the Google Pay API response objects, including PaymentData , PaymentMethodData , CardInfo , PaymentMethodTokenizationData , and Address , for use in your application.

  • Response objects are returned by the Google Pay API client methods after a user interaction, such as approving a payment.

  • Each response object provides specific data, like payment method details, tokenization data, or user addresses, to help process transactions.

  • The structure and content of these objects vary based on the request made and the user's selection within the Google Pay payment sheet.

  • JSON request objects are covered on a separate page for a complete understanding of the Google Pay API integration.

This reference describes the Google Pay API response object options to use with your application. Response objects are objects that are returned by the Google Pay API client methods .

PaymentData

This is a response object that's returned by Google after a payer approves payment.

Property Type Always exists Description
apiVersion
number Yes Major API version. The value in the response matches the value provided in PaymentDataRequest .
apiVersionMinor
number Yes Minor API version. The value in the response matches the value provided in PaymentDataRequest .
paymentMethodData
PaymentMethodData Yes Data about the selected payment method.
email
string No Email address, if emailRequired is set to true in the PaymentDataRequest . If another request has the property set to true there's no effect.
shippingAddress
Address No Shipping address, if shippingAddressRequired is set to true in the PaymentDataRequest .

Example

This example response for Google Pay API version 2.0 shows a CARD payment method selected in the Google Pay payment sheet. A payment method token was generated for the example gateway.

 { 
  
 "apiVersion" 
 : 
  
 2 
 , 
  
 "apiVersionMinor" 
 : 
  
 0 
 , 
  
 "paymentMethodData" 
 : 
  
 { 
  
 "type" 
 : 
  
 "CARD" 
 , 
  
 "description" 
 : 
  
 "Visa •••• 1234" 
 , 
  
 "info" 
 : 
  
 { 
  
 "cardNetwork" 
 : 
  
 "VISA" 
 , 
  
 "cardDetails" 
 : 
  
 "1234" 
 , 
  
 "cardFundingSource" 
 : 
  
 "CREDIT" 
  
 }, 
  
 "tokenizationData" 
 : 
  
 { 
  
 "type" 
 : 
  
 "PAYMENT_GATEWAY" 
 , 
  
 "token" 
 : 
  
 "examplePaymentMethodToken" 
  
 } 
  
 } 
 } 

PaymentMethodData

This object provides data for a selected payment method.

Property Type Always exists Description
type
string Yes PaymentMethod type selected in the Google Pay payment sheet.
description
string Yes

User-facing message to describe the payment method that funds this transaction.

info
object Yes The value of this property depends on the payment method type returned. For CARD , see CardInfo .
tokenizationData
PaymentMethodTokenizationData No Payment tokenization data for the selected payment method.

Example

This example response shows how a CARD payment method that's selected in the Google Pay payment sheet generates a payment method token for the example gateway.

 { 
  
 "type" 
 : 
  
 "CARD" 
 , 
  
 "description" 
 : 
  
 "Visa •••• 1234" 
 , 
  
 "info" 
 : 
  
 { 
  
 "cardNetwork" 
 : 
  
 "VISA" 
 , 
  
 "cardDetails" 
 : 
  
 "1234" 
  
 }, 
  
 "tokenizationData" 
 : 
  
 { 
  
 "type" 
 : 
  
 "PAYMENT_GATEWAY" 
 , 
  
 "token" 
 : 
  
 "examplePaymentMethodToken" 
  
 } 
 } 

CardInfo

This object provides information about the selected payment card.

Property
Type
Always exists
Description
cardDetails
string
Yes
The details about the card. This value is commonly the last four digits of the selected payment account number.
assuranceDetails
Yes
This object provides information about the validation performed on the returned payment data if assuranceDetailsRequired is set to true in the CardParameters .
cardNetwork
string
Yes

The payment card network of the selected payment. Returned values match the format of allowedCardNetworks in CardParameters .

This card network value should not be displayed to the buyer. It's used when the details of a buyer's card are needed. For example, if customer support needs this value to identify the card a buyer used for their transaction. For a user-visible description, use the description property of PaymentMethodData instead.

billingAddress
No
The billing address associated with the provided payment method, if billingAddressRequired is set to true in CardParameters .
cardFundingSource
string
Yes

Card funding source for the selected payment method.

  • UNKNOWN
  • CREDIT
  • DEBIT
  • PREPAID

Example

This example shows a card on the Visa network.

 { 
  
 "cardNetwork" 
 : 
  
 "VISA" 
 , 
  
 "cardDetails" 
 : 
  
 "1234" 
 , 
  
 "cardFundingSource" 
 : 
  
 "CREDIT" 
 , 
  
 "assuranceDetails" 
 : 
  
 { 
  
 "cardHolderAuthenticated" 
 : 
  
 false 
 , 
  
 "accountVerified" 
 : 
  
 true 
  
 } 
 } 

AssuranceDetailsSpecifications

This object provides information about what validation has been performed on the returned payment credentials so that appropriate instrument risk checks can be applied.

Name Type Description
accountVerified
boolean If true , indicates that Cardholder possession validation has been performed on returned payment credential.
cardHolderAuthenticated
boolean

If true , indicates that identification and verifications (ID&V) was performed on the returned payment credential.

If false , the same risk-based authentication can be performed as you would for card transactions. This risk-based authentication can include, but not limited to, step-up with 3D Secure protocol if applicable.

You can receive and process the response Object even if you don’t use the assuranceDetails field. To receive this object, include assuranceDetailsRequired: true in the Request object's CardParameters .

PaymentMethodTokenizationData

This object provides tokenization data for the payment method.

Property
Type
Always exists
Description
type
string
Yes
The type of tokenization to be applied to the selected payment method. This value matches the type set in PaymentMethodTokenizationSpecification .
token
string
No

The generated payment method token.

Example

This is an example of a tokenized response prepared for the example gateway.

 { 
  
 "type" 
 : 
  
 "PAYMENT_GATEWAY" 
 , 
  
 "token" 
 : 
  
 "examplePaymentMethodToken" 
 } 

Address

This object provides information about a requested postal address. All the properties are strings.

Addresses can be returned in MIN , FULL , and FULL-ISO3166 formats. The properties belonging to each format can be seen in the following table.

Property Address format Description
name
MIN , FULL , FULL-ISO3166 The full name of the addressee.
postalCode
MIN , FULL , FULL-ISO3166 The postal or ZIP code.
countryCode
MIN , FULL , FULL-ISO3166 ISO 3166-1 alpha-2 country code.
phoneNumber
MIN , FULL , FULL-ISO3166 A telephone number, if phoneNumberRequired is set to true in the PaymentDataRequest .
address1
FULL , FULL-ISO3166 The first line of the address.
address2
FULL , FULL-ISO3166 The second line of the address.
address3
FULL , FULL-ISO3166 The third line of the address.
locality
FULL , FULL-ISO3166 City, town, neighborhood, or suburb.
administrativeArea
FULL , FULL-ISO3166 A country subdivision, such as a state or province.
sortingCode
FULL , FULL-ISO3166 The sorting code.
iso3166AdministrativeArea
FULL-ISO3166 ISO 3166-2 administrative area code corresponding to administrativeArea.

Example

This is an example FULL-ISO3166 format address in the United States with multiple lines of street address data.

 { 
  
 "name" 
 : 
  
 "John Doe" 
 , 
  
 "address1" 
 : 
  
 "c/o Google LLC" 
 , 
  
 "address2" 
 : 
  
 "1600 Amphitheatre Pkwy" 
 , 
  
 "address3" 
 : 
  
 "Building 40" 
 , 
  
 "locality" 
 : 
  
 "Mountain View" 
 , 
  
 "administrativeArea" 
 : 
  
 "CA" 
 , 
  
 "countryCode" 
 : 
  
 "US" 
 , 
  
 "postalCode" 
 : 
  
 "94043" 
 , 
  
 "sortingCode" 
 : 
  
 "" 
  
 "iso3166AdministrativeArea" 
 : 
  
 "US-CA" 
 } 
Design a Mobile Site
View Site in Mobile | Classic
Share by: