Method: associateAccount

Stay organized with collections Save and categorize content based on your preferences.

Associates the customer's account with the payment processor to the Google instrument being added.

Account association happens after the integrator has authenticated the user. Association occurs via a server-to-server call that contains the requestId for the associated authentication flow (authenticationRequestId), an associationId and a googlePaymentToken (GPT). The payment processor should associate the associationId and the googlePaymentToken to the customer's account for authentication. The GPT is used to initiate payments. The associationId is used during re-authentication calls to identify the account for authentication.

If Google sends an associationId or a googlePaymentToken that the integrator has already seen during a different association, then it throws an error.

An example request looks like:


{
  "requestHeader": {
    "protocolVersion": {
      "major": 2
    },
    "requestId": "bWVyY2hhbnQgdHJhbnNhY3Rpb24gaWQ",
    "requestTimestamp": {
      "epochMillis": "1502220196077"
    },
    "paymentIntegratorAccountId": "InvisiCashUSD"
  },
 "authenticationRequestId": "bnAxdWTydDX==",
  "googlePaymentToken": {
    "issuerId": {
      "value": "InvisiCashUSA"
    },
    "token": "ZXhhbXBsZSB1bmlxdWUgcGF5bWVudCB0b2tlbiB2YWx1ZQ"
  },
 "associationId": "LmddbXBsZSByZWZlcmVuY2UgdG9rZW4gdmFsdWU",
 "provideUserInformation": true
}

An example response looks like:


{
  "responseHeader": {
    "responseTimestamp": {
      "epochMillis": "1481900013178"
    }
  },
  "result": {
    "success": {
      "bankAccountIdentifier": {
        "singaporeBankAccount": {
          "sgFastBankAccount": {
            "localAccountNumber": "113A",
            "swiftBic": {
              "value": "COBADEFF478"
            }
          },
          "localBankIdentifier":{
            "localBankCode": "7171",
            "localBranchCode": "060"
          }
        }
      },
      "bankAccountDetails" : {
        "accountNumberSuffix": "1234",
        "bankAccountType": {
          "type": "SAVINGS"
        },
        "bankAccountMetadata": {
        }
      },
      "transactionLimits": {
        "transactionMaxLimit": {
          "noLimit": {}
        }
      },
      "userInformation": {
        "name": "Example Customer",
        "addressLine": ["70 Pasir Panjang Rd"],
        "localityName": "#03-71",
        "postalCodeNumber": "117371",
        "countryCode": "SG"
      }
    }
  }
}

HTTP request

POST https://www.integratorhost.example.com/v2/associateAccount

Request body

The request body contains data with the following structure:

JSON representation
{
  "requestHeader": {
    object (RequestHeader)
  },
  "provideUserInformation": boolean,
  "googlePaymentToken": {
    object (GooglePaymentToken)
  },
  "associationId": string,
  "authenticationRequestId": string
}
Fields
requestHeader

object (RequestHeader)

REQUIRED: Common header for all requests.

provideUserInformation

boolean

REQUIRED: True if we desire the integrator to provide the address associated with this account.

googlePaymentToken

object (GooglePaymentToken)

REQUIRED: The token that Google will use to initiate purchases with the payment processor.

associationId

string

REQUIRED: The identifier of this association. This identifier is created by Google and is sent during re-authentication flows to identify which account should be authenticated.

This is a string that has a maximum length of 100 characters.

Union field account_verification.

account_verification can be only one of the following:

authenticationRequestId

string

requestId of the authentication request that preceded this call. This identifier was generated by Google during the authentication flow. This is only present if the user went through the Android app authentication, web authentication, or an asynchronous authentication method that uses authenticationResultNotification.

Response body

If successful, the response body contains data with the following structure:

Response object for the associate account method.

JSON representation
{
  "responseHeader": {
    object (ResponseHeader)
  },
  "result": {
    object (AssociateAccountResult)
  }
}
Fields
responseHeader

object (ResponseHeader)

REQUIRED: Common header for all responses.

result

object (AssociateAccountResult)

REQUIRED: Result of this association.

GooglePaymentToken

Describes a GooglePaymentToken (GPT), including the token and the issuer of the backing user account.

