Hi Jianan,
Thanks for reaching out. You could use the ManagedCustomerService.get() to retrieve the MCC account's client Id. This is a code example for you on how to use this service. Please let us know if you have any further concerns.
Thanks and regards,
Xiaoming, Google Ads API Team
Hi Jianan,
You could use the ManagedCustomerService.get() to retrieve the customer account ids if the customer accounts are already linked to the MCC account. If not, then you have to look up the customer account id through the Google Ads UI. If you would like to link any customer account to your MCC account via API you would need to use ManagedCustomerService.mutate() and inviteeEmail and inviteeRole in MangedCustomerOperation. Keep in mind that inviteeEmail and inviteeRole are accessible to whitelisted customers only. Please let us know if you have any further questions.
Thanks and regards,
Xiaoming, Google Ads API Team
$managedCustomerService = (new AdWordsServices())->get($session, ManagedCustomerService::class);
// Create a managed customer.$customer = new ManagedCustomer();$customer->setName('Account #' . uniqid());$customer->setCurrencyCode('EUR');$customer->setDateTimeZone('Europe/London');
// Create a managed customer operation and add it to the list.$operations = [];$operation = new ManagedCustomerOperation();$operation->setOperator(Operator::ADD);$operation->setOperand($customer);$operation->setInviteeEmail('wangjia...@gmail.com');$operation->setInviteeRole(AccessRole::STANDARD);
$operations[] = $operation;// Create a managed customer on the server and print out some info// about it.$customer = $managedCustomerService->mutate($operations)->getValue()[0];printf( "Account with customer ID %d was created.\n", $customer->getCustomerId());Hi Jianan,
The inviteeEmail and inviteeRole fields are accessible to whitelisted customers only. Could you please send us your customer Id via Reply Privately to Author option for us to check whether it has been whitelisted for this feature?
Thanks and regards,
Xiaoming, Google Ads API Team
Hi Jianan,
By further checking with your account I can confirm your account is not whitelisted for this feature. Currently there is no other way to associate the customer account with the MCC account via API if the MCC manager account is not directly whitelisted. Please let us know if you have any further questions.
Thanks and regards,
Xiaoming, Google Ads API Team
Hi Jianan,
You could ask your account manager at Google to request if you could be added to the whitelist. Please let us know if you have any further questions.
Thanks and regards,
Xiaoming, Google Ads API Team