- [HTTP request](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#body.request_body)
  - [JSON representation](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#body.response_body)
- [MinimumRequiredCardInfo](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#MinimumRequiredCardInfo)
  - [JSON representation](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#MinimumRequiredCardInfo.SCHEMA_REPRESENTATION)
- [EnrollmentRiskSignals](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#EnrollmentRiskSignals)
  - [JSON representation](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#EnrollmentRiskSignals.SCHEMA_REPRESENTATION)
- [CustomerRiskDetails](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#CustomerRiskDetails)
  - [JSON representation](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#CustomerRiskDetails.SCHEMA_REPRESENTATION)
- [CustomerActionType](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#CustomerActionType)
- [AccountAgeBucket](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#AccountAgeBucket)
- [TermsOfServiceAcceptance](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#TermsOfServiceAcceptance)
  - [JSON representation](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#TermsOfServiceAcceptance.SCHEMA_REPRESENTATION)
- [CustomerDetails](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#CustomerDetails)
  - [JSON representation](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#CustomerDetails.SCHEMA_REPRESENTATION)
- [EnrollResponse](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#EnrollResponse)
  - [JSON representation](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#EnrollResponse.SCHEMA_REPRESENTATION)
- [EnrollResult](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#EnrollResult)
  - [JSON representation](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#EnrollResult.SCHEMA_REPRESENTATION)
- [EnrollSuccessResult](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#EnrollSuccessResult)

Enrolls a card in Virtual Cards.

An example request looks like:


    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1
        },
        "requestId": "G1MQ0YERJ0Q7LPM",
        "requestTimestamp": {
          "epochMillis": "1481899949606"
        },
        "paymentIntegratorAccountId": "abcdef123456"
      },
      "googleManagedAcceptanceDetails": {
        "acceptanceTimestamp": {
          "epochMillis": "1481899949657"
        },
        "version": "1.1"
      },
      "cardToEnroll": {
        "accountNumber": {
          "value": "1111222233334444"
        },
        "expiryDate": {
          "expiryMonth": "11",
          "expiryYear": "25"
        }
      },
      "customerDetails": {
        "maskedEmailAddress": "l***r@gmail.com"
      },
      "riskSignals": {
        "commonRiskSignals": {
          "environmentalDetails": {
            "ipAddress": "192.168.1.1",
            "actionContext": "NATIVE_APP",
            "deviceGeoLocation": {
              "latitudeE7": "396317000",
              "longitudeE7": "-86733000"
            }
          },
          "physicalDetails": {
            "deviceToAccountBindingId": "0bba7f1e4a83ab4fdd77f5ebd6bd4495905f36db9c7c6e638833721e181bd837",
            "devicePhoneNumberLastFour": "1234",
            "deviceAccountAge": "LESS_THAN_SEVEN_DAYS",
            "android": {},
            "devicePlatformAuthenticatorEnabled": {}
          },
          "googleAccountDetails": {
            "mostRecentAccountPaymentMethodChangeActivity": "MOST_RECENT_ACCOUNT_PAYMENT_METHOD_CHANGE_ACTIVITY_LESS_THAN_ONE_DAY",
            "mostRecentAccountSecurityActivity": "MOST_RECENT_ACCOUNT_SECURITY_ACTIVITY_LESS_THAN_ONE_DAY",
            "accountAndCardNameMatch": {},
            "customerPhoneNumberLastFour": "1234",
            "autofillPaymentMethodAttempts": "42",
            "cardAge": "LESS_THAN_SEVEN_DAYS",
            "numberOfBillingLastNames": "7"
          },
          "googleRiskAssessment": {
            "deviceRiskScore": "DEVICE_RISK_SCORE_MEDIUM",
            "accountRiskScore": "ACCOUNT_RISK_SCORE_HIGH"
          }
        },
        "customerRiskDetails": {
          "hashedEmailAddress": "a34fe89600bb813871c049ed50d323811cb3f6f4daeea88372014c90e350e688",
          "customerActionType": "NEW_CARD",
          "accountAge": "ACCOUNT_AGE_BUCKET_LESS_THAN_ONE_YEAR"
        },
        "panSourceWeb": {}
      }
    }

An example success response looks like:


    {
      "responseHeader": {
        "responseTimestamp": {
          "epochMillis": "1481899950236"
        }
      },
      "result": {
        "success" :{
        }
      }
    }

### HTTP request

`POST https://www.integratorhost.example.com/integrator-base-path/virtual-cards-v1/enroll`

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "requestHeader": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/RequestHeader`) }, "cardToEnroll": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#MinimumRequiredCardInfo`) }, "riskSignals": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#EnrollmentRiskSignals`) }, "customerDetails": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#CustomerDetails`) }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "googleManagedAcceptanceDetails": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#TermsOfServiceAcceptance`) }, "externallyManagedAcceptance": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `requestHeader` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/RequestHeader`)`` **REQUIRED**: Common header for all requests. This header contains the `requestId` which is known as the `enrollmentRequestId` in other methods. It will be used in subsequent calls as a reference to the enrollment request which registered a card for Virtual Cards. The same card can be enrolled multiple times, either by multiple users (different `hashedEmailAddress`) or a single user (same `hashedEmailAddress`) with [multiple payment profiles](https://support.google.com/googlepay/answer/7644003?visit_id=638253754129670000-3896145703&rd=2#multiple-profiles). If a card is enrolled, un-enrolled, then enrolled again for Virtual Cards, the new enrollment will have a new `requestId`. |
| `cardToEnroll` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#MinimumRequiredCardInfo`)`` **REQUIRED**: The card to enroll in Virtual Cards. |
| `riskSignals` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#EnrollmentRiskSignals`)`` **REQUIRED**: The risk signals used by the vendor to make a risk assessment. |
| `customerDetails` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#CustomerDetails`)`` **REQUIRED** Details about the customer. |
| **REQUIRED**: Details about the customer's interactions with the partner's terms of service. Exactly one must be set. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `googleManagedAcceptanceDetails` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#TermsOfServiceAcceptance`)`` The presence of this field indicates that the customer accepted the partner's terms of service. This contains additional information gathered when they accepted. |
| `externallyManagedAcceptance` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` The presence of this field indicates that the partner's terms of service was not surfaced through Google. |
| End of mutually exclusive fields. ||

### Response body

This method supports multiple return types. For additional information about what 4XX or 5XX HTTP status code to return with an `ErrorResponse`, consult the `ErrorResponse` object and [HTTP status codes documentation](https://developers.google.com/pay/virtual-cards-v1/guides/connectivity/protocol-standards#http_status_codes).

| Possible response messages ||
|---|---|
| HTTP 200 Status | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#EnrollResponse`)`` |
| HTTP 4XX / 5XX Status | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/ErrorResponse`)`` |
| End of mutually exclusive fields. ||

## MinimumRequiredCardInfo

FPAN representation of a card with an expiration date. No CVN.

| JSON representation |
|---|
| ``` { "accountNumber": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/AccountNumber`) }, "expiryDate": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/ExpiryDate`) } } ``` |

| Fields ||
|---|---|
| `accountNumber` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/AccountNumber`)`` **REQUIRED**: The account number itself (i.e., the FPAN). |
| `expiryDate` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/ExpiryDate`)`` **REQUIRED**: Expiration date, month and year. |

## EnrollmentRiskSignals

Information used by the vendor to make risk assessment about enrolling the card in Virtual Cards.

| JSON representation |
|---|
| ``` { "commonRiskSignals": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/RiskSignals`) }, "customerRiskDetails": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#CustomerRiskDetails`) }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "panSourceWeb": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) }, "panSourceAndroid": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) }, "panSourceIos": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) }, "panSourceUnknown": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `commonRiskSignals` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/RiskSignals`)`` **REQUIRED** Common request risk signals. |
| `customerRiskDetails` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#CustomerRiskDetails`)`` **REQUIRED** Details about the customer. |
| **REQUIRED**: How the PAN was sourced by Google. <br /> > [!NOTE] > **Note:** Exactly one must be set once it available to be populated. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: <br /> ||
| `panSourceWeb` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` The PAN was sourced on a web browser. |
| `panSourceAndroid` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` The PAN was sourced on an Android client. |
| `panSourceIos` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` The PAN was sourced on an iOS client. |
| `panSourceUnknown` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` The source of the PAN is unknown. |
| End of mutually exclusive fields. ||

## CustomerRiskDetails

Details about the customer.

| JSON representation |
|---|
| ``` { "hashedEmailAddress": string, "customerActionType": enum (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#CustomerActionType`), "accountAge": enum (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#AccountAgeBucket`) } ``` |

| Fields ||
|---|---|
| `hashedEmailAddress` | `string` **REQUIRED**: A hash of the customer's email address. This is stable for the same email address across multiple enrollments. The value for a given email address will be different for different partners. This is a string that has 64 characters and contains only the characters "0-9" and "a-f". |
| `customerActionType` | ``enum (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#CustomerActionType`)`` **REQUIRED**: The action the customer took to trigger the enrollment. |
| `accountAge` | ``enum (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#AccountAgeBucket`)`` **REQUIRED**: Tenure of the Google account. |

## CustomerActionType

The action the customer took to trigger the enrollment.

| Enums ||
|---|---|
| `CUSTOMER_ACTION_TYPE_UNSPECIFIED` | DO NOT USE |
| `PUSH_PROVISIONING` | When a customer enables a card in GPay from an issuer's platform. |
| `NEW_CARD` | When a customer enrolls a new card. |
| `EXISTING_CARD` | When a customer enrolls an existing card on file. |

## AccountAgeBucket

Tenure of the Google account.

| Enums ||
|---|---|
| `ACCOUNT_AGE_BUCKET_UNSPECIFIED` | DO NOT USE |
| `ACCOUNT_AGE_BUCKET_LESS_THAN_ONE_DAY` | The account age is less than one day. |
| `ACCOUNT_AGE_BUCKET_LESS_THAN_SEVEN_DAYS` | The account age is less than seven days. |
| `ACCOUNT_AGE_BUCKET_LESS_THAN_THIRTY_DAYS` | The account age is less than thirty days. |
| `ACCOUNT_AGE_BUCKET_LESS_THAN_ONE_YEAR` | The account age is less than one year (365 days). |
| `ACCOUNT_AGE_BUCKET_ONE_YEAR_OR_GREATER` | The account age is one year (365 days) or greater. |

## TermsOfServiceAcceptance

The presence of this field indicates that the customer accepted the partner's terms of service. This contains additional information gathered when they accepted.

| JSON representation |
|---|
| ``` { "acceptanceTimestamp": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Timestamp`) }, "version": string } ``` |

| Fields ||
|---|---|
| `acceptanceTimestamp` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Timestamp`)`` **REQUIRED**: The timestamp when the customer accepted the partner's terms of service. |
| `version` | `string` **REQUIRED**: The version of the partner's terms of service that the customer accepted. |

