Reference documentation and code samples for the Google Shopping Merchant Accounts V1 Client class AccountRelationship.
TheAccountRelationshipmessage defines a formal connection between a
merchant's account and a service provider's account. This relationship
enables the provider to offer specific services to the business, such as
product management or campaign management. It specifies the access rights
and permissions to the business's data relevant to those services.
Establishing an account relationship involves linking the merchant's account
with a provider's account. The provider could be another Google account (like
Google Ads or Google My Business) or a third-party platform (such as Shopify
or WooCommerce).
Generated from protobuf messagegoogle.shopping.merchant.accounts.v1.AccountRelationship
Namespace
Google \ Shopping \ Merchant \ Accounts \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Identifier. The resource name of the account relationship. Format:accounts/{account}/relationships/{relationship}. For example,accounts/123456/relationships/567890.
↳ provider
string
Immutable. The provider of the service. Either the reference to an account such asproviders/123or a well-known service provider (one ofproviders/GOOGLE_ADSorproviders/GOOGLE_BUSINESS_PROFILE).
↳ provider_display_name
string
Output only. The human-readable display name of the provider account.
↳ account_id_alias
string
Optional. An optional alias you can assign to this account relationship. This alias acts as a convenient identifier for your own reference and management. It must be unique among all your account relationships with the same provider. For example, you might useaccount_id_aliasto assign a friendly name to this relationship for easier identification in your systems.
getName
Identifier. The resource name of the account relationship.
Format:accounts/{account}/relationships/{relationship}. For example,accounts/123456/relationships/567890.
Returns
Type
Description
string
setName
Identifier. The resource name of the account relationship.
Format:accounts/{account}/relationships/{relationship}. For example,accounts/123456/relationships/567890.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getProvider
Immutable. The provider of the service. Either the reference to an account
such asproviders/123or a well-known service provider (one ofproviders/GOOGLE_ADSorproviders/GOOGLE_BUSINESS_PROFILE).
Returns
Type
Description
string
hasProvider
clearProvider
setProvider
Immutable. The provider of the service. Either the reference to an account
such asproviders/123or a well-known service provider (one ofproviders/GOOGLE_ADSorproviders/GOOGLE_BUSINESS_PROFILE).
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getProviderDisplayName
Output only. The human-readable display name of the provider account.
Returns
Type
Description
string
setProviderDisplayName
Output only. The human-readable display name of the provider account.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getAccountIdAlias
Optional. An optional alias you can assign to this account relationship.
This alias acts as a convenient identifier for your own reference and
management. It must be unique among all your account relationships with the
same provider.
For example, you might useaccount_id_aliasto assign a friendly name
to this relationship for easier identification in your systems.
Returns
Type
Description
string
setAccountIdAlias
Optional. An optional alias you can assign to this account relationship.
This alias acts as a convenient identifier for your own reference and
management. It must be unique among all your account relationships with the
same provider.
For example, you might useaccount_id_aliasto assign a friendly name
to this relationship for easier identification in your systems.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Shopping Merchant Accounts V1 Client - Class AccountRelationship (1.0.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0 (latest)](/php/docs/reference/shopping-merchant-accounts/latest/V1.AccountRelationship)\n- [0.10.0](/php/docs/reference/shopping-merchant-accounts/0.10.0/V1.AccountRelationship)\n- [0.9.1](/php/docs/reference/shopping-merchant-accounts/0.9.1/V1.AccountRelationship)\n- [0.8.0](/php/docs/reference/shopping-merchant-accounts/0.8.0/V1.AccountRelationship)\n- [0.7.0](/php/docs/reference/shopping-merchant-accounts/0.7.0/V1.AccountRelationship)\n- [0.6.0](/php/docs/reference/shopping-merchant-accounts/0.6.0/V1.AccountRelationship)\n- [0.5.0](/php/docs/reference/shopping-merchant-accounts/0.5.0/V1.AccountRelationship)\n- [0.4.0](/php/docs/reference/shopping-merchant-accounts/0.4.0/V1.AccountRelationship)\n- [0.3.3](/php/docs/reference/shopping-merchant-accounts/0.3.3/V1.AccountRelationship)\n- [0.2.0](/php/docs/reference/shopping-merchant-accounts/0.2.0/V1.AccountRelationship)\n- [0.1.0](/php/docs/reference/shopping-merchant-accounts/0.1.0/V1.AccountRelationship) \nReference documentation and code samples for the Google Shopping Merchant Accounts V1 Client class AccountRelationship.\n\nThe `AccountRelationship` message defines a formal connection between a\nmerchant's account and a service provider's account. This relationship\nenables the provider to offer specific services to the business, such as\nproduct management or campaign management. It specifies the access rights\nand permissions to the business's data relevant to those services.\n\nEstablishing an account relationship involves linking the merchant's account\nwith a provider's account. The provider could be another Google account (like\nGoogle Ads or Google My Business) or a third-party platform (such as Shopify\nor WooCommerce).\n\nGenerated from protobuf message `google.shopping.merchant.accounts.v1.AccountRelationship`\n\nNamespace\n---------\n\nGoogle \\\\ Shopping \\\\ Merchant \\\\ Accounts \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nIdentifier. The resource name of the account relationship.\n\nFormat: `accounts/{account}/relationships/{relationship}`. For example,\n`accounts/123456/relationships/567890`.\n\n### setName\n\nIdentifier. The resource name of the account relationship.\n\nFormat: `accounts/{account}/relationships/{relationship}`. For example,\n`accounts/123456/relationships/567890`.\n\n### getProvider\n\nImmutable. The provider of the service. Either the reference to an account\nsuch as `providers/123` or a well-known service provider (one of\n`providers/GOOGLE_ADS` or `providers/GOOGLE_BUSINESS_PROFILE`).\n\n### hasProvider\n\n### clearProvider\n\n### setProvider\n\nImmutable. The provider of the service. Either the reference to an account\nsuch as `providers/123` or a well-known service provider (one of\n`providers/GOOGLE_ADS` or `providers/GOOGLE_BUSINESS_PROFILE`).\n\n### getProviderDisplayName\n\nOutput only. The human-readable display name of the provider account.\n\n### setProviderDisplayName\n\nOutput only. The human-readable display name of the provider account.\n\n### getAccountIdAlias\n\nOptional. An optional alias you can assign to this account relationship.\n\nThis alias acts as a convenient identifier for your own reference and\nmanagement. It must be unique among all your account relationships with the\nsame provider.\nFor example, you might use `account_id_alias` to assign a friendly name\nto this relationship for easier identification in your systems.\n\n### setAccountIdAlias\n\nOptional. An optional alias you can assign to this account relationship.\n\nThis alias acts as a convenient identifier for your own reference and\nmanagement. It must be unique among all your account relationships with the\nsame provider.\nFor example, you might use `account_id_alias` to assign a friendly name\nto this relationship for easier identification in your systems."]]