I believe I solved this by adding an additional filter to the Customer 
Client query.
This filter removed non active or test accounts, which I am guessing caused 
the customer isn't enabled error.

Original Query:
$query = 'SELECT customer_client.client_customer, customer_client.level,'
. ' customer_client.manager, customer_client.descriptive_name,'
. ' customer_client.currency_code, customer_client.time_zone,'
. " customer_client.id FROM customer_client WHERE customer_client.level <= 
1";

New Query

$query = 'SELECT customer_client.client_customer, customer_client.level,'
. ' customer_client.manager, customer_client.descriptive_name,'
. ' customer_client.currency_code, customer_client.time_zone,'
. " customer_client.id FROM customer_client WHERE customer_client.level <= 
1 and customer_client.test_account != TRUE and customer_client.status = 
'ENABLED'";

On Saturday, April 2, 2022 at 1:58:51 AM UTC-5 John Lee wrote:

> I am currently trying to get all the child accounts for a manager account.
> Request ID: mCqXs9CAU-CwEzP7x8tFMg
>
> Error: Google Ads failure details: authorization_error: The customer can't 
> be used because it isn't enabled.
>
> I am using the php library and following the guide to get account 
> hierarchies here: 
>
> https://developers.google.com/google-ads/api/docs/account-management/get-account-hierarchy
>
> I am passing the loginCustomerId
> $googleAdsClient = (new 
> GoogleAdsClientBuilder())->fromFile('../../Dashboard/php/google-ads-php/google_ads_php.ini')
> ->withOAuth2Credential($oAuth2Credential)
> ->withLoginCustomerId($loginCustomerId ?? $rootCustomerId)
> ->build();
>
> I am using a basic access developer token and the manager account is 
> active and not a testing account.
>
> Any help would be appreciated, let me know if you need more information.
>
> Thank you.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/a842bc93-33bc-4c86-b98d-799cef62e603n%40googlegroups.com.
  • Go... John Lee
    • ... John Lee
      • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Steven Zhang
        • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to