invoice.proto 9.9 KB

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