## CustomerDetails

Details about the customer.

| JSON representation |
|---|
| ``` { "maskedEmailAddress": string } ``` |

| Fields ||
|---|---|
| `maskedEmailAddress` | `string` **REQUIRED** : The masked email of the customer enrolling the card. Used in the issuer's ecosystem to indicate to a customer which accounts have enrolled the card. Three asterisks are used to mask the symbols between the first and last symbols of an email address. (Ex: "l\*\*\*[r@gmail.com"](mailto:r@gmail.com”)) The result is not a valid email address. |

## EnrollResponse

Response object for the `enroll` method.

| JSON representation |
|---|
| ``` { "responseHeader": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/ResponseHeader`) }, "result": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#EnrollResult`) } } ``` |

| Fields ||
|---|---|
| `responseHeader` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/ResponseHeader`)`` **REQUIRED**: Common header for all responses. |
| `result` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#EnrollResult`)`` **REQUIRED**: Contains the result of the request. |

## EnrollResult

Details corresponding to the result.

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "success": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#EnrollSuccessResult`) }, "invalidCardDetails": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) }, "cardIneligible": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) }, "riskDeclined": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) }, "tosNotAccepted": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) }, "tosAcceptanceOutdated": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) }, "cardAccountClosed": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) }, "panNoLongerValid": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) }, "unknownPan": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) }, "incorrectExpiration": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| **REQUIRED**: Contains the possible result types. Exactly one must be set. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `success` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/enroll#EnrollSuccessResult`)`` The request to `enroll` was successful and the card is enrolled in Virtual Cards. |
| `invalidCardDetails` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` **DEPRECATED** : All decline cases covered by this case should instead be covered by `cardAccountClosed`, `panNoLongerValid`, `unknownPan`, or `incorrectExpiration`. <br /> > [!NOTE] > **Note:** This field will be removed once all usages of it has been migrated to other fields in the `EnrollResult.result` union field. ETA: H1 2024. <br /> Declined because the card details, while formatted correctly, were invalid. (e.g. The expiration date did not match). |
| `cardIneligible` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` Declined because the card was valid/active, but ineligible to be enrolled in Virtual Cards. The card could potentially become eligible at a future date. |
| `riskDeclined` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` Declined for risk reasons. |
| `tosNotAccepted` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` Declined because the customer has not accepted the partner's terms of service. This result is only applicable if the partner's terms of service was not surfaced through Google, i.e. the request contained 'externallyManagedAcceptance'. |
| `tosAcceptanceOutdated` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` Declined because too much time has passed since the customer's acceptance of the partner's terms of service and the enrollment attempt. This result is only applicable if the partner's terms of service was not surfaced through Google, i.e. the request contained 'externallyManagedAcceptance'. |
| `cardAccountClosed` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` Declined because the card account has been closed or is effectively closed (i.e. the underlying account with the financial institution is closed or in a similar terminal state, e.g. bankrupt). The user may still have other active card accounts with this financial institution. |
| `panNoLongerValid` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` Declined because the PAN is no longer valid, i.e. the PAN is recognized but has been invalidated or updated (card lost, stolen, expired, etc). The underlying card account is still open (use cardAccountClosed otherwise). |
| `unknownPan` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` Declined because the PAN was unrecognized. |
| `incorrectExpiration` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` Declined because the expiration was incorrect. |
| End of mutually exclusive fields. ||

## EnrollSuccessResult

This type has no fields.
Details about the success result.