'Invalid Customer ID - google-ads-api, I have provided correct customer_id set but it is returning error

I am using google-ads-api module in nodejs to connect with Google Ads API.

I am using this code block to get Customer

const customer = client.Customer({
    customer_id: 'XXX-XXX-XXXX',
    refresh_token: refreshToken,
})

I have used XXX-XXX-XXXX, XXXXXXXXXX, XXXX-XXX-XXX format for customer_id but still it is returning this error

GoogleAdsFailure {
  errors: [
    GoogleAdsError {
      error_code: [ErrorCode],
      message: "Invalid customer ID ''."
    }
  ],
  request_id: 'OcUdfalh_N0U4hTJUd6c6g'
}


Solution 1:[1]

from https://developers.google.com/google-ads/api/docs/best-practices/common-errors#client_customer_id_invalid

i think you should remove the "-" from customer id

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Richard Kang