# Method: accounts.link

- [HTTP request](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#body.request_body)
- [Response body](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#body.response_body)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#body.AccountsLinkResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#body.aspect)
- [AccountsLinkRequest](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#AccountsLinkRequest)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#AccountsLinkRequest.SCHEMA_REPRESENTATION)
- [PaymentServiceProviderLinkInfo](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#PaymentServiceProviderLinkInfo)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#PaymentServiceProviderLinkInfo.SCHEMA_REPRESENTATION)
- [ECommercePlatformLinkInfo](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#ECommercePlatformLinkInfo)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#ECommercePlatformLinkInfo.SCHEMA_REPRESENTATION)
- [Try it!](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#try-it)

Performs an action on a link between two Merchant Center accounts, namely [accountId](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#accountId) and [linkedAccountId](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#linkedAccountId).

### HTTP request

`POST https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/accounts/{accountId}/link`

### Path parameters

| Parameters ||
|---|---|
| `merchantId` | `string` The ID of the managing account. If this parameter is not the same as [accountId](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#accountId), then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. |
| `accountId` | `string` The ID of the account that should be linked. |

### Request body

The request body contains an instance of `https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#AccountsLinkRequest`.

### Response body

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

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

| Fields ||
|---|---|
| `kind` | `string` Identifies what kind of resource this is. Value: the fixed string "`content#accountsLinkResponse`". |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/content`

For more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).

## AccountsLinkRequest

| JSON representation |
|---|
| ``` { "action": string, "linkedAccountId": string, "linkType": string, "services": [ string ], "paymentServiceProviderLinkInfo": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#PaymentServiceProviderLinkInfo`) }, "eCommercePlatformLinkInfo": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#ECommercePlatformLinkInfo`) } } ``` |

| Fields ||
|---|---|
| `action` | `string` Action to perform for this link. The `"request"` action is only available to select merchants. Acceptable values are: - "`approve`" - "`remove`" - "`request`" <br /> |
| `linkedAccountId` | `string` The ID of the linked account. |
| `linkType` | `string` Type of the link between the two accounts. Acceptable values are: - "`channelPartner`" - "`eCommercePlatform`" - "`paymentServiceProvider`" <br /> |
| `services[]` | `string` <br /> Acceptable values are: - "`shoppingAdsProductManagement`" - "`shoppingActionsProductManagement`" - "`shoppingActionsOrderManagement`" - "`paymentProcessing`" <br /> |
| `paymentServiceProviderLinkInfo` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#PaymentServiceProviderLinkInfo`)`` Additional information required for `paymentServiceProvider` link type. |
| `eCommercePlatformLinkInfo` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/link#ECommercePlatformLinkInfo`)`` Additional information required for `eCommercePlatform` link type. |

## PaymentServiceProviderLinkInfo

Additional information required for PAYMENT_SERVICE_PROVIDER link type.

| JSON representation |
|---|
| ``` { "externalAccountId": string, "externalAccountBusinessCountry": string } ``` |

| Fields ||
|---|---|
| `externalAccountId` | `string` The id used by the third party service provider to identify the merchant. |
| `externalAccountBusinessCountry` | `string` The business country of the merchant account as identified by the third party service provider. |

## ECommercePlatformLinkInfo

Additional information required for E_COMMERCE_PLATFORM link type.

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

| Fields ||
|---|---|
| `externalAccountId` | `string` The id used by the third party service provider to identify the merchant. |