title: How do I get invoice information using REST in Google Ads API?
body: <p>I am now looking to get invoice info using Google Ads API
  I tried to code the following and run it in GoogleAppScript, but all I got was an error message &quot;Request contains an invalid argument.</p>
  <pre><code>const access_token = &quot;XXXXXXXXXXXXXXXXXX&quot;;
  const developer_token = &quot;XXXXXXXXXXXXXXXXXX&quot;;
  const mcc_account = &quot;XXXXXXXXXX&quot;;
  const customerId = &quot;XXXXXXXXXXXXX&quot;;
  const billing_Setup = &quot;XXXXXXX&quot;;
  const issue_Year = &quot;2022&quot;;
  
  function download_invoices(access_token, developer_token, mcc_account, customerId, billing_Setup, issue_Year) {
    const billingSetup = encodeURIComponent(`customers/${customerId}/billingSetups/${billing_Setup}`);
    const url = `https://googleads.googleapis.com/v10/customers/${customerId}/invoices?billingSetup=${billingSetup}&amp;issueYear=${issue_Year}&amp;issueMonth=MARCH`;
    const headers = {
      &quot;Authorization&quot;: &quot;Bearer &quot; + access_token,
      &quot;developer-token&quot;: &quot;Bearer &quot; + developer_token,
      &quot;login-customer-id&quot;: &quot;Bearer &quot; + mcc_account
    };
    const options = {
      &quot;method&quot;: &quot;get&quot;,
      &quot;headers&quot;: headers,
    };
    const httpResponse = UrlFetchApp.fetch(url, options);
    const status = httpResponse.getResponseCode();
    if (status !== 200) {
      throw &quot;HttpRequestError&quot;;
    }
    const response = JSON.parse(httpResponse.getContentText());
    return response;
  }
  </code></pre>
  <p>By the way, I am able to get the access token without any problem.</p>
  <pre><code>const client_Id = &quot;XXXXXX&quot;;
  const client_Secret = &quot;XXXXXXXXXXXXXXXXXX&quot;;
  const refresh_Token = &quot;XXXXXXXXXXXXXXXXXX&quot;;
  
  function get_accesstoken(client_Id, client_Secret, refresh_Token) {
    const url = &quot;https://accounts.google.com/o/oauth2/token&quot;;
    const opt = {
          &quot;method&quot; : &quot;POST&quot;,
          &quot;payload&quot; : {
              &quot;client_id&quot; : client_Id,
              &quot;client_secret&quot; : client_Secret,
              &quot;refresh_token&quot; : refresh_Token,
              &quot;grant_type&quot; : &quot;refresh_token&quot;
          },
          &quot;muteHttpExceptions&quot; : true
    };
    const httpResponse = UrlFetchApp.fetch(url, opt);
    const status = httpResponse.getResponseCode();
    if (status !== 200) {
      throw 'HttpRequestError';
    }
    const response = JSON.parse(httpResponse.getContentText());
    return response;
  }
  </code></pre>
  <p>Is there something missing in this code?</p>
  <p>All codes were made with the following reference.</p>
  <p><a href="https://developers.google.com/google-ads/api/rest/reference/rest/v10/customers.invoices/list#google.ads.googleads.v10.services.InvoiceService.ListInvoices" rel="nofollow noreferrer">https://developers.google.com/google-ads/api/rest/reference/rest/v10/customers.invoices/list#google.ads.googleads.v10.services.InvoiceService.ListInvoices</a></p>
  <p>Result : I thought I could get the invoice information tied to my account, but all I got was an error &quot;Request contains an invalid argument.</p>
  <pre><code>Exception: Request failed for https://googleads.googleapis.com returned code 400. Truncated server response: {
    &quot;error&quot;: {
      &quot;code&quot;: 400,
      &quot;message&quot;: &quot;Request contains an invalid argument.&quot;,
      &quot;status&quot;: &quot;INVALID_ARGUMENT&quot;,
      &quot;details&quot;: [
        {
  ... (use muteHttpExceptions option to examine full response)
  </code></pre>