Method: associateAccountWithVendorGeneratedToken

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) and an associationId.The payment processor should associate the associationId to the customer's account. The associationId is used during re-authentication calls to identify the account for authentication.

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

In the response, the payment processor generates a 'vendorPaymentToken' which is bound to the customer's account and is used for authorizing subsequent payments.

An example request looks like:


  "requestHeader": {
    "protocolVersion": {
      "major": 2
    },
    "requestId": "bWVyY2hhbnQgdHJhbnNhY3Rpb24gaWQ",
    "requestTimestamp": {
      "epochMillis": "1502220196077"
    },
    "paymentIntegratorAccountId": "InvisiCashUSD"
  },
 "authenticationRequestId": "bnAxdWTydDX==",
 "associationId": "LmddbXBsZSByZWZlcmVuY2UgdG9rZW4gdmFsdWU=",
 "provideUserInformation": true
}

An example response looks like:


{
  "responseHeader": {
    "responseTimestamp": {
      "epochMillis": "1481900013178"
    },
    "requestId": "bWVyY2hhbnQgdHJhbnNhY3Rpb24gaWQ"
  },
  "vendorPaymentToken": "ZXhhbXBsZSB1bmlxdWUgcGF5bWVudCB0b2tlbiB2YWx1ZQ==",
  "tokenExpirationTime": {
      "epochMillis": "0"
  }
  "userInformation": {
    "name": "Example Customer",
    "addressLine": ["123 Main St"],
    "localityName": "Springfield",
    "administrativeAreaName": "CO",
    "postalCodeNumber": "80309",
    "countryCode": "US"
  },
  "result": {"success": {}},
}

HTTP request

POST https://www.integratordomain.com/v2/associateAccountWithVendorGeneratedToken

Request body

The request body contains data with the following structure:

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

  // Union field account_verification can be only one of the following:
  "authenticationRequestId": string,
  "otpVerification": {
    object (OtpVerification)
  }
  // End of list of possible types for union field account_verification.
}
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.

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

OPTIONAL: 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.

otpVerification

object (OtpVerification)

Data necessary to verify an OTP generated from sendOtp. This is only present if the user went through the sendOtp path.

Response body

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

Response object for the v1.associateAccountWithVendorGeneratedToken method.

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

object (ResponseHeader)

REQUIRED: Common header for all responses.

paymentIntegratorAssociateAccountId
(deprecated)

string

DEPRECATED: This identifier is specific to the integrator and is generated by the integrator. It is used for debugging purposes only in order to identify this call. This is the identifier that the integrator knows this call by.

result

object (AssociateAccountResult)

REQUIRED: Result of this association.

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
{
  "vendorPaymentToken": string,
  "tokenExpirationTime": {
    object (Timestamp)
  },
  "accountDetails": {
    object (AssociatedAccountDetails)
  },
  "accountId": {
    object (AssociatedAccountIdentifier)
  },
  "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_detail can be only one of the following:
  "associatedAccountDetails": {
    object (AssociatedAccountDetails)
  },
  "bankAccountDetails": {
    object (MaskedBankAccountDetails)
  }
  // End of list of possible types for union field account_detail.
}
Fields
vendorPaymentToken

string

REQUIRED: This is the token that both companies will use to identify the bank account that is associated during this method. This identifies the payer bank account in transferFunds calls.

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

tokenExpirationTime

object (Timestamp)

OPTIONAL: Timestamp when the token expires. Use 0 to signal the token does not expire.

accountDetails
(deprecated)

object (AssociatedAccountDetails)

DEPRECATED: Details about the account that was associated during the call.

accountId
(deprecated)

object (AssociatedAccountIdentifier)

DEPRECATED: The account ID the user has with the integrator.

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_detail.

account_detail 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.