- [HTTP request](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#body.request_body)
  - [JSON representation](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#body.response_body)
- [AccountInfo](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#AccountInfo)
  - [JSON representation](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#AccountInfo.SCHEMA_REPRESENTATION)
- [AccountStatus](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#AccountStatus)
- [AccountIds](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#AccountIds)
  - [JSON representation](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#AccountIds.SCHEMA_REPRESENTATION)
- [AccountClosureInfo](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#AccountClosureInfo)
  - [JSON representation](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#AccountClosureInfo.SCHEMA_REPRESENTATION)
- [UpdateAssociatedAccountResponse](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#UpdateAssociatedAccountResponse)
  - [JSON representation](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#UpdateAssociatedAccountResponse.SCHEMA_REPRESENTATION)
- [UpdateAssociatedAccountResult](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#UpdateAssociatedAccountResult)
  - [JSON representation](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#UpdateAssociatedAccountResult.SCHEMA_REPRESENTATION)
- [MissingAccountAliasType](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#MissingAccountAliasType)
  - [JSON representation](https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#MissingAccountAliasType.SCHEMA_REPRESENTATION)

Requests an update to an associated user account.

This method requires that a complete snapshot of the associated account information be provided, along with an update sequence timestamp. The update sequence timestamp is used to determine the most recent update. Updates with an update sequence timestamp older than the current Google record are dropped.

The update sequence timestamp should reflect the time the state of the account was read in milliseconds. The update sequence timestamp must be within +/- 1 min of the Google server time when the request is received, or the request will be rejected with response code 401.

Failed requests may be retried until a 401 response code is received. If a 401 response code is received, the client should refresh the updateSequenceTimestamp prior to retrying the request.

If the endpoint encounters an error while processing the request, the endpoint will return HTTP 4xx or 5xx and the HTTP body will either be of type [`ErrorResponse`](https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/ErrorResponse) or contain a generic error (e.g. a message similar to "There was an error. Please try again later.").

The generic error is used in situations where an [`ErrorResponse`](https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/ErrorResponse) with a clear description could be used to help an attacker understand the payment integrator account identifier of other integrators. In these situations, where either the signing key doesn't match, the payment integrator identifier was not found, or the encryption key was unknown, this method will return a generic error. If the request signature could be verified, additional information regarding the error will be returned in an [`ErrorResponse`](https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/ErrorResponse).

An example request looks like:


    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1
        },
        "requestId": "8a986fe8-5a2c-45a4-a1bb-3bed6e651020",
        "requestTimestamp": {
          "epochMillis": "1482452962000"
        },
        "paymentIntegratorAccountId": "InvisiCashUSA_USD"
      },
      "googlePaymentToken": {
        "issuerId": {
          "value": "InvisiCashUSA"
        },
        "token": "xcoNWE23812Sflks9an01%s"
      },
      "updateSequenceTimestamp": {
        "epochMillis": "1482452962000"
      },
      "accountInfo": {
        "accountStatus": "ACCOUNT_AVAILABLE",
        "transactionLimits": {
          "transactionMaxLimit": {
            "limitAmount": {
              "amountMicros": "100000000",
              "currencyCode": "JPY"
            }
          }
        },
        "accountIds": {
          "partialAccountNickname": "(XXX) XXX-5555",
          "accountAlias": {
            "phoneNumber": {
              "value": "+15555555555"
            }
          }
        }
      }
    }

An example response looks like:


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

### HTTP request

`POST https://vgw.googleapis.com/gsp/carriers-v1/updateAssociatedAccount/https://developers.google.com/pay/carriers-v1/reference/glossary#payment_integrator_account_id`

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "requestHeader": { object (https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/RequestHeader) }, "googlePaymentToken": { object (https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/GooglePaymentToken) }, "updateSequenceTimestamp": { object (https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/Timestamp) }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "accountInfo": { object (`https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#AccountInfo`) }, "accountClosureInfo": { object (`https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#AccountClosureInfo`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `requestHeader` | `object (https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/RequestHeader)` **REQUIRED**: Common header for all requests. |
| `googlePaymentToken` | `object (https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/GooglePaymentToken)` **REQUIRED**: This is the token that both companies will use to identify the account to be updated. |
| `updateSequenceTimestamp` | `object (https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/Timestamp)` **REQUIRED**: A timestamp describing when this update request was sent. This timestamp is compared to the updateSequenceTimestamp of the current Google record. Updates with an updateSequenceTimestamp older than the current Google record are dropped. |
| **REQUIRED**: The type of account update to apply. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `accountInfo` | ``object (`https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#AccountInfo`)`` A complete snapshot of the account information. |
| `accountClosureInfo` | ``object (`https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#AccountClosureInfo`)`` Information about the closure of a user account held with the integrator. Returning this value will cause the user's account to be closed with Google. Closed accounts may not be re-opened via UpdateAssociatedAccount. The user will be forced to add a new account by going through the association flow again. |
| 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/carriers-v1/guides/connectivity/protocol-standards#http_status_codes).

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

## AccountInfo

Details about a change to a user's account information.

| JSON representation |
|---|
| ``` { "accountStatus": enum (`https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#AccountStatus`), "transactionLimits": { object (https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/associateAccount#TransactionLimits) }, "accountIds": { object (`https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#AccountIds`) } } ``` |

| Fields ||
|---|---|
| `accountStatus` | ``enum (`https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#AccountStatus`)`` **REQUIRED**: The status of the user's account with the integrator. |
| `transactionLimits` | `object (https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/associateAccount#TransactionLimits)` **REQUIRED**: Defines user scoped transaction limits. |
| `accountIds` | ``object (`https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#AccountIds`)`` **REQUIRED**: Defines a nickname for the user account. |

## AccountStatus

The status of the user's account with the integrator.

| Enums ||
|---|---|
| `ACCOUNT_STATUS_UNSPECIFIED` | Do not ever set this default value! |
| `ACCOUNT_AVAILABLE` | The user's account held with the integrator is available for transactions. |
| `ACCOUNT_ON_HOLD` | The account is on hold. |

## AccountIds

Identifiers of the user's account.

| JSON representation |
|---|
| ``` { "accountAlias": { object (https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/associateAccount#AccountAlias) }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "partialAccountNickname": string, "fullAccountNickname": string // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `accountAlias` | `object (https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/associateAccount#AccountAlias)` **OPTIONAL**: An additional account alias the user associates with their vendor account. These are used for Google risk to understand account re-use and account relationships and Google customer operation agents to help customers diagnose issues. These aliases should be user recognizable (for example the user knows this alias because it appears on their statement or appears on the website after they log into the account). |
| **REQUIRED**: The name by which the user knows this account. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `partialAccountNickname` | `string` String by which the user knows this account for display purposes. This is a suffix of the account nickname. For example last four digits of a phone number. Google will indicate in the user interface that this is only a suffix of the nickname. <br /> > [!CAUTION] > **Caution:** This value can be PII, but must never be SPII. <br /> This value will be displayed in UIs like the purchase flow to allow the user to distinguish between payment methods. <br /> > [!NOTE] > **Note:** that either this value or the `fullAccountNickname` must be present, never both. <br /> |
| `fullAccountNickname` | `string` String by which the user knows this account for display purposes. Unlike `partialAccountNickname` this is the full account nickname. For example `56565-56501` for a phone number or [sally@sample-email.com](mailto:sally@sample-email.com) for an email identity. <br /> > [!CAUTION] > **Caution:** This value can be PII, but must never be SPII. <br /> This value will be displayed in UIs like the purchase flow to allow the user to distinguish between payment methods. <br /> > [!NOTE] > **Note:** that either this value or the `accountNickname` must be present, never both. <br /> |
| End of mutually exclusive fields. ||

## AccountClosureInfo

Details about the closure of a user's account.

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "accountTakenOver": { object (https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/Empty) }, "fraud": { object (https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/Empty) }, "closedByUser": { object (https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/Empty) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| **REQUIRED**: The reason the user's account was closed. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `accountTakenOver` | `object (https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/Empty)` The user's account held with the integrator has been closed. The integrator suspects the user's account has been taken over. |
| `fraud` | `object (https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/Empty)` The user's account held with the integrator has been closed because of fraud. |
| `closedByUser` | `object (https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/Empty)` The account was closed at the request of the user. |
| End of mutually exclusive fields. ||

## UpdateAssociatedAccountResponse

Response object for the updateAssociatedAccount method.

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

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

## UpdateAssociatedAccountResult

Result codes for the account update.

| 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/carriers-v1/payment-integrator-carriers-api/Empty) }, "missingAccountAliasType": { object (`https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#MissingAccountAliasType`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| **REQUIRED**: The result of the account update. 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/carriers-v1/payment-integrator-carriers-api/Empty)` The 'UpdateAssociatedAccountRequest' was received successfully by Google. The account will be updated. |
| `missingAccountAliasType` | ``object (`https://developers.google.com/pay/carriers-v1/google-carriers-api/updateAssociatedAccount#MissingAccountAliasType`)`` A required AccountAlias type is missing |
| End of mutually exclusive fields. ||

## MissingAccountAliasType

Details about a missing AccountAlias type.

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

| Fields ||
|---|---|
| `missingAccountAliasType` | `string` **REQUIRED**: If a required AccountAlias type was not provided, the field name corresponding to that type will be given here. |