invoice.proto 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. // Copyright 2022 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. syntax = "proto3";
  15. package google.ads.googleads.v10.resources;
  16. import "google/ads/googleads/v10/common/dates.proto";
  17. import "google/ads/googleads/v10/enums/invoice_type.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. option csharp_namespace = "Google.Ads.GoogleAds.V10.Resources";
  21. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v10/resources;resources";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "InvoiceProto";
  24. option java_package = "com.google.ads.googleads.v10.resources";
  25. option objc_class_prefix = "GAA";
  26. option php_namespace = "Google\\Ads\\GoogleAds\\V10\\Resources";
  27. option ruby_package = "Google::Ads::GoogleAds::V10::Resources";
  28. // Proto file describing the Invoice resource.
  29. // An invoice. All invoice information is snapshotted to match the PDF invoice.
  30. // For invoices older than the launch of InvoiceService, the snapshotted
  31. // information may not match the PDF invoice.
  32. message Invoice {
  33. option (google.api.resource) = {
  34. type: "googleads.googleapis.com/Invoice"
  35. pattern: "customers/{customer_id}/invoices/{invoice_id}"
  36. };
  37. // Represents a summarized account budget billable cost.
  38. message AccountBudgetSummary {
  39. // Output only. The resource name of the customer associated with this account budget.
  40. // This contains the customer ID, which appears on the invoice PDF as
  41. // "Account ID".
  42. // Customer resource names have the form:
  43. //
  44. // `customers/{customer_id}`
  45. optional string customer = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  46. // Output only. The descriptive name of the account budget's customer. It appears on the
  47. // invoice PDF as "Account".
  48. optional string customer_descriptive_name = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
  49. // Output only. The resource name of the account budget associated with this summarized
  50. // billable cost.
  51. // AccountBudget resource names have the form:
  52. //
  53. // `customers/{customer_id}/accountBudgets/{account_budget_id}`
  54. optional string account_budget = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  55. // Output only. The name of the account budget. It appears on the invoice PDF as "Account
  56. // budget".
  57. optional string account_budget_name = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  58. // Output only. The purchase order number of the account budget. It appears on the
  59. // invoice PDF as "Purchase order".
  60. optional string purchase_order_number = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
  61. // Output only. The pretax subtotal amount attributable to this budget during the service
  62. // period, in micros.
  63. optional int64 subtotal_amount_micros = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
  64. // Output only. The tax amount attributable to this budget during the service period, in
  65. // micros.
  66. optional int64 tax_amount_micros = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
  67. // Output only. The total amount attributable to this budget during the service period,
  68. // in micros. This equals the sum of the account budget subtotal amount and
  69. // the account budget tax amount.
  70. optional int64 total_amount_micros = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
  71. // Output only. The billable activity date range of the account budget, within the
  72. // service date range of this invoice. The end date is inclusive. This can
  73. // be different from the account budget's start and end time.
  74. google.ads.googleads.v10.common.DateRange billable_activity_date_range = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  75. }
  76. // Output only. The resource name of the invoice. Multiple customers can share a given
  77. // invoice, so multiple resource names may point to the same invoice.
  78. // Invoice resource names have the form:
  79. //
  80. // `customers/{customer_id}/invoices/{invoice_id}`
  81. string resource_name = 1 [
  82. (google.api.field_behavior) = OUTPUT_ONLY,
  83. (google.api.resource_reference) = {
  84. type: "googleads.googleapis.com/Invoice"
  85. }
  86. ];
  87. // Output only. The ID of the invoice. It appears on the invoice PDF as "Invoice number".
  88. optional string id = 25 [(google.api.field_behavior) = OUTPUT_ONLY];
  89. // Output only. The type of invoice.
  90. google.ads.googleads.v10.enums.InvoiceTypeEnum.InvoiceType type = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  91. // Output only. The resource name of this invoice's billing setup.
  92. //
  93. // `customers/{customer_id}/billingSetups/{billing_setup_id}`
  94. optional string billing_setup = 26 [(google.api.field_behavior) = OUTPUT_ONLY];
  95. // Output only. A 16 digit ID used to identify the payments account associated with the
  96. // billing setup, e.g. "1234-5678-9012-3456". It appears on the invoice PDF as
  97. // "Billing Account Number".
  98. optional string payments_account_id = 27 [(google.api.field_behavior) = OUTPUT_ONLY];
  99. // Output only. A 12 digit ID used to identify the payments profile associated with the
  100. // billing setup, e.g. "1234-5678-9012". It appears on the invoice PDF as
  101. // "Billing ID".
  102. optional string payments_profile_id = 28 [(google.api.field_behavior) = OUTPUT_ONLY];
  103. // Output only. The issue date in yyyy-mm-dd format. It appears on the invoice PDF as
  104. // either "Issue date" or "Invoice date".
  105. optional string issue_date = 29 [(google.api.field_behavior) = OUTPUT_ONLY];
  106. // Output only. The due date in yyyy-mm-dd format.
  107. optional string due_date = 30 [(google.api.field_behavior) = OUTPUT_ONLY];
  108. // Output only. The service period date range of this invoice. The end date is inclusive.
  109. google.ads.googleads.v10.common.DateRange service_date_range = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  110. // Output only. The currency code. All costs are returned in this currency. A subset of the
  111. // currency codes derived from the ISO 4217 standard is supported.
  112. optional string currency_code = 31 [(google.api.field_behavior) = OUTPUT_ONLY];
  113. // Output only. The pretax subtotal amount of invoice level adjustments, in micros.
  114. int64 adjustments_subtotal_amount_micros = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
  115. // Output only. The sum of taxes on the invoice level adjustments, in micros.
  116. int64 adjustments_tax_amount_micros = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
  117. // Output only. The total amount of invoice level adjustments, in micros.
  118. int64 adjustments_total_amount_micros = 21 [(google.api.field_behavior) = OUTPUT_ONLY];
  119. // Output only. The pretax subtotal amount of invoice level regulatory costs, in micros.
  120. int64 regulatory_costs_subtotal_amount_micros = 22 [(google.api.field_behavior) = OUTPUT_ONLY];
  121. // Output only. The sum of taxes on the invoice level regulatory costs, in micros.
  122. int64 regulatory_costs_tax_amount_micros = 23 [(google.api.field_behavior) = OUTPUT_ONLY];
  123. // Output only. The total amount of invoice level regulatory costs, in micros.
  124. int64 regulatory_costs_total_amount_micros = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
  125. // Output only. The pretax subtotal amount, in micros. This equals the
  126. // sum of the AccountBudgetSummary subtotal amounts,
  127. // Invoice.adjustments_subtotal_amount_micros, and
  128. // Invoice.regulatory_costs_subtotal_amount_micros.
  129. // Starting with v6, the Invoice.regulatory_costs_subtotal_amount_micros is no
  130. // longer included.
  131. optional int64 subtotal_amount_micros = 33 [(google.api.field_behavior) = OUTPUT_ONLY];
  132. // Output only. The sum of all taxes on the invoice, in micros. This equals the sum of the
  133. // AccountBudgetSummary tax amounts, plus taxes not associated with a specific
  134. // account budget.
  135. optional int64 tax_amount_micros = 34 [(google.api.field_behavior) = OUTPUT_ONLY];
  136. // Output only. The total amount, in micros. This equals the sum of
  137. // Invoice.subtotal_amount_micros and Invoice.tax_amount_micros.
  138. // Starting with v6, Invoice.regulatory_costs_subtotal_amount_micros is
  139. // also added as it is no longer already included in
  140. // Invoice.tax_amount_micros.
  141. optional int64 total_amount_micros = 35 [(google.api.field_behavior) = OUTPUT_ONLY];
  142. // Output only. The resource name of the original invoice corrected, wrote off, or canceled
  143. // by this invoice, if applicable. If `corrected_invoice` is set,
  144. // `replaced_invoices` will not be set.
  145. // Invoice resource names have the form:
  146. //
  147. // `customers/{customer_id}/invoices/{invoice_id}`
  148. optional string corrected_invoice = 36 [(google.api.field_behavior) = OUTPUT_ONLY];
  149. // Output only. The resource name of the original invoice(s) being rebilled or replaced by
  150. // this invoice, if applicable. There might be multiple replaced invoices due
  151. // to invoice consolidation. The replaced invoices may not belong to the same
  152. // payments account. If `replaced_invoices` is set, `corrected_invoice` will
  153. // not be set.
  154. // Invoice resource names have the form:
  155. //
  156. // `customers/{customer_id}/invoices/{invoice_id}`
  157. repeated string replaced_invoices = 37 [(google.api.field_behavior) = OUTPUT_ONLY];
  158. // Output only. The URL to a PDF copy of the invoice. Users need to pass in their OAuth
  159. // token to request the PDF with this URL.
  160. optional string pdf_url = 38 [(google.api.field_behavior) = OUTPUT_ONLY];
  161. // Output only. The list of summarized account budget information associated with this
  162. // invoice.
  163. repeated AccountBudgetSummary account_budget_summaries = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
  164. }