This reference describes the Google Pay API response object options to use with your website.
Response objects are objects that are returned by the Google Pay API
[client methods](https://developers.google.com/pay/api/web/reference/client).

#### Response objects

- [`IsReadyToPayResponse`](https://developers.google.com/pay/api/web/reference/response-objects#IsReadyToPayResponse)
- [`PaymentData`](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData)
- [`IntermediatePaymentData`](https://developers.google.com/pay/api/web/reference/response-objects#IntermediatePaymentData)
- [`PaymentMethodData`](https://developers.google.com/pay/api/web/reference/response-objects#PaymentMethodData)
- [`CardInfo`](https://developers.google.com/pay/api/web/reference/response-objects#CardInfo)
- [`PaymentMethodTokenizationData`](https://developers.google.com/pay/api/web/reference/response-objects#PaymentMethodTokenizationData)
- [`PaymentAuthorizationResult`](https://developers.google.com/pay/api/web/reference/response-objects#PaymentAuthorizationResult)
- [`PaymentDataError`](https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataError)
- [`Address`](https://developers.google.com/pay/api/web/reference/response-objects#Address)
- [`IntermediateAddress`](https://developers.google.com/pay/api/web/reference/response-objects#IntermediateAddress)
- [`SelectionOptionData`](https://developers.google.com/pay/api/web/reference/response-objects#SelectionOptionData)
- [`OfferData`](https://developers.google.com/pay/api/web/reference/response-objects#OfferData)
- [`IntermediatePaymentMethodData`](https://developers.google.com/pay/api/web/reference/response-objects#IntermediatePaymentMethodData)
- [`IntermediateCardInfo`](https://developers.google.com/pay/api/web/reference/response-objects#IntermediateCardInfo)

> [!IMPORTANT]
> **Key Point:** The [request objects](https://developers.google.com/pay/api/web/reference/request-objects) and
> [error objects](https://developers.google.com/pay/api/web/reference/error-objects) are covered in their respective
> pages.
>
> #### Request objects
>
> - [`PaymentOptions`](https://developers.google.com/pay/api/web/reference/request-objects#PaymentOptions)
> - [`IsReadyToPayRequest`](https://developers.google.com/pay/api/web/reference/request-objects#IsReadyToPayRequest)
> - [`PaymentDataRequest`](https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest)
> - [`PaymentDataCallbacks`](https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataCallbacks)
> - [`PaymentDataRequestUpdate`](https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequestUpdate)
> - [`MerchantInfo`](https://developers.google.com/pay/api/web/reference/request-objects#MerchantInfo)
> - [`PaymentMethod`](https://developers.google.com/pay/api/web/reference/request-objects#PaymentMethod)
> - [`TokenizationSpecification`](https://developers.google.com/pay/api/web/reference/request-objects#PaymentMethodTokenizationSpecification)
> - [`CardParameters`](https://developers.google.com/pay/api/web/reference/request-objects#CardParameters)
> - [`BillingAddressParameters`](https://developers.google.com/pay/api/web/reference/request-objects#BillingAddressParameters)
> - [`ShippingAddressParameters`](https://developers.google.com/pay/api/web/reference/request-objects#ShippingAddressParameters)
> - [`ShippingOptionParameters`](https://developers.google.com/pay/api/web/reference/request-objects#ShippingOptionParameters)
> - [`SelectionOption`](https://developers.google.com/pay/api/web/reference/request-objects#SelectionOption)
> - [`TransactionInfo`](https://developers.google.com/pay/api/web/reference/request-objects#TransactionInfo)
> - [`DisplayItem`](https://developers.google.com/pay/api/web/reference/request-objects#DisplayItem)
> - [`ButtonOptions`](https://developers.google.com/pay/api/web/reference/request-objects#ButtonOptions)
>
> #### Error objects
>
> - [`PaymentsError`](https://developers.google.com/pay/api/web/reference/error-objects#PaymentsError)

## IsReadyToPayResponse

This object provides information about a website visitor's ability to provide payment information
to the site that requests it.

| Property | Type | Always exists | Description |
|---|---|---|---|
| `result` | boolean | Yes | The current visitor is able to provide payment information to the site that requests it. A visitor's ability to pay may be tied to their web browser's ability to display required components for the specified payment methods. This includes when they log in to a Google Account and provide a payment method. |
| `paymentMethodPresent` | boolean | No | If `true`, the visitor has one or more payment methods as specified in the `allowedPaymentMethods` property of the provided [IsReadyToPayRequest](https://developers.google.com/pay/api/web/reference/request-objects#IsReadyToPayRequest). Exists only when `existingPaymentMethodRequired` was set to `true` in [IsReadyToPayRequest](https://developers.google.com/pay/api/web/reference/request-objects#IsReadyToPayRequest). If `PaymentsClient` is initialized with an `environment` property of `TEST` a payment method is always considered present. > [!CAUTION] > **Caution:** This property relies on cookies and cross-site tracking. If these are unavailable, `paymentMethodPresent` is not returned in the response. Even if `existingPaymentMethodRequired` is set to `true` in the [IsReadyToPayRequest](https://developers.google.com/pay/api/web/reference/request-objects#IsReadyToPayRequest). |

### Example

The following example shows you when the current visitor is able to provide payment information
to the site that requests it.

```javascript
{
  "result": true
}
```

## 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`](https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest). |
| `apiVersionMinor` | number | Yes | Minor API version. The value in the response matches the value provided in [`PaymentDataRequest`](https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest). |
| `paymentMethodData` | [PaymentMethodData](https://developers.google.com/pay/api/web/reference/response-objects#PaymentMethodData) | Yes | Data about the selected payment method. |
| `email` | string | No | Email address, if `emailRequired` is set to `true` in the [PaymentDataRequest](https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest). If another request has the property set to `true` there's no effect. |
| `shippingAddress` | [Address](https://developers.google.com/pay/api/web/reference/response-objects#Address) | No | Shipping address, if `shippingAddressRequired` is set to `true` in the [PaymentDataRequest](https://developers.google.com/pay/api/web/reference/request-objects#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.

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

## IntermediatePaymentData

This object is returned by the Google Pay API `onPaymentDataChanged()` input when
shipping address or shipping options is changed in the payment sheet.

| Property | Type | Necessity | Description |
|---|---|---|---|
| `callbackTrigger` | String | Optional | Describes the reason for which payment data callback was invoked. - `INITIALIZE` - `SHIPPING_ADDRESS` - `SHIPPING_OPTION` - `PAYMENT_METHOD` - `OFFER` **Note:** The `INITIALIZE` callback may be triggered multiple times along a single call to loadPaymentData, so you must make sure you can handle multiple calls to it. For example, when the user changes accounts, onPaymentDataChanged is called with `INITIALIZE` again with data from the new account. |
| `offerData` | [OfferData](https://developers.google.com/pay/api/web/reference/response-objects#OfferData) | Optional | The promotional code provided by the user. |
| `shippingAddress` | [IntermediateAddress](https://developers.google.com/pay/api/web/reference/response-objects#IntermediateAddress) | Optional | The selected address in the payment sheet. |
| `shippingOptionData` | [SelectionOptionData](https://developers.google.com/pay/api/web/reference/response-objects#SelectionOptionData) | Optional | The selected shipping option in the payment sheet. |
| `paymentMethodData` | [IntermediatePaymentMethodData](https://developers.google.com/pay/api/web/reference/response-objects#IntermediatePaymentMethodData) | Optional | The payment method data selected in the payment sheet. |

### Examples

This example shows the intermediate payload returned from Google Pay API for shipping address changes.

```javascript
{
  "callbackTrigger": "SHIPPING_ADDRESS",
  "offerData": {
    "redemptionCode": "exampleCode"
  },
  "shippingAddress": {
    "administrativeArea": "NY",
    "countryCode": "US",
    "locality": "New York",
    "postalCode": "10011"
  },
  "shippingOptionData": {
    "id": "shipping-001"
  }
}
```

This example shows the intermediate payload returned when the payment method changes.

```javascript
{
  "callbackTrigger": "PAYMENT_METHOD",
  "paymentMethodData": {
    "type": "CARD",
    "info": {
      "cardNetwork": "VISA",
      "cardFundingSource": "CREDIT",
      "billingAddress": {
        "administrativeArea": "NY",
        "countryCode": "US",
        "locality": "New York",
        "postalCode": "10011"
      }
    }
  }
}
```

## PaymentMethodData

This object provides data for a selected payment method.

| Property | Type | Always exists | Description |
|---|---|---|---|
| `type` | string | Yes | [`PaymentMethod`](https://developers.google.com/pay/api/web/reference/request-objects#PaymentMethod) `type` selected in the Google Pay payment sheet. |
| `description` | string | Yes | User-facing message to describe the payment method that funds this transaction. **Important:** Don't attempt to parse the contents of this string. The format, contents, and length might change at any time. If you need additional details, see the `info` property. |
| `info` | object | Yes | The value of this property depends on the payment method `type` returned. For `CARD`, see [`CardInfo`](https://developers.google.com/pay/api/web/reference/response-objects#CardInfo). |
| `tokenizationData` | [PaymentMethodTokenizationData](https://developers.google.com/pay/api/web/reference/response-objects#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.

```javascript
{
  "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` | [AssuranceDetailsSpecifications](https://developers.google.com/pay/api/web/reference/response-objects#assurance-details-specifications) | Yes | This object provides information about the validation performed on the returned payment data if `assuranceDetailsRequired` is set to `true` in the [CardParameters](https://developers.google.com/pay/api/web/reference/request-objects#CardParameters). |
| `cardNetwork` | string | Yes | The payment card network of the selected payment. Returned values match the format of `allowedCardNetworks` in [CardParameters](https://developers.google.com/pay/api/web/reference/request-objects#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](https://developers.google.com/pay/api/web/reference/response-objects#PaymentMethodData) instead. |
| `billingAddress` | [Address](https://developers.google.com/pay/api/web/reference/response-objects#Address) | No | The billing address associated with the provided payment method, if `billingAddressRequired` is set to `true` in [CardParameters](https://developers.google.com/pay/api/web/reference/request-objects#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.

```javascript
{
  "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. > [!NOTE] > **Note:** If both `cardHolderAuthenticated` and `accountVerified` are `true`, you don't need to step up the returned credentials. If both aren't, we recommend you to run the same risk checks and , authentication including 3D Secure flow 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](https://developers.google.com/pay/api/web/reference/request-objects#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`](https://developers.google.com/pay/api/web/reference/request-objects#PaymentMethodTokenizationSpecification). |
| `token` | string | No | The generated payment method token. - [PAYMENT_GATEWAY](https://developers.google.com/pay/api/web/reference/request-objects#gateway): JSON object string that contains a chargeable token issued by your gateway. - [DIRECT](https://developers.google.com/pay/api/web/reference/request-objects#direct): `protocolVersion`, `signature`, and a `signedMessage` for decryption. See [Payment method token structure](https://developers.google.com/pay/api/web/guides/resources/payment-data-cryptography#payment-method-token-structure) for more information. |

### Example

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

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

## PaymentAuthorizationResult

This object provides information about the payment authorization result.

| Property | Type | Necessity | Description |
|---|---|---|---|
| `transactionState` | String | Required | The state of the transaction is resolved by one of the following merchant results: - `SUCCESS` - `ERROR` |
| `error` | [PaymentDataError](https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataError) | Optional | The error to be rendered in the payment sheet for the user when it's necessary to retry the payment. |

### Example

The following example shows the payment result return after a payment is processed:

```javascript
{
  "transactionState": "ERROR",
  "error": {
    "reason": "PAYMENT_DATA_INVALID",
    "message": "Cannot pay with payment credentials",
    "intent": "PAYMENT_AUTHORIZATION"
  }
}
```

## PaymentDataError

| Property | Type | Necessity | Description |
|---|---|---|---|
| `reason` | String | Required | List of predefined error reasons: - `OFFER_INVALID` - `PAYMENT_DATA_INVALID` - `SHIPPING_ADDRESS_INVALID` - `SHIPPING_ADDRESS_UNSERVICEABLE` - `SHIPPING_OPTION_INVALID` - `OTHER_ERROR` |
| `message` | String | Required | Error message to the user that's displayed in a dialog. |
| `intent` | String | Required | The intent of the error. This must be one that's been registered in [`PaymentDataRequest`](https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest) from the start of the flow. - `OFFER` - `PAYMENT_AUTHORIZATION` - `SHIPPING_ADDRESS` - `SHIPPING_OPTION` |

### Example

This example shows the error intent and message to be rendered in the payment sheet.

```javascript
{
  "error": {
    "reason": "SHIPPING_OPTION_INVALID",
    "message": "This shipping option is invalid for the given address",
    "intent": "SHIPPING_OPTION"
  }
}
```

## 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](https://developers.google.com/pay/api/web/reference/request-objects#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.

```javascript
{
  "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"
}
```

## IntermediateAddress

The intermediate address contains a redacted shipping address (without street-level address lines or recipient names) to allow calculating applicable tax and shipping options before the user authorizes payment.

| Property | Type | Necessity | Description |
|---|---|---|---|
| `administrativeArea` | String | Required | A country subdivision, such as a state or province. |
| `countryCode` | String | Required | ISO 3166-1 alpha-2 country code. |
| `locality` | String | Required | City, town, neighborhood, or suburb. |
| `postalCode` | String | Required | The redacted postal code based on the country. For Canada and the UK, this contains only the first three characters. For US, this contains the first five digits. |
| `iso3166AdministrativeArea` | String | Optional | ISO 3166-2 administrative area code corresponding to administrativeArea. Only present if the shipping address format is `FULL-ISO3166`. |

### Example

This example shows you the address selected in the payment sheet.

```javascript
{
  "administrativeArea": "NY",
  "countryCode": "US",
  "locality": "New York",
  "postalCode": "10011"
  "iso3166AdministrativeArea": "US-NY"
}
```

## SelectionOptionData

| Property | Type | Necessity | Description |
|---|---|---|---|
| `id` | String | Required | Matches with [`SelectionOption.id`](https://developers.google.com/pay/api/web/reference/request-objects#SelectionOption) |

### Example

This example shows you the shipping option selected in the payment sheet.

```javascript
{
  "id": "shipping-001"
}
```

## OfferData

This object provides information about an offer code entered into the payment sheet.

| Property | Type | Necessity | Description |
|---|---|---|---|
| `redemptionCodes` | array | Always exists | The set of promotional codes entered into the payment sheet. Includes codes that have already been approved. |

### Example

The following example shows an `OfferData` object with a `redemptionCodes` array.

```javascript
"offerData": {
    "redemptionCodes": ["PROMOTIONALCODE"]
}
```

## IntermediatePaymentMethodData

This object contains limited information about the selected payment method for developer callbacks.

| Property | Type | Necessity | Description |
|---|---|---|---|
| `type` | string | Required | Type of payment method. Only `CARD` is supported for this callback. |
| `info` | [IntermediateCardInfo](https://developers.google.com/pay/api/web/reference/response-objects#IntermediateCardInfo) | Optional | Information about the selected card. Only present if `type` is `CARD`. |

## IntermediateCardInfo

This object contains limited information about the selected card, used in developer callbacks.

| Property | Type | Necessity | Description |
|---|---|---|---|
| `billingAddress` | [IntermediateAddress](https://developers.google.com/pay/api/web/reference/response-objects#IntermediateAddress) | Optional | The billing address associated with the card. Only populated when billing address is set as required. |
| `cardNetwork` | string | Optional | The payment card network of the selected payment card. Returned values match the format of `allowedCardNetworks` in [CardParameters](https://developers.google.com/pay/api/web/reference/request-objects#CardParameters). This card network value shouldn't be displayed to the buyer. |
| `cardFundingSource` | string | Optional | Card funding source for the selected payment card. - `UNKNOWN` - `CREDIT` - `DEBIT` - `PREPAID` |