1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.ads.googleads.v16.resources; 18 19import "google/ads/googleads/v16/common/dates.proto"; 20import "google/ads/googleads/v16/enums/invoice_type.proto"; 21import "google/ads/googleads/v16/enums/month_of_year.proto"; 22import "google/api/field_behavior.proto"; 23import "google/api/resource.proto"; 24 25option csharp_namespace = "Google.Ads.GoogleAds.V16.Resources"; 26option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources"; 27option java_multiple_files = true; 28option java_outer_classname = "InvoiceProto"; 29option java_package = "com.google.ads.googleads.v16.resources"; 30option objc_class_prefix = "GAA"; 31option php_namespace = "Google\\Ads\\GoogleAds\\V16\\Resources"; 32option ruby_package = "Google::Ads::GoogleAds::V16::Resources"; 33 34// Proto file describing the Invoice resource. 35 36// An invoice. All invoice information is snapshotted to match the PDF invoice. 37// For invoices older than the launch of InvoiceService, the snapshotted 38// information may not match the PDF invoice. 39message Invoice { 40 option (google.api.resource) = { 41 type: "googleads.googleapis.com/Invoice" 42 pattern: "customers/{customer_id}/invoices/{invoice_id}" 43 }; 44 45 // Represents a summarized view at account level. 46 message AccountSummary { 47 // Output only. The account associated with the account summary. 48 optional string customer = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 49 50 // Output only. Pretax billing correction subtotal amount, in micros. 51 optional int64 billing_correction_subtotal_amount_micros = 2 52 [(google.api.field_behavior) = OUTPUT_ONLY]; 53 54 // Output only. Tax on billing correction, in micros. 55 optional int64 billing_correction_tax_amount_micros = 3 56 [(google.api.field_behavior) = OUTPUT_ONLY]; 57 58 // Output only. Total billing correction amount, in micros. 59 optional int64 billing_correction_total_amount_micros = 4 60 [(google.api.field_behavior) = OUTPUT_ONLY]; 61 62 // Output only. Pretax coupon adjustment subtotal amount, in micros. 63 optional int64 coupon_adjustment_subtotal_amount_micros = 5 64 [(google.api.field_behavior) = OUTPUT_ONLY]; 65 66 // Output only. Tax on coupon adjustment, in micros. 67 optional int64 coupon_adjustment_tax_amount_micros = 6 68 [(google.api.field_behavior) = OUTPUT_ONLY]; 69 70 // Output only. Total coupon adjustment amount, in micros. 71 optional int64 coupon_adjustment_total_amount_micros = 7 72 [(google.api.field_behavior) = OUTPUT_ONLY]; 73 74 // Output only. Pretax excess credit adjustment subtotal amount, in micros. 75 optional int64 excess_credit_adjustment_subtotal_amount_micros = 8 76 [(google.api.field_behavior) = OUTPUT_ONLY]; 77 78 // Output only. Tax on excess credit adjustment, in micros. 79 optional int64 excess_credit_adjustment_tax_amount_micros = 9 80 [(google.api.field_behavior) = OUTPUT_ONLY]; 81 82 // Output only. Total excess credit adjustment amount, in micros. 83 optional int64 excess_credit_adjustment_total_amount_micros = 10 84 [(google.api.field_behavior) = OUTPUT_ONLY]; 85 86 // Output only. Pretax regulatory costs subtotal amount, in micros. 87 optional int64 regulatory_costs_subtotal_amount_micros = 11 88 [(google.api.field_behavior) = OUTPUT_ONLY]; 89 90 // Output only. Tax on regulatory costs, in micros. 91 optional int64 regulatory_costs_tax_amount_micros = 12 92 [(google.api.field_behavior) = OUTPUT_ONLY]; 93 94 // Output only. Total regulatory costs amount, in micros. 95 optional int64 regulatory_costs_total_amount_micros = 13 96 [(google.api.field_behavior) = OUTPUT_ONLY]; 97 98 // Output only. Pretax export charge subtotal amount, in micros. 99 optional int64 export_charge_subtotal_amount_micros = 17 100 [(google.api.field_behavior) = OUTPUT_ONLY]; 101 102 // Output only. Tax on export charge, in micros. 103 optional int64 export_charge_tax_amount_micros = 18 104 [(google.api.field_behavior) = OUTPUT_ONLY]; 105 106 // Output only. Total export charge amount, in micros. 107 optional int64 export_charge_total_amount_micros = 19 108 [(google.api.field_behavior) = OUTPUT_ONLY]; 109 110 // Output only. Total pretax subtotal amount attributable to the account 111 // during the service period, in micros. 112 optional int64 subtotal_amount_micros = 14 113 [(google.api.field_behavior) = OUTPUT_ONLY]; 114 115 // Output only. Total tax amount attributable to the account during the 116 // service period, in micros. 117 optional int64 tax_amount_micros = 15 118 [(google.api.field_behavior) = OUTPUT_ONLY]; 119 120 // Output only. Total amount attributable to the account during the service 121 // period, in micros. This equals the sum of the subtotal_amount_micros and 122 // tax_amount_micros. 123 optional int64 total_amount_micros = 16 124 [(google.api.field_behavior) = OUTPUT_ONLY]; 125 } 126 127 // Represents a summarized account budget billable cost. 128 message AccountBudgetSummary { 129 // Output only. The resource name of the customer associated with this 130 // account budget. This contains the customer ID, which appears on the 131 // invoice PDF as "Account ID". Customer resource names have the form: 132 // 133 // `customers/{customer_id}` 134 optional string customer = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; 135 136 // Output only. The descriptive name of the account budget's customer. It 137 // appears on the invoice PDF as "Account". 138 optional string customer_descriptive_name = 11 139 [(google.api.field_behavior) = OUTPUT_ONLY]; 140 141 // Output only. The resource name of the account budget associated with this 142 // summarized billable cost. AccountBudget resource names have the form: 143 // 144 // `customers/{customer_id}/accountBudgets/{account_budget_id}` 145 optional string account_budget = 12 146 [(google.api.field_behavior) = OUTPUT_ONLY]; 147 148 // Output only. The name of the account budget. It appears on the invoice 149 // PDF as "Account budget". 150 optional string account_budget_name = 13 151 [(google.api.field_behavior) = OUTPUT_ONLY]; 152 153 // Output only. The purchase order number of the account budget. It appears 154 // on the invoice PDF as "Purchase order". 155 optional string purchase_order_number = 14 156 [(google.api.field_behavior) = OUTPUT_ONLY]; 157 158 // Output only. The pretax subtotal amount attributable to this budget 159 // during the service period, in micros. 160 optional int64 subtotal_amount_micros = 15 161 [(google.api.field_behavior) = OUTPUT_ONLY]; 162 163 // Output only. The tax amount attributable to this budget during the 164 // service period, in micros. 165 optional int64 tax_amount_micros = 16 166 [(google.api.field_behavior) = OUTPUT_ONLY]; 167 168 // Output only. The total amount attributable to this budget during the 169 // service period, in micros. This equals the sum of the account budget 170 // subtotal amount and the account budget tax amount. 171 optional int64 total_amount_micros = 17 172 [(google.api.field_behavior) = OUTPUT_ONLY]; 173 174 // Output only. The billable activity date range of the account budget, 175 // within the service date range of this invoice. The end date is inclusive. 176 // This can be different from the account budget's start and end time. 177 google.ads.googleads.v16.common.DateRange billable_activity_date_range = 9 178 [(google.api.field_behavior) = OUTPUT_ONLY]; 179 180 // Output only. The pretax served amount attributable to this budget during 181 // the service period, in micros. This is only useful to reconcile invoice 182 // and delivery data. 183 optional int64 served_amount_micros = 18 184 [(google.api.field_behavior) = OUTPUT_ONLY]; 185 186 // Output only. The pretax billed amount attributable to this budget during 187 // the service period, in micros. This does not account for any adjustments. 188 optional int64 billed_amount_micros = 19 189 [(google.api.field_behavior) = OUTPUT_ONLY]; 190 191 // Output only. The pretax overdelivery amount attributable to this budget 192 // during the service period, in micros (negative value). 193 optional int64 overdelivery_amount_micros = 20 194 [(google.api.field_behavior) = OUTPUT_ONLY]; 195 196 // Output only. The pretax invalid activity amount attributable to this 197 // budget in previous months, in micros (negative value). 198 optional int64 invalid_activity_amount_micros = 21 199 [(google.api.field_behavior) = OUTPUT_ONLY]; 200 201 // Output only. The list of summarized invalid activity credits with 202 // original linkages. 203 repeated InvalidActivitySummary invalid_activity_summaries = 22 204 [(google.api.field_behavior) = OUTPUT_ONLY]; 205 } 206 207 // Details about the invalid activity for the invoice that contain 208 // additional details about invoice against which corrections are made. 209 message InvalidActivitySummary { 210 // Output only. Original month of service related to this invalid activity 211 // credit. 212 optional google.ads.googleads.v16.enums.MonthOfYearEnum.MonthOfYear 213 original_month_of_service = 1 214 [(google.api.field_behavior) = OUTPUT_ONLY]; 215 216 // Output only. Original year of service related to this invalid activity 217 // credit. 218 optional string original_year_of_service = 2 219 [(google.api.field_behavior) = OUTPUT_ONLY]; 220 221 // Output only. Original invoice number related to this invalid activity 222 // credit. 223 optional string original_invoice_id = 3 224 [(google.api.field_behavior) = OUTPUT_ONLY]; 225 226 // Output only. Original account budget name related to this invalid 227 // activity credit. 228 optional string original_account_budget_name = 4 229 [(google.api.field_behavior) = OUTPUT_ONLY]; 230 231 // Output only. Original purchase order number related to this invalid 232 // activity credit. 233 optional string original_purchase_order_number = 5 234 [(google.api.field_behavior) = OUTPUT_ONLY]; 235 236 // Output only. Invalid activity amount in micros. 237 optional int64 amount_micros = 6 238 [(google.api.field_behavior) = OUTPUT_ONLY]; 239 } 240 241 // Output only. The resource name of the invoice. Multiple customers can share 242 // a given invoice, so multiple resource names may point to the same invoice. 243 // Invoice resource names have the form: 244 // 245 // `customers/{customer_id}/invoices/{invoice_id}` 246 string resource_name = 1 [ 247 (google.api.field_behavior) = OUTPUT_ONLY, 248 (google.api.resource_reference) = { 249 type: "googleads.googleapis.com/Invoice" 250 } 251 ]; 252 253 // Output only. The ID of the invoice. It appears on the invoice PDF as 254 // "Invoice number". 255 optional string id = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; 256 257 // Output only. The type of invoice. 258 google.ads.googleads.v16.enums.InvoiceTypeEnum.InvoiceType type = 3 259 [(google.api.field_behavior) = OUTPUT_ONLY]; 260 261 // Output only. The resource name of this invoice's billing setup. 262 // 263 // `customers/{customer_id}/billingSetups/{billing_setup_id}` 264 optional string billing_setup = 26 265 [(google.api.field_behavior) = OUTPUT_ONLY]; 266 267 // Output only. A 16 digit ID used to identify the payments account associated 268 // with the billing setup, for example, "1234-5678-9012-3456". It appears on 269 // the invoice PDF as "Billing Account Number". 270 optional string payments_account_id = 27 271 [(google.api.field_behavior) = OUTPUT_ONLY]; 272 273 // Output only. A 12 digit ID used to identify the payments profile associated 274 // with the billing setup, for example, "1234-5678-9012". It appears on the 275 // invoice PDF as "Billing ID". 276 optional string payments_profile_id = 28 277 [(google.api.field_behavior) = OUTPUT_ONLY]; 278 279 // Output only. The issue date in yyyy-mm-dd format. It appears on the invoice 280 // PDF as either "Issue date" or "Invoice date". 281 optional string issue_date = 29 [(google.api.field_behavior) = OUTPUT_ONLY]; 282 283 // Output only. The due date in yyyy-mm-dd format. 284 optional string due_date = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; 285 286 // Output only. The service period date range of this invoice. The end date is 287 // inclusive. 288 google.ads.googleads.v16.common.DateRange service_date_range = 9 289 [(google.api.field_behavior) = OUTPUT_ONLY]; 290 291 // Output only. The currency code. All costs are returned in this currency. A 292 // subset of the currency codes derived from the ISO 4217 standard is 293 // supported. 294 optional string currency_code = 31 295 [(google.api.field_behavior) = OUTPUT_ONLY]; 296 297 // Output only. The pretax subtotal amount of invoice level adjustments, in 298 // micros. 299 int64 adjustments_subtotal_amount_micros = 19 300 [(google.api.field_behavior) = OUTPUT_ONLY]; 301 302 // Output only. The sum of taxes on the invoice level adjustments, in micros. 303 int64 adjustments_tax_amount_micros = 20 304 [(google.api.field_behavior) = OUTPUT_ONLY]; 305 306 // Output only. The total amount of invoice level adjustments, in micros. 307 int64 adjustments_total_amount_micros = 21 308 [(google.api.field_behavior) = OUTPUT_ONLY]; 309 310 // Output only. The pretax subtotal amount of invoice level regulatory costs, 311 // in micros. 312 int64 regulatory_costs_subtotal_amount_micros = 22 313 [(google.api.field_behavior) = OUTPUT_ONLY]; 314 315 // Output only. The sum of taxes on the invoice level regulatory costs, in 316 // micros. 317 int64 regulatory_costs_tax_amount_micros = 23 318 [(google.api.field_behavior) = OUTPUT_ONLY]; 319 320 // Output only. The total amount of invoice level regulatory costs, in micros. 321 int64 regulatory_costs_total_amount_micros = 24 322 [(google.api.field_behavior) = OUTPUT_ONLY]; 323 324 // Output only. The pretax subtotal amount of invoice level export charges, in 325 // micros. 326 optional int64 export_charge_subtotal_amount_micros = 40 327 [(google.api.field_behavior) = OUTPUT_ONLY]; 328 329 // Output only. The sum of taxes on the invoice level export charges, in 330 // micros. 331 optional int64 export_charge_tax_amount_micros = 41 332 [(google.api.field_behavior) = OUTPUT_ONLY]; 333 334 // Output only. The total amount of invoice level export charges, in micros. 335 optional int64 export_charge_total_amount_micros = 42 336 [(google.api.field_behavior) = OUTPUT_ONLY]; 337 338 // Output only. The pretax subtotal amount, in micros. This is equal to the 339 // sum of the AccountBudgetSummary subtotal amounts and 340 // Invoice.adjustments_subtotal_amount_micros. 341 optional int64 subtotal_amount_micros = 33 342 [(google.api.field_behavior) = OUTPUT_ONLY]; 343 344 // Output only. The sum of all taxes on the invoice, in micros. This equals 345 // the sum of the AccountBudgetSummary tax amounts, plus taxes not associated 346 // with a specific account budget. 347 optional int64 tax_amount_micros = 34 348 [(google.api.field_behavior) = OUTPUT_ONLY]; 349 350 // Output only. The total amount, in micros. This equals the sum of 351 // Invoice.subtotal_amount_micros, Invoice.tax_amount_micros, 352 // Invoice.regulatory_costs_subtotal_amount_micros, and 353 // Invoice.export_charge_subtotal_amount_micros (which is separated into a 354 // separate line item starting with V14.1). 355 optional int64 total_amount_micros = 35 356 [(google.api.field_behavior) = OUTPUT_ONLY]; 357 358 // Output only. The resource name of the original invoice corrected, wrote 359 // off, or canceled by this invoice, if applicable. If `corrected_invoice` is 360 // set, `replaced_invoices` will not be set. Invoice resource names have the 361 // form: 362 // 363 // `customers/{customer_id}/invoices/{invoice_id}` 364 optional string corrected_invoice = 36 365 [(google.api.field_behavior) = OUTPUT_ONLY]; 366 367 // Output only. The resource name of the original invoice(s) being rebilled or 368 // replaced by this invoice, if applicable. There might be multiple replaced 369 // invoices due to invoice consolidation. The replaced invoices may not belong 370 // to the same payments account. If `replaced_invoices` is set, 371 // `corrected_invoice` will not be set. Invoice resource names have the form: 372 // 373 // `customers/{customer_id}/invoices/{invoice_id}` 374 repeated string replaced_invoices = 37 375 [(google.api.field_behavior) = OUTPUT_ONLY]; 376 377 // Output only. The URL to a PDF copy of the invoice. Users need to pass in 378 // their OAuth token to request the PDF with this URL. 379 optional string pdf_url = 38 [(google.api.field_behavior) = OUTPUT_ONLY]; 380 381 // Output only. The list of summarized account budget information associated 382 // with this invoice. 383 repeated AccountBudgetSummary account_budget_summaries = 18 384 [(google.api.field_behavior) = OUTPUT_ONLY]; 385 386 // Output only. The list of summarized account information associated with 387 // this invoice. 388 repeated AccountSummary account_summaries = 39 389 [(google.api.field_behavior) = OUTPUT_ONLY]; 390} 391