JSON representation
{
  "issuerId": {
    object (IssuerId)
  },
  "token": string
}
Fields
issuerId

object (IssuerId)

REQUIRED: The identifier of the issuer of the backing user account.

token

string

REQUIRED: This is the token that both companies will use to identify the account for purchases between each other.

IssuerId

A unique identifier for an issuer of user accounts.

JSON representation
{
  "value": string
}
Fields
value

string

REQUIRED: The string value of the identifier. This unique identifier is defined by Google. Google will share a list with the identifiers for all external issuers available via the payment integrator.

AssociateAccountResult

JSON representation
{

  // Union field result can be only one of the following:
  "success": {
    object (SuccessDetails)
  },
  "userAuthenticationFailed": {
    object (Empty)
  },
  "notEligible": {
    object (Empty)
  },
  "otpNotMatched": {
    object (Empty)
  },
  "otpAlreadyUsed": {
    object (Empty)
  },
  "otpLimitReached": {
    object (Empty)
  }
  // End of list of possible types for union field result.
}
Fields

Union field result.

result can be only one of the following:

success

object (SuccessDetails)

The account association was successful.

userAuthenticationFailed

object (Empty)

Even though the account authentication bundle was returned, the user authentication failed.

notEligible

object (Empty)

User's account is not eligible for this service.

otpNotMatched

object (Empty)

OTP did not match what the integrator sent.

otpAlreadyUsed

object (Empty)

OTP was already used.

otpLimitReached

object (Empty)

User has requested or tried to verify too many OTPs.

SuccessDetails

JSON representation
{
  "transactionLimits": {
    object (TransactionLimits)
  },
  "userInformation": {
    object (UserInformation)
  },

  // Union field account_identifier can be only one of the following:
  "associatedAccountIdentifier": {
    object (AssociatedAccountIdentifier)
  },
  "bankAccountIdentifier": {
    object (BankAccountIdentifier)
  }
  // End of list of possible types for union field account_identifier.

  // Union field account_details can be only one of the following:
  "associatedAccountDetails": {
    object (AssociatedAccountDetails)
  },
  "bankAccountDetails": {
    object (MaskedBankAccountDetails)
  }
  // End of list of possible types for union field account_details.
}
Fields
transactionLimits

object (TransactionLimits)

REQUIRED: Defines user scoped transaction limits.

userInformation

object (UserInformation)

REQUIRED: User information that the integrator knows and will share with Google about this customer. Used for risk information and address prepopulation.

Union field account_identifier.

account_identifier can be only one of the following:

associatedAccountIdentifier

object (AssociatedAccountIdentifier)

The account ID the user has with the integrator.

bankAccountIdentifier

object (BankAccountIdentifier)

The account ID the user has with a bank.

Union field account_details.

account_details can be only one of the following:

associatedAccountDetails

object (AssociatedAccountDetails)

Details about the account that was associated.

bankAccountDetails

object (MaskedBankAccountDetails)

Details about the bank account that was associated.

UserInformation

Structure holding information about a user.

JSON representation
{
  "name": string,
  "addressLine": [
    string
  ],
  "localityName": string,
  "administrativeAreaName": string,
  "postalCodeNumber": string,
  "countryCode": string,
  "phone": string,
  "emailAddress": string
}
Fields
name

string

OPTIONAL: Customer's full name.

addressLine[]

string

OPTIONAL: This holds unstructured Address text.

localityName

string

OPTIONAL: This is something of a fuzzy term, but it generally refers to the city/town portion of an address. In regions of the world where localities are not well defined or do not fit into this structure well (for example, Japan and China), leave localityName empty and use addressLine.

Examples: US city, IT comune, UK post town.

administrativeAreaName

string

OPTIONAL: Top-level administrative subdivision of this country" Examples: US state, IT region, CN province, JP prefecture."

postalCodeNumber

string

OPTIONAL: Despite the name, postalCodeNumber values are frequently alphanumeric. Examples: "94043", "SW1W", "SW1W 9TQ".

countryCode

string

OPTIONAL: Customer address country code, expected to be ISO-3166-1 Alpha-2.

phone

string

OPTIONAL: Customer's phone number.

emailAddress

string

OPTIONAL: Customer's email address.