Page Summary
-
Monthly invoices for a Google Ads account can be retrieved using the
InvoiceService. -
Retrieving invoices requires monthly invoicing to be enabled and potentially a
login-customer-idspecifying a paying manager. -
You must use the
InvoiceService.ListInvoicesmethod withcustomer_id,billing_setup,issue_year, andissue_monthparameters to retrieve invoices. -
Invoices issued before January 1, 2019, cannot be requested.
-
An invoice PDF can be downloaded by sending an authenticated HTTP GET request to the
pdf_urlof the retrieved Invoice object.
Monthly invoices for a Google Ads account can be retrieved using the
InvoiceService.
Prerequisites
- Have monthly invoicing enabled for the Google Ads account. See the guides on account billing setups and budgets to learn how to manage billing using the Google Ads API.
- If set,
login-customer-idmust specify the customer ID of a manager account that is managing the Google Ads account for which you're retrieving invoices. This is labeled as the paying manager in the Google Ads UI.
Retrieve invoices
To retrieve invoices, you must request the
InvoiceService.ListInvoices method
setting all the required fields in the
ListInvoicesRequest:
customer_id, billing_setup, issue_year, and issue_month.
If you have a consolidated billing setup, the Google Ads API returns invoices for all
customers under the same billing setup, not just the invoice for the
customer_id specified in the API request.
The customer_id must be a Google Ads serving account. To get all the
invoices for a paying manager, make one request per Google Ads serving
account.
Here is an example:
Java
// Issues the request. ListInvoicesResponse response = invoiceServiceClient.listInvoices( String.valueOf(customerId), ResourceNames.billingSetup(customerId, billingSetupId), String.valueOf(oneMonthAgo.getYear()), MonthOfYear.valueOf(oneMonthAgo.getMonth().toString()));
C#
ListInvoicesResponse response = invoiceServiceClient.ListInvoices(customerId.ToString(), ResourceNames.BillingSetup(customerId, billingSetupId), // Year must be 2019 or later. lastMonthDateTime.Year.ToString("yyyy"), lastMonth);
PHP
// Issues the request. $response = $googleAdsClient->getInvoiceServiceClient()->listInvoices( ListInvoicesRequest::build( $customerId, ResourceNames::forBillingSetup($customerId, $billingSetupId), // The year needs to be 2019 or later. date('Y', $lastMonth), MonthOfYear::value(strtoupper(date('F', $lastMonth))) ) );