rocket
Meet
Merchant API
- the official successor to Content API for Shopping.
update
Get the latest
on new Merchant API features, bug fixes, and updates.
add_alert
Note: Content API for Shopping will be sunset on August 18, 2026.
Method: accounts.link
Stay organized with collections
Save and categorize content based on your preferences.
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, 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 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.
AccountsLinkRequest
Fields |
action |
string
Action to perform for this link. The "request" action is only available to select merchants. Acceptable values are: - "
approve " - "
remove " - "
request "
|
linkedAccountId |
string
The ID of the linked account.
|
linkType |
string
Type of the link between the two accounts. Acceptable values are: - "
channelPartner " - "
eCommercePlatform " - "
paymentServiceProvider "
|
services[] |
string
Acceptable values are: - "
shoppingAdsProductManagement " - "
shoppingActionsProductManagement " - "
shoppingActionsOrderManagement " - "
paymentProcessing "
|
paymentServiceProviderLinkInfo |
object (PaymentServiceProviderLinkInfo )
Additional information required for paymentServiceProvider link type.
|
eCommercePlatformLinkInfo |
object (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.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-02-25 UTC.
[null,null,["Last updated 2025-02-25 UTC."],[[["\u003cp\u003eLinks two Merchant Center accounts, allowing for actions like approving, removing, or requesting a link.\u003c/p\u003e\n"],["\u003cp\u003eRequires the managing account ID and the ID of the account to be linked.\u003c/p\u003e\n"],["\u003cp\u003eSupports different link types such as \u003ccode\u003echannelPartner\u003c/code\u003e, \u003ccode\u003eeCommercePlatform\u003c/code\u003e, and \u003ccode\u003epaymentServiceProvider\u003c/code\u003e, each with specific requirements.\u003c/p\u003e\n"],["\u003cp\u003eUses HTTP POST request to \u003ccode\u003ehttps://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/accounts/{accountId}/link\u003c/code\u003e to manage links.\u003c/p\u003e\n"],["\u003cp\u003eNeeds authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/content\u003c/code\u003e scope.\u003c/p\u003e\n"]]],["This document outlines the process of linking two Merchant Center accounts using a POST request to `https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/accounts/{accountId}/link`. The request body, an `AccountsLinkRequest`, specifies the `action` (approve, remove, or request), `linkedAccountId`, and `linkType` (channelPartner, eCommercePlatform, paymentServiceProvider). Depending on the `linkType`, `PaymentServiceProviderLinkInfo` or `ECommercePlatformLinkInfo` may be required. The response includes a JSON object confirming the action.\n"],null,["# Method: accounts.link\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.AccountsLinkResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [AccountsLinkRequest](#AccountsLinkRequest)\n - [JSON representation](#AccountsLinkRequest.SCHEMA_REPRESENTATION)\n- [PaymentServiceProviderLinkInfo](#PaymentServiceProviderLinkInfo)\n - [JSON representation](#PaymentServiceProviderLinkInfo.SCHEMA_REPRESENTATION)\n- [ECommercePlatformLinkInfo](#ECommercePlatformLinkInfo)\n - [JSON representation](#ECommercePlatformLinkInfo.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nPerforms an action on a link between two Merchant Center accounts, namely [accountId](#accountId) and [linkedAccountId](#linkedAccountId).\n\n### HTTP request\n\n`POST https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/accounts/{accountId}/link`\n\n### Path parameters\n\n| Parameters ||\n|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `merchantId` | `string` The ID of the managing account. If this parameter is not the same as [accountId](#accountId), then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. |\n| `accountId` | `string` The ID of the account that should be linked. |\n\n### Request body\n\nThe request body contains an instance of [AccountsLinkRequest](/shopping-content/reference/rest/v2.1/accounts/link#AccountsLinkRequest).\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|----------------------------|\n| ``` { \"kind\": string } ``` |\n\n| Fields ||\n|--------|--------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Identifies what kind of resource this is. Value: the fixed string \"`content#accountsLinkResponse`\". |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/content`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2).\n\nAccountsLinkRequest\n-------------------\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"action\": string, \"linkedAccountId\": string, \"linkType\": string, \"services\": [ string ], \"paymentServiceProviderLinkInfo\": { object (/shopping-content/reference/rest/v2.1/accounts/link#PaymentServiceProviderLinkInfo) }, \"eCommercePlatformLinkInfo\": { object (/shopping-content/reference/rest/v2.1/accounts/link#ECommercePlatformLinkInfo) } } ``` |\n\n| Fields ||\n|----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `action` | `string` Action to perform for this link. The `\"request\"` action is only available to select merchants. Acceptable values are: - \"`approve`\" - \"`remove`\" - \"`request`\" \u003cbr /\u003e |\n| `linkedAccountId` | `string` The ID of the linked account. |\n| `linkType` | `string` Type of the link between the two accounts. Acceptable values are: - \"`channelPartner`\" - \"`eCommercePlatform`\" - \"`paymentServiceProvider`\" \u003cbr /\u003e |\n| `services[]` | `string` \u003cbr /\u003e Acceptable values are: - \"`shoppingAdsProductManagement`\" - \"`shoppingActionsProductManagement`\" - \"`shoppingActionsOrderManagement`\" - \"`paymentProcessing`\" \u003cbr /\u003e |\n| `paymentServiceProviderLinkInfo` | `object (`[PaymentServiceProviderLinkInfo](/shopping-content/reference/rest/v2.1/accounts/link#PaymentServiceProviderLinkInfo)`)` Additional information required for `paymentServiceProvider` link type. |\n| `eCommercePlatformLinkInfo` | `object (`[ECommercePlatformLinkInfo](/shopping-content/reference/rest/v2.1/accounts/link#ECommercePlatformLinkInfo)`)` Additional information required for `eCommercePlatform` link type. |\n\nPaymentServiceProviderLinkInfo\n------------------------------\n\nAdditional information required for PAYMENT_SERVICE_PROVIDER link type.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------|\n| ``` { \"externalAccountId\": string, \"externalAccountBusinessCountry\": string } ``` |\n\n| Fields ||\n|----------------------------------|----------------------------------------------------------------------------------------------------------|\n| `externalAccountId` | `string` The id used by the third party service provider to identify the merchant. |\n| `externalAccountBusinessCountry` | `string` The business country of the merchant account as identified by the third party service provider. |\n\nECommercePlatformLinkInfo\n-------------------------\n\nAdditional information required for E_COMMERCE_PLATFORM link type.\n\n| JSON representation |\n|-----------------------------------------|\n| ``` { \"externalAccountId\": string } ``` |\n\n| Fields ||\n|---------------------|------------------------------------------------------------------------------------|\n| `externalAccountId` | `string` The id used by the third party service provider to identify the merchant. |"]]