4.3.2 合并结算选项
下图显示了 Google Ads 经理账号的推荐组织方式 账号和广告客户账号。
以下备注针对的是上图中的数字:
合并账单 (CB) 的账号数量上限为 1.5 万位,或 可添加的账单。如果第一张合并账单 (CB US1) 达到 15,000 金额 账单或账号,所有即将到期的账单或账号都应添加到 CB 中 US2。
如需为您的经理账号设置合并结算,请申请 填写合并结算申请表单。您必须先 Google 批准的信用额度;如果您还没有账号,可以 使用“与 Google 联系”表单申请获取支持。
闲置账号(流失)可以转移到其他经理账号。 拆分这些账号有助于您将账号大小保持在 15K 的范围内。作为一项预防措施, 建议您删除这些账号的预算订单, 无法继续支出,除非手动重新启用。
如果您的集成允许用户使用现有的 Google Ads 账号,请创建 单独的经理账号合并结算不能用于 因为他们可能已经在投放其他广告系列类型和 的客户可能已设置直接结算。
要直接在 Google Ads 界面中设置合并结算,请按照 设置合并结算中的说明。
技术指南
要使用 API 为商家 Google Ads 账号设置和管理结算,请执行以下操作:
使用 BillingSetup
资源获取和管理账号级结算
配置。结算设置是指
付款账号和特定的 Google Ads 账号。它能有效
确定负责为广告客户账号支付费用的人员。按照
结算设置说明。
管理账号预算
账号预算指定了账号级预算属性,例如起始日期
时长、结束时间和支出限额对账号预算的所有更改均由
提交单独的账号预算提案
获批后,就会成为账号预算。使用 AccountBudgetProposal
资源
来创建新的AccountBudgets
或更新现有项目。
以下示例展示了如何创建新的预算提案:
Java
private void runExample(GoogleAdsClient googleAdsClient, long customerId, long billingSetupId) { // Creates an AccountBudgetProposal. This will be reviewed offline by Google Ads, and if // approved will become an AccountBudget. AccountBudgetProposal proposal = AccountBudgetProposal.newBuilder() .setBillingSetup(ResourceNames.billingSetup(customerId, billingSetupId)) .setProposalType(AccountBudgetProposalType.CREATE) .setProposedName("Account Budget (example)") // Specifies the account budget starts immediately. .setProposedStartTimeType(TimeType.NOW) // Alternatively you can specify a specific start time. Refer to the // AccountBudgetProposal // resource documentation for allowed formats. // // .setProposedStartDateTime("2020-01-02 03:04:05") // Specifies that the budget runs forever. .setProposedEndTimeType(TimeType.FOREVER) // Alternatively you can specify a specific end time. Allowed formats are as above. // .setProposedEndDateTime("2021-02-03 04:05:06") // Optional: sets notes for the budget. These are free text and do not effect budget // delivery. // .setProposedNotes("Received prepayment of $0.01") // Sets the spending limit to 0.01, measured in the Google Ads account currency. .setProposedSpendingLimitMicros(10_000) // Optional: sets PO number for record keeping. This value is at the user's // discretion, and has no effect on Google Billing & Payments. // .setProposedPurchaseOrderNumber("PO number 12345") .build(); // Creates an operation which will add the new AccountBudgetProposal. AccountBudgetProposalOperation operation = AccountBudgetProposalOperation.newBuilder().setCreate(proposal).build(); try (AccountBudgetProposalServiceClient accountBudgetProposalServiceClient = googleAdsClient.getLatestVersion().createAccountBudgetProposalServiceClient()) { // Sends the request to the Account Budget Proposal Service. MutateAccountBudgetProposalResponse response = accountBudgetProposalServiceClient.mutateAccountBudgetProposal( String.valueOf(customerId), operation); System.out.printf( "Account budget proposal created: %s.%n", response.getResult().getResourceName()); } }
C#
public void Run(GoogleAdsClient client, long customerId, long billingSetupId) { // Get the AccountBudgetProposalServiceClient. AccountBudgetProposalServiceClient proposalService = client.GetService(Services.V17.AccountBudgetProposalService); // Create an AccountBudgetProposal. The proposal will be reviewed offline by Google Ads, // and if approved will become an AccountBudget. AccountBudgetProposal proposal = new AccountBudgetProposal() { BillingSetup = ResourceNames.BillingSetup(customerId, billingSetupId), ProposalType = AccountBudgetProposalType.Create, ProposedName = "Account Budget (example)", // Specify the account budget starts immediately ProposedStartTimeType = TimeType.Now, // Alternatively, you can specify a specific start time. Refer to the // AccountBudgetProposal resource documentation for allowed formats. // //ProposedStartDateTime = "2020-01-02 03:04:05", // Specify that the budget runs forever. ProposedEndTimeType = TimeType.Forever, // Alternatively you can specify a specific end time. Allowed formats are as above. //ProposedEndDateTime = "2021-02-03 04:05:06", // Optional: set notes for the budget. These are free text and do not effect budget // delivery. //ProposedNotes = "Received prepayment of $0.01", // Set the spending limit to 0.01, measured in the Google Ads account currency. ProposedSpendingLimitMicros = 10_000 // Optional: set PO number for record keeping. This value is at the user's // discretion, and has no effect on Google Billing & Payments. //ProposedPurchaseOrderNumber = "PO number 12345" }; // Create an operation which will add the new AccountBudgetProposal AccountBudgetProposalOperation operation = new AccountBudgetProposalOperation() { Create = proposal }; try { // Send the request to the Account Budget Proposal Service. MutateAccountBudgetProposalResponse response = proposalService. MutateAccountBudgetProposal(customerId.ToString(), operation); // Display the results. Console.WriteLine($"Account budget proposal '{response.Result.ResourceName}' " + "was created."); } catch (GoogleAdsException e) { Console.WriteLine("Failure:"); Console.WriteLine($"Message: {e.Message}"); Console.WriteLine($"Failure: {e.Failure}"); Console.WriteLine($"Request ID: {e.RequestId}"); throw; } }
PHP
public static function runExample( GoogleAdsClient $googleAdsClient, int $customerId, int $billingSetupId ) { // Constructs an account budget proposal. $accountBudgetProposal = new AccountBudgetProposal([ 'billing_setup' => ResourceNames::forBillingSetup($customerId, $billingSetupId), 'proposal_type' => AccountBudgetProposalType::CREATE, 'proposed_name' => 'Account Budget (example)', // Specifies the account budget starts immediately. 'proposed_start_time_type' => TimeType::NOW, // Alternatively you can specify a specific start time. Refer to the // AccountBudgetProposal class for allowed formats. // // 'proposed_start_date_time' => '2020-01-02 03:04:05', // Specify that the budget runs forever. 'proposed_end_time_type' => TimeType::FOREVER, // Alternatively you can specify a specific end time. Allowed formats are as above. // 'proposed_end_date_time' => '2021-02-03 04:05:06', // Optional: set notes for the budget. These are free text and do not effect budget // delivery. // 'proposed_notes' => 'Received prepayment of $0.01', // Optional: set PO number for record keeping. This value is at the user's // discretion, and has no effect on Google Billing & Payments. // 'proposed_purchase_order_number' => 'PO number 12345', // Set the spending limit to 0.01, measured in the Google Ads account currency. 'proposed_spending_limit_micros' => 10000 ]); $accountBudgetProposalOperation = new AccountBudgetProposalOperation(); $accountBudgetProposalOperation->setCreate($accountBudgetProposal); // Issues a mutate request to add the account budget proposal. $accountBudgetProposalServiceClient = $googleAdsClient->getAccountBudgetProposalServiceClient(); $response = $accountBudgetProposalServiceClient->mutateAccountBudgetProposal( MutateAccountBudgetProposalRequest::build($customerId, $accountBudgetProposalOperation) ); printf( "Added an account budget proposal with resource name '%s'.%s", $response->getResult()->getResourceName(), PHP_EOL ); }
Python
def main(client, customer_id, billing_setup_id): account_budget_proposal_service = client.get_service( "AccountBudgetProposalService" ) billing_setup_service = client.get_service("BillingSetupService") account_budget_proposal_operation = client.get_type( "AccountBudgetProposalOperation" ) proposal = account_budget_proposal_operation.create proposal.proposal_type = client.enums.AccountBudgetProposalTypeEnum.CREATE proposal.billing_setup = billing_setup_service.billing_setup_path( customer_id, billing_setup_id ) proposal.proposed_name = "Account Budget Proposal (example)" # Specify the account budget starts immediately proposal.proposed_start_time_type = client.enums.TimeTypeEnum.NOW # Alternatively you can specify a specific start time. Refer to the # AccountBudgetProposal resource documentation for allowed formats. # # proposal.proposed_start_date_time = '2020-01-02 03:04:05' # Specify that the budget runs forever proposal.proposed_end_time_type = client.enums.TimeTypeEnum.FOREVER # Alternatively you can specify a specific end time. Allowed formats are as # above. # # proposal.proposed_end_date_time = '2021-01-02 03:04:05' # Optional: set notes for the budget. These are free text and do not effect # budget delivery. # # proposal.proposed_notes = 'Received prepayment of $0.01' proposal.proposed_spending_limit_micros = 10000 account_budget_proposal_response = ( account_budget_proposal_service.mutate_account_budget_proposal( customer_id=customer_id, operation=account_budget_proposal_operation, ) ) print( "Created account budget proposal " f'"{account_budget_proposal_response.result.resource_name}".' )
Ruby
def add_account_budget_proposal(customer_id, billing_setup_id) # GoogleAdsClient will read a config file from # ENV['HOME']/google_ads_config.rb when called without parameters client = Google::Ads::GoogleAds::GoogleAdsClient.new operation = client.operation.create_resource.account_budget_proposal do |proposal| proposal.billing_setup = client.path.billing_setup(customer_id, billing_setup_id) proposal.proposal_type = :CREATE proposal.proposed_name = 'Account Budget (example)' # Specify the account budget starts immediately proposal.proposed_start_time_type = :NOW # Alternatively you can specify a specific start time. Refer to the # AccountBudgetProposal resource documentation for allowed formats. # # proposal.proposed_start_date_time = '2020-01-02 03:04:05' # Specify that the budget runs forever. proposal.proposed_end_time_type = :FOREVER # Alternatively you can specify a specific end time. Allowed formats are as # above. # # proposal.proposed_end_date_time = '2021-01-02 03:04:05' # Optional: set notes for the budget. These are free text and do not affect # budget delivery. # # proposal.proposed_notes = 'Received prepayment of $0.01' # Set the spending limit to 0.01, measured in the Google Ads account currency. proposal.proposed_spending_limit_micros = 10_000 end account_budget_proposal_service = client.service.account_budget_proposal # Add budget proposal. response = account_budget_proposal_service.mutate_account_budget_proposal( customer_id: customer_id, operation: operation, ) puts sprintf("Created budget proposal %s.", response.results.first.resource_name) end
Perl
sub add_account_budget_proposal { my ($api_client, $customer_id, $billing_setup_id) = @_; # Create an account budget proposal. my $account_budget_proposal = Google::Ads::GoogleAds::V17::Resources::AccountBudgetProposal->new({ billingSetup => Google::Ads::GoogleAds::V17::Utils::ResourceNames::billing_setup( $customer_id, $billing_setup_id ), proposalType => CREATE, proposedName => "Account Budget (example)", # Specify that the account budget starts immediately. proposedStartTimeType => NOW, # Alternatively you can specify a specific start time. Refer to the # AccountBudgetProposal class for allowed formats. # # proposedStartDateTime => "2020-01-02 03:04:05", # Specify that the account budget runs forever. proposedEndDateTime => FOREVER, # Alternatively you can specify a specific end time. Allowed formats are as below. # proposedEndDateTime => "2021-02-03 04:05:06", # Optional: set notes for the budget. These are free text and do not effect budget # delivery. # proposedNotes => "Received prepayment of $0.01", # Optional: set PO number for record keeping. This value is at the user's # discretion, and has no effect on Google Billing & Payments. # proposedPurchaseOrderNumber => "PO number 12345", # Set the spending limit to 0.01, measured in the Google Ads account currency. proposedSpendingLimitMicros => 10000 }); # Create an account budget proposal operation. my $account_budget_proposal_operation = Google::Ads::GoogleAds::V17::Services::AccountBudgetProposalService::AccountBudgetProposalOperation ->new({ create => $account_budget_proposal }); # Add the account budget proposal. my $account_budget_proposal_response = $api_client->AccountBudgetProposalService()->mutate({ customerId => $customer_id, operation => $account_budget_proposal_operation }); printf "Created account budget proposal '%s'.\n", $account_budget_proposal_response->{result}{resourceName}; return 1; }
如需更新账号预算,请使用AccountBudgetProposalService
执行以下操作:
管理预算参数。最常见的管理操作包括
更新支出限额和日期时间字段。有关
可变字段,请参阅 AccountBudgetProposal
。以下示例展示了
如何更新现有账号预算的建议支出限额。
Java
private void runExample(GoogleAdsClient googleAdsClient, long customerId, long billingSetupId) { // Creates an AccountBudgetProposal. This will be reviewed offline by Google Ads, and if // approved will become an AccountBudget. AccountBudgetProposal proposal = AccountBudgetProposal.newBuilder() .setBillingSetup(ResourceNames.billingSetup(customerId, billingSetupId)) .setProposalType(AccountBudgetProposalType.CREATE) .setProposedName("Account Budget (example)") // Specifies the account budget starts immediately. .setProposedStartTimeType(TimeType.NOW) // Alternatively you can specify a specific start time. Refer to the // AccountBudgetProposal // resource documentation for allowed formats. // // .setProposedStartDateTime("2020-01-02 03:04:05") // Specifies that the budget runs forever. .setProposedEndTimeType(TimeType.FOREVER) // Alternatively you can specify a specific end time. Allowed formats are as above. // .setProposedEndDateTime("2021-02-03 04:05:06") // Optional: sets notes for the budget. These are free text and do not effect budget // delivery. // .setProposedNotes("Received prepayment of $0.01") // Sets the spending limit to 0.01, measured in the Google Ads account currency. .setProposedSpendingLimitMicros(10_000) // Optional: sets PO number for record keeping. This value is at the user's // discretion, and has no effect on Google Billing & Payments. // .setProposedPurchaseOrderNumber("PO number 12345") .build(); // Creates an operation which will add the new AccountBudgetProposal. AccountBudgetProposalOperation operation = AccountBudgetProposalOperation.newBuilder().setCreate(proposal).build(); try (AccountBudgetProposalServiceClient accountBudgetProposalServiceClient = googleAdsClient.getLatestVersion().createAccountBudgetProposalServiceClient()) { // Sends the request to the Account Budget Proposal Service. MutateAccountBudgetProposalResponse response = accountBudgetProposalServiceClient.mutateAccountBudgetProposal( String.valueOf(customerId), operation); System.out.printf( "Account budget proposal created: %s.%n", response.getResult().getResourceName()); } }
C#
public void Run(GoogleAdsClient client, long customerId, long billingSetupId) { // Get the AccountBudgetProposalServiceClient. AccountBudgetProposalServiceClient proposalService = client.GetService(Services.V17.AccountBudgetProposalService); // Create an AccountBudgetProposal. The proposal will be reviewed offline by Google Ads, // and if approved will become an AccountBudget. AccountBudgetProposal proposal = new AccountBudgetProposal() { BillingSetup = ResourceNames.BillingSetup(customerId, billingSetupId), ProposalType = AccountBudgetProposalType.Create, ProposedName = "Account Budget (example)", // Specify the account budget starts immediately ProposedStartTimeType = TimeType.Now, // Alternatively, you can specify a specific start time. Refer to the // AccountBudgetProposal resource documentation for allowed formats. // //ProposedStartDateTime = "2020-01-02 03:04:05", // Specify that the budget runs forever. ProposedEndTimeType = TimeType.Forever, // Alternatively you can specify a specific end time. Allowed formats are as above. //ProposedEndDateTime = "2021-02-03 04:05:06", // Optional: set notes for the budget. These are free text and do not effect budget // delivery. //ProposedNotes = "Received prepayment of $0.01", // Set the spending limit to 0.01, measured in the Google Ads account currency. ProposedSpendingLimitMicros = 10_000 // Optional: set PO number for record keeping. This value is at the user's // discretion, and has no effect on Google Billing & Payments. //ProposedPurchaseOrderNumber = "PO number 12345" }; // Create an operation which will add the new AccountBudgetProposal AccountBudgetProposalOperation operation = new AccountBudgetProposalOperation() { Create = proposal }; try { // Send the request to the Account Budget Proposal Service. MutateAccountBudgetProposalResponse response = proposalService. MutateAccountBudgetProposal(customerId.ToString(), operation); // Display the results. Console.WriteLine($"Account budget proposal '{response.Result.ResourceName}' " + "was created."); } catch (GoogleAdsException e) { Console.WriteLine("Failure:"); Console.WriteLine($"Message: {e.Message}"); Console.WriteLine($"Failure: {e.Failure}"); Console.WriteLine($"Request ID: {e.RequestId}"); throw; } }
PHP
public static function runExample( GoogleAdsClient $googleAdsClient, int $customerId, int $billingSetupId ) { // Constructs an account budget proposal. $accountBudgetProposal = new AccountBudgetProposal([ 'billing_setup' => ResourceNames::forBillingSetup($customerId, $billingSetupId), 'proposal_type' => AccountBudgetProposalType::CREATE, 'proposed_name' => 'Account Budget (example)', // Specifies the account budget starts immediately. 'proposed_start_time_type' => TimeType::NOW, // Alternatively you can specify a specific start time. Refer to the // AccountBudgetProposal class for allowed formats. // // 'proposed_start_date_time' => '2020-01-02 03:04:05', // Specify that the budget runs forever. 'proposed_end_time_type' => TimeType::FOREVER, // Alternatively you can specify a specific end time. Allowed formats are as above. // 'proposed_end_date_time' => '2021-02-03 04:05:06', // Optional: set notes for the budget. These are free text and do not effect budget // delivery. // 'proposed_notes' => 'Received prepayment of $0.01', // Optional: set PO number for record keeping. This value is at the user's // discretion, and has no effect on Google Billing & Payments. // 'proposed_purchase_order_number' => 'PO number 12345', // Set the spending limit to 0.01, measured in the Google Ads account currency. 'proposed_spending_limit_micros' => 10000 ]); $accountBudgetProposalOperation = new AccountBudgetProposalOperation(); $accountBudgetProposalOperation->setCreate($accountBudgetProposal); // Issues a mutate request to add the account budget proposal. $accountBudgetProposalServiceClient = $googleAdsClient->getAccountBudgetProposalServiceClient(); $response = $accountBudgetProposalServiceClient->mutateAccountBudgetProposal( MutateAccountBudgetProposalRequest::build($customerId, $accountBudgetProposalOperation) ); printf( "Added an account budget proposal with resource name '%s'.%s", $response->getResult()->getResourceName(), PHP_EOL ); }
Python
def main(client, customer_id, billing_setup_id): account_budget_proposal_service = client.get_service( "AccountBudgetProposalService" ) billing_setup_service = client.get_service("BillingSetupService") account_budget_proposal_operation = client.get_type( "AccountBudgetProposalOperation" ) proposal = account_budget_proposal_operation.create proposal.proposal_type = client.enums.AccountBudgetProposalTypeEnum.CREATE proposal.billing_setup = billing_setup_service.billing_setup_path( customer_id, billing_setup_id ) proposal.proposed_name = "Account Budget Proposal (example)" # Specify the account budget starts immediately proposal.proposed_start_time_type = client.enums.TimeTypeEnum.NOW # Alternatively you can specify a specific start time. Refer to the # AccountBudgetProposal resource documentation for allowed formats. # # proposal.proposed_start_date_time = '2020-01-02 03:04:05' # Specify that the budget runs forever proposal.proposed_end_time_type = client.enums.TimeTypeEnum.FOREVER # Alternatively you can specify a specific end time. Allowed formats are as # above. # # proposal.proposed_end_date_time = '2021-01-02 03:04:05' # Optional: set notes for the budget. These are free text and do not effect # budget delivery. # # proposal.proposed_notes = 'Received prepayment of $0.01' proposal.proposed_spending_limit_micros = 10000 account_budget_proposal_response = ( account_budget_proposal_service.mutate_account_budget_proposal( customer_id=customer_id, operation=account_budget_proposal_operation, ) ) print( "Created account budget proposal " f'"{account_budget_proposal_response.result.resource_name}".' )
Ruby
def add_account_budget_proposal(customer_id, billing_setup_id) # GoogleAdsClient will read a config file from # ENV['HOME']/google_ads_config.rb when called without parameters client = Google::Ads::GoogleAds::GoogleAdsClient.new operation = client.operation.create_resource.account_budget_proposal do |proposal| proposal.billing_setup = client.path.billing_setup(customer_id, billing_setup_id) proposal.proposal_type = :CREATE proposal.proposed_name = 'Account Budget (example)' # Specify the account budget starts immediately proposal.proposed_start_time_type = :NOW # Alternatively you can specify a specific start time. Refer to the # AccountBudgetProposal resource documentation for allowed formats. # # proposal.proposed_start_date_time = '2020-01-02 03:04:05' # Specify that the budget runs forever. proposal.proposed_end_time_type = :FOREVER # Alternatively you can specify a specific end time. Allowed formats are as # above. # # proposal.proposed_end_date_time = '2021-01-02 03:04:05' # Optional: set notes for the budget. These are free text and do not affect # budget delivery. # # proposal.proposed_notes = 'Received prepayment of $0.01' # Set the spending limit to 0.01, measured in the Google Ads account currency. proposal.proposed_spending_limit_micros = 10_000 end account_budget_proposal_service = client.service.account_budget_proposal # Add budget proposal. response = account_budget_proposal_service.mutate_account_budget_proposal( customer_id: customer_id, operation: operation, ) puts sprintf("Created budget proposal %s.", response.results.first.resource_name) end
Perl
sub add_account_budget_proposal { my ($api_client, $customer_id, $billing_setup_id) = @_; # Create an account budget proposal. my $account_budget_proposal = Google::Ads::GoogleAds::V17::Resources::AccountBudgetProposal->new({ billingSetup => Google::Ads::GoogleAds::V17::Utils::ResourceNames::billing_setup( $customer_id, $billing_setup_id ), proposalType => CREATE, proposedName => "Account Budget (example)", # Specify that the account budget starts immediately. proposedStartTimeType => NOW, # Alternatively you can specify a specific start time. Refer to the # AccountBudgetProposal class for allowed formats. # # proposedStartDateTime => "2020-01-02 03:04:05", # Specify that the account budget runs forever. proposedEndDateTime => FOREVER, # Alternatively you can specify a specific end time. Allowed formats are as below. # proposedEndDateTime => "2021-02-03 04:05:06", # Optional: set notes for the budget. These are free text and do not effect budget # delivery. # proposedNotes => "Received prepayment of $0.01", # Optional: set PO number for record keeping. This value is at the user's # discretion, and has no effect on Google Billing & Payments. # proposedPurchaseOrderNumber => "PO number 12345", # Set the spending limit to 0.01, measured in the Google Ads account currency. proposedSpendingLimitMicros => 10000 }); # Create an account budget proposal operation. my $account_budget_proposal_operation = Google::Ads::GoogleAds::V17::Services::AccountBudgetProposalService::AccountBudgetProposalOperation ->new({ create => $account_budget_proposal }); # Add the account budget proposal. my $account_budget_proposal_response = $api_client->AccountBudgetProposalService()->mutate({ customerId => $customer_id, operation => $account_budget_proposal_operation }); printf "Created account budget proposal '%s'.\n", $account_budget_proposal_response->{result}{resourceName}; return 1; }
要终止有效的账号预算,请将结束时间设置为当前时间,即
使用 AccountBudgetProposalType.END
发送提案。
开具账单
广告客户启用后,系统会按月开具账单。账单包含 例如调整项、监管费用、税费和账号预算, 可以下载为 PDF 文件。作为管理者,您通常使用这些工具 自动对您自己的客户账单进行对账。您需要具备以下条件 启用账单结算:
为 Google Ads 账号启用按月账单结算。请参阅 账号结算设置和预算指南,了解如何管理 使用 Google Ads API 进行结算
如果设置,
login-customer-id
必须指定经理的客户 ID 您要检索的 Google Ads 账号所属的 Google Ads 账号 账单。它在 Google Ads 界面中被标记为付款经理账号。
检索账单数据的 Invoice
资源,方法是使用
InvoiceService
。请求 InvoiceService.ListInvoices
方法。
在 ListInvoicesRequest
中设置所有必填字段:
customer_id
、billing_setup
、issue_year
和 issue_month
。以下
示例显示了如何发出此请求:
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))) ) );
Python
# Issues a request to list invoices. response = client.get_service("InvoiceService").list_invoices( customer_id=customer_id, billing_setup=client.get_service("GoogleAdsService").billing_setup_path( customer_id, billing_setup_id ), # The year needs to be 2019 or later, per the docs: # https://developers.google.com/google-ads/api/docs/billing/invoice?hl=en#retrieving_invoices issue_year=str(last_month.year), issue_month=last_month.strftime("%B").upper(), )
Ruby
# Issues a request to list invoices. response = client.service.invoice.list_invoices( customer_id: customer_id, billing_setup: client.path.billing_setup(customer_id, billing_setup_id), # The year needs to be 2019 or later. issue_year: last_month.year.to_s, # '%^B' option returns the uppercased full month name (e.g. 'JANUARY'). issue_month: last_month.strftime("%^B").to_sym, )
Perl
# Issue the request. my $response = $api_client->InvoiceService()->list({ customerId => $customer_id, billingSetup => Google::Ads::GoogleAds::V17::Utils::ResourceNames::billing_setup( ($customer_id, $billing_setup_id) ), # The year needs to be 2019 or later. issueYear => strftime("%Y", @last_month), issueMonth => uc(strftime("%B", @last_month))});
响应是一个 ListInvoicesResponse
对象,其中包含以下
与“Invoices
”匹配。账单会整合所有 Google Ads 数据
采用与以下账号相同的基础付款账号的结算设置:
请求的结算设置所使用的电子邮件地址。仅当
相关付款账号是否符合合并结算的条件。