Stay organized with collectionsSave and categorize content based on your preferences.
Anadvanced Merchant Center
account(sometimes referred to as
a multi-client account) is designed for larger, more complex businesses that
manage multiple sellers or domains. This includes marketplaces, multi-country
retailers, or third-party providers who manage accounts on behalf of their
clients. A key feature of advanced accounts is the ability to create and managesub-accountsdirectly under their own account structure.
This guide explains how to use Merchant API to create and manage these
sub-accounts. Sub-accounts are distinct Merchant Center accounts that are nested
under your advanced account, allowing for centralized management while
maintaining separate settings, websites, and data feeds. You can use the
Merchant Accounts sub-API to create new sub-accounts under your advanced
account.
To create sub-accounts, you must first have anadvanced account
setup. You must be an account
administrator to convert your Merchant Center account to an advanced account,
and your account must not have any pendingissues. Note that you
cannot use Merchant API to move existing standalone Merchant Center accounts
into a sub-account relationship under your advanced account.
Create a sub-account
To create a new sub-account under your advanced account, callaccounts.createAndConfigure.
In the request body:
Provide the details of the sub-account you want to create in theaccountfield.
Optionally, specify any new authorized users in theusersfield. User access for the sub-account is also inherited from the parent
advanced account.
In theservicefield, specifyaccountAggregationand set theproviderto the resource
name of your advanced account (for example,providers/{ADVANCED_ACCOUNT_ID}). This establishes your advanced
account as the aggregator for the new sub-account.
Here's an example request to create a sub-account named "merchantStore" under
the advanced account{ADVANCED_ACCOUNT_ID}:
A successful call creates the new sub-account and links it under your specified
advanced account. The response body will contain the newly createdAccountresource.
The following samples demonstrate how you can use theaccounts.createAndConfigureto create
a new sub-account.
Java
importcom.google.api.gax.core.FixedCredentialsProvider;importcom.google.auth.oauth2.GoogleCredentials;importcom.google.shopping.merchant.accounts.v1.Account;importcom.google.shopping.merchant.accounts.v1.AccountAggregation;importcom.google.shopping.merchant.accounts.v1.AccountsServiceClient;importcom.google.shopping.merchant.accounts.v1.AccountsServiceSettings;importcom.google.shopping.merchant.accounts.v1.CreateAndConfigureAccountRequest;importcom.google.shopping.merchant.accounts.v1.CreateAndConfigureAccountRequest.AddAccountService;importcom.google.type.TimeZone;importshopping.merchant.samples.utils.Authenticator;importshopping.merchant.samples.utils.Config;/** This class demonstrates how to create a sub-account under an advanced account. */publicclassCreateSubAccountSample{privatestaticStringgetParent(StringaccountId){returnString.format("accounts/%s",accountId);}publicstaticvoidcreateSubAccount(Configconfig)throwsException{// Obtains OAuth token based on the user's configuration.GoogleCredentialscredential=newAuthenticator().authenticate();// Creates service settings using the credentials retrieved above.AccountsServiceSettingsaccountsServiceSettings=AccountsServiceSettings.newBuilder().setCredentialsProvider(FixedCredentialsProvider.create(credential)).build();// Creates parent/provider to identify the advanced account into which to insert the subaccount.Stringparent=getParent(config.getAccountId().toString());// Calls the API and catches and prints any network failures/errors.try(AccountsServiceClientaccountsServiceClient=AccountsServiceClient.create(accountsServiceSettings)){CreateAndConfigureAccountRequestrequest=CreateAndConfigureAccountRequest.newBuilder().setAccount(Account.newBuilder().setAccountName("Demo Business").setAdultContent(false).setTimeZone(TimeZone.newBuilder().setId("America/New_York").build()).setLanguageCode("en-US").build()).addService(AddAccountService.newBuilder().setProvider(parent).setAccountAggregation(AccountAggregation.getDefaultInstance()).build()).build();System.out.println("Sending Create SubAccount request");Accountresponse=accountsServiceClient.createAndConfigureAccount(request);System.out.println("Inserted Account Name below");// Format: `accounts/{account}System.out.println(response.getName());}catch(Exceptione){System.out.println(e);}}publicstaticvoidmain(String[]args)throwsException{Configconfig=Config.load();createSubAccount(config);}}
use Google\ApiCore\ApiException;use Google\Shopping\Merchant\Accounts\V1\Account;use Google\Shopping\Merchant\Accounts\V1\AccountAggregation;use Google\Shopping\Merchant\Accounts\V1\Client\AccountsServiceClient;use Google\Shopping\Merchant\Accounts\V1\CreateAndConfigureAccountRequest;use Google\Shopping\Merchant\Accounts\V1\CreateAndConfigureAccountRequest\AddAccountService;use Google\Type\TimeZone;/*** This class demonstrates how to create a sub-account under an MCA account.*/class CreateSubAccount{private static function getParent(string $accountId): string{return sprintf("accounts/%s", $accountId);}public static function createSubAccount(array $config): void{// Gets the OAuth credentials to make the request.$credentials = Authentication::useServiceAccountOrTokenFile();// Creates options config containing credentials for the client to use.$options = ['credentials' => $credentials];// Creates a client.$accountsServiceClient = new AccountsServiceClient($options);// Creates parent/provider to identify the MCA account into which to insert the subaccount.$parent = self::getParent($config['accountId']);// Calls the API and catches and prints any network failures/errors.try {$request = new CreateAndConfigureAccountRequest(['account' => (new Account(['account_name' => 'Demo Business','adult_content' => false,'time_zone' => (new TimeZone(['id' => 'America/New_York'])),'language_code' => 'en-US',])),'service' => [(new AddAccountService(['provider' => $parent,'account_aggregation' => new AccountAggregation,])),],]);print "Sending Create SubAccount request\n";$response = $accountsServiceClient->createAndConfigureAccount($request);print "Inserted Account Name below\n";// Format: `accounts/{account}print $response->getName() . PHP_EOL;} catch (ApiException $e) {print $e->getMessage();}}public function callSample(): void{$config = Config::generateConfig();self::createSubAccount($config);}}$sample = new CreateSubAccount();$sample->callSample();
fromexamples.authenticationimportconfigurationfromexamples.authenticationimportgenerate_user_credentialsfromgoogle.shopping.merchant_accounts_v1importAccountfromgoogle.shopping.merchant_accounts_v1importAccountAggregationfromgoogle.shopping.merchant_accounts_v1importAccountsServiceClientfromgoogle.shopping.merchant_accounts_v1importCreateAndConfigureAccountRequest_ACCOUNT=configuration.Configuration().read_merchant_info()defget_parent(account_id):returnf"accounts/{account_id}"defcreate_sub_account():"""Creates a sub-account under an advanced account."""# Get OAuth credentials.credentials=generate_user_credentials.main()# Create a client.client=AccountsServiceClient(credentials=credentials)# Get the parent advanced account ID.parent=get_parent(_ACCOUNT)# Create the request.request=CreateAndConfigureAccountRequest(account=Account(account_name="Demo Business",adult_content=False,time_zone={"id":"America/New_York"},language_code="en-US",),service=[CreateAndConfigureAccountRequest.AddAccountService(provider=parent,account_aggregation=AccountAggregation(),)],)# Make the request and print the response.try:print("Sending Create SubAccount request")response=client.create_and_configure_account(request=request)print("Inserted Account Name below")print(response.name)exceptRuntimeErrorase:print(e)if__name__=="__main__":create_sub_account()
To list all sub-accounts for a given advanced account, use theaccounts.listSubaccountsmethod. Provide the ID of your advanced account in theproviderfield of the
request URL.
Here's a sample request:
GET https://merchantapi.googleapis.com/accounts/v1/accounts/{ADVANCED_ACCOUNT_ID}:listSubaccounts
The following samples demonstrate how to list all sub-accounts for your advanced
account.
Java
importcom.google.api.gax.core.FixedCredentialsProvider;importcom.google.auth.oauth2.GoogleCredentials;importcom.google.shopping.merchant.accounts.v1.Account;importcom.google.shopping.merchant.accounts.v1.AccountsServiceClient;importcom.google.shopping.merchant.accounts.v1.AccountsServiceClient.ListSubAccountsPagedResponse;importcom.google.shopping.merchant.accounts.v1.AccountsServiceSettings;importcom.google.shopping.merchant.accounts.v1.ListSubAccountsRequest;importshopping.merchant.samples.utils.Authenticator;importshopping.merchant.samples.utils.Config;/** This class demonstrates how to list all the subaccounts of an advanced account. */publicclassListSubAccountsSample{privatestaticStringgetParent(StringaccountId){returnString.format("accounts/%s",accountId);}publicstaticvoidlistSubAccounts(Configconfig)throwsException{// Obtains OAuth token based on the user's configuration.GoogleCredentialscredential=newAuthenticator().authenticate();// Creates service settings using the credentials retrieved above.AccountsServiceSettingsaccountsServiceSettings=AccountsServiceSettings.newBuilder().setCredentialsProvider(FixedCredentialsProvider.create(credential)).build();// Creates parent/provider to identify the advanced account from which to list all sub-accounts.Stringparent=getParent(config.getAccountId().toString());// Calls the API and catches and prints any network failures/errors.try(AccountsServiceClientaccountsServiceClient=AccountsServiceClient.create(accountsServiceSettings)){// The parent has the format: accounts/{account}ListSubAccountsRequestrequest=ListSubAccountsRequest.newBuilder().setProvider(parent).build();System.out.println("Sending list subaccounts request:");ListSubAccountsPagedResponseresponse=accountsServiceClient.listSubAccounts(request);intcount=0;// Iterates over all rows in all pages and prints the datasource in each row.// Automatically uses the `nextPageToken` if returned to fetch all pages of data.for(Accountaccount:response.iterateAll()){System.out.println(account);count++;}System.out.print("The following count of accounts were returned: ");System.out.println(count);}catch(Exceptione){System.out.println("An error has occured: ");System.out.println(e);}}publicstaticvoidmain(String[]args)throwsException{Configconfig=Config.load();listSubAccounts(config);}}
use Google\ApiCore\ApiException;use Google\Shopping\Merchant\Accounts\V1\Client\AccountsServiceClient;use Google\Shopping\Merchant\Accounts\V1\ListSubAccountsRequest;/*** This class demonstrates how to list all the subaccounts of an advanced account.*/class ListSubAccounts{private static function getParent(string $accountId): string{return sprintf("accounts/%s", $accountId);}public static function listSubAccounts(array $config): void{// Gets the OAuth credentials to make the request.$credentials = Authentication::useServiceAccountOrTokenFile();// Creates options config containing credentials for the client to use.$options = ['credentials' => $credentials];// Creates a client.$accountsServiceClient = new AccountsServiceClient($options);// Creates parent/provider to identify the advanced account from which//to list all accounts.$parent = self::getParent($config['accountId']);// Calls the API and catches and prints any network failures/errors.try {// The parent has the format: accounts/{account}$request = new ListSubAccountsRequest(['provider' => $parent]);print "Sending list subaccounts request:\n";$response = $accountsServiceClient->listSubAccounts($request);$count = 0;// Iterates over all rows in all pages and prints the datasource in each row.// Automatically uses the `nextPageToken` if returned to fetch all pages of data.foreach ($response->iterateAllElements() as $account) {print_r($account);$count++;}print "The following count of accounts were returned: ";print $count . PHP_EOL;} catch (ApiException $e) {print "An error has occured: \n";print $e->getMessage();}}public function callSample(): void{$config = Config::generateConfig();self::listSubAccounts($config);}}$sample = new ListSubAccounts();$sample->callSample();
fromexamples.authenticationimportconfigurationfromexamples.authenticationimportgenerate_user_credentialsfromgoogle.shopping.merchant_accounts_v1importAccountsServiceClientfromgoogle.shopping.merchant_accounts_v1importListSubAccountsRequest_ACCOUNT=configuration.Configuration().read_merchant_info()defget_parent(account_id):returnf"accounts/{account_id}"deflist_sub_accounts():"""Lists all the subaccounts of an advanced account."""# Get OAuth credentials.credentials=generate_user_credentials.main()# Create a client.client=AccountsServiceClient(credentials=credentials)# Get the parent advanced account ID.parent=get_parent(_ACCOUNT)# Create the request.request=ListSubAccountsRequest(provider=parent)# Make the request and print the response.try:print("Sending list subaccounts request:")response=client.list_sub_accounts(request=request)count=0foraccountinresponse:print(account)count+=1print(f"The following count of accounts were returned:{count}")exceptRuntimeErrorase:print("An error has occured: ")print(e)if__name__=="__main__":list_sub_accounts()
If successful, the response body is an empty JSON object, indicating the
sub-account has been deleted.
The following samples demonstrate how to delete a sub-account.
Java
importcom.google.api.gax.core.FixedCredentialsProvider;importcom.google.auth.oauth2.GoogleCredentials;importcom.google.shopping.merchant.accounts.v1.AccountName;importcom.google.shopping.merchant.accounts.v1.AccountsServiceClient;importcom.google.shopping.merchant.accounts.v1.AccountsServiceSettings;importcom.google.shopping.merchant.accounts.v1.DeleteAccountRequest;importshopping.merchant.samples.utils.Authenticator;importshopping.merchant.samples.utils.Config;/** This class demonstrates how to delete a given Merchant Center account. */publicclassDeleteAccountSample{// This method can delete a standalone, advanced account or sub-account. If you delete an advanced// account,// all sub-accounts will also be deleted.// Admin user access is required to execute this method.publicstaticvoiddeleteAccount(Configconfig)throwsException{// Obtains OAuth token based on the user's configuration.GoogleCredentialscredential=newAuthenticator().authenticate();// Creates service settings using the credentials retrieved above.AccountsServiceSettingsaccountsServiceSettings=AccountsServiceSettings.newBuilder().setCredentialsProvider(FixedCredentialsProvider.create(credential)).build();// Gets the account ID from the config file.StringaccountId=config.getAccountId().toString();// Creates account name to identify the account.Stringname=AccountName.newBuilder().setAccount(accountId).build().toString();// Calls the API and catches and prints any network failures/errors.try(AccountsServiceClientaccountsServiceClient=AccountsServiceClient.create(accountsServiceSettings)){DeleteAccountRequestrequest=DeleteAccountRequest.newBuilder().setName(name)// Optional. If set to true, the account will be deleted even if it has offers or// provides services to other accounts. Defaults to 'false'..setForce(true).build();System.out.println("Sending Delete Account request");accountsServiceClient.deleteAccount(request);// No response returned on success.System.out.println("Delete successful.");}catch(Exceptione){System.out.println(e);}}publicstaticvoidmain(String[]args)throwsException{Configconfig=Config.load();deleteAccount(config);}}
use Google\ApiCore\ApiException;use Google\Shopping\Merchant\Accounts\V1\Client\AccountsServiceClient;use Google\Shopping\Merchant\Accounts\V1\DeleteAccountRequest;/*** This class demonstrates how to delete a given Merchant Center account.*/class DeleteAccount{private static function getParent(string $accountId): string{return sprintf("accounts/%s", $accountId);}// This method can delete a standalone, advanced account or sub-account.// If you delete an advanced account, all sub-accounts will also be deleted.// Admin user access is required to execute this method.public static function deleteAccount(array $config): void{// Gets the OAuth credentials to make the request.$credentials = Authentication::useServiceAccountOrTokenFile();// Creates options config containing credentials for the client to use.$options = ['credentials' => $credentials];// Creates a client.$accountsServiceClient = new AccountsServiceClient($options);// Gets the account ID from the config file.$accountId = $config['accountId'];// Creates account name to identify the account.$name = self::getParent($accountId);// Calls the API and catches and prints any network failures/errors.try {$request = new DeleteAccountRequest(['name' => $name,// Optional. If set to true, the account will be deleted even if it has offers or// provides services to other accounts. Defaults to 'false'.'force' => true,]);print "Sending Delete Account request\n";$accountsServiceClient->deleteAccount($request); // No response returned on success.print "Delete successful.\n";} catch (ApiException $e) {print $e->getMessage();}}public function callSample(): void{$config = Config::generateConfig();self::deleteAccount($config);}}$sample = new DeleteAccount();$sample->callSample();
fromexamples.authenticationimportconfigurationfromexamples.authenticationimportgenerate_user_credentialsfromgoogle.shopping.merchant_accounts_v1importAccountsServiceClientfromgoogle.shopping.merchant_accounts_v1importDeleteAccountRequest_ACCOUNT=configuration.Configuration().read_merchant_info()defget_parent(account_id):returnf"accounts/{account_id}"defdelete_account():"""Deletes a given Merchant Center account."""# Get OAuth credentials.credentials=generate_user_credentials.main()# Create a client.client=AccountsServiceClient(credentials=credentials)# Create the account name.name=get_parent(_ACCOUNT)# Create the request.request=DeleteAccountRequest(name=name,force=True)# Make the request and print the response.try:print("Sending Delete Account request")client.delete_account(request=request)print("Delete successful.")exceptRuntimeErrorase:print(e)if__name__=="__main__":delete_account()
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe Merchant Accounts API enables creation and management of sub-accounts under an existing advanced Google Merchant Center account.\u003c/p\u003e\n"],["\u003cp\u003eThird-party providers can leverage this API to build interfaces for merchants to handle account details.\u003c/p\u003e\n"],["\u003cp\u003eSub-accounts automatically inherit the parent account's Merchant Center Terms of Service and user access permissions.\u003c/p\u003e\n"],["\u003cp\u003eBusiness information for both parent and sub-accounts can be viewed and updated through dedicated API calls.\u003c/p\u003e\n"]]],[],null,[]]