Method: customers.invoices.list

傳回當月所有與帳單設定相關的月結單。

擲回錯誤清單:AuthenticationError AuthorizationError FieldError HeaderError InternalError InvoiceError QuotaError RequestError

HTTP 要求

GET https://googleads.googleapis.com/v14/customers/{customerId}/invoices

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
customerId

string

必要欄位。要擷取月結單的客戶 ID。

查詢參數

參數
billingSetup

string

必要欄位。所要求月結單的帳單設定資源名稱。

customers/{customerId}/billingSetups/{billing_setup_id}

issueYear

string

必要欄位。擷取應付憑據的年份,格式為 yyyy。只能擷取 2019 年或之後開立的應付憑據。

issueMonth

enum (MonthOfYear)

必要欄位。用來擷取月結單的月份。

要求主體

要求主體必須為空白。

回應主體

InvoiceService.ListInvoices 的回應訊息。

如果成功,回應主體即會包含具有以下結構的資料:

JSON 表示法
{
  "invoices": [
    {
      object (Invoice)
    }
  ]
}
欄位
invoices[]

object (Invoice)

符合帳單設定和時間範圍的月結單清單。

授權範圍

需要下列 OAuth 範圍:

  • https://www.googleapis.com/auth/adwords

詳情請參閱 OAuth 2.0 總覽

應付憑據

月結單。所有應付憑據資訊均經過快照,以便與 PDF 應付憑據保持一致。如果是 InvoiceService 推出之前的月結單,快照中的資訊可能會與 PDF 月結單上的資訊不一致。

JSON 表示法
{
  "resourceName": string,
  "type": enum (InvoiceType),
  "serviceDateRange": {
    object (DateRange)
  },
  "adjustmentsSubtotalAmountMicros": string,
  "adjustmentsTaxAmountMicros": string,
  "adjustmentsTotalAmountMicros": string,
  "regulatoryCostsSubtotalAmountMicros": string,
  "regulatoryCostsTaxAmountMicros": string,
  "regulatoryCostsTotalAmountMicros": string,
  "replacedInvoices": [
    string
  ],
  "accountBudgetSummaries": [
    {
      object (AccountBudgetSummary)
    }
  ],
  "accountSummaries": [
    {
      object (AccountSummary)
    }
  ],
  "id": string,
  "billingSetup": string,
  "paymentsAccountId": string,
  "paymentsProfileId": string,
  "issueDate": string,
  "dueDate": string,
  "currencyCode": string,
  "exportChargeSubtotalAmountMicros": string,
  "exportChargeTaxAmountMicros": string,
  "exportChargeTotalAmountMicros": string,
  "subtotalAmountMicros": string,
  "taxAmountMicros": string,
  "totalAmountMicros": string,
  "correctedInvoice": string,
  "pdfUrl": string
}
欄位
resourceName

string

僅供輸出。應付憑據的資源名稱。多位客戶可共用一份月結單,因此多個資源名稱可能指向同一份月結單。月結單資源名稱的格式為:

customers/{customerId}/invoices/{invoice_id}

type

enum (InvoiceType)

僅供輸出。月結單類型。

serviceDateRange

object (DateRange)

僅供輸出。這份月結單的服務期間。結束日期未含。

adjustmentsSubtotalAmountMicros

string (int64 format)

僅供輸出。月結單層級調整項的稅前小計金額 (以微秒為單位)。

adjustmentsTaxAmountMicros

string (int64 format)

僅供輸出。月結單層級調整項的稅金總和,以微秒為單位。

adjustmentsTotalAmountMicros

string (int64 format)

僅供輸出。月結單層級的調整項總額,以微量為單位。

regulatoryCostsSubtotalAmountMicros

string (int64 format)

僅供輸出。月結單層級的稅前費用小計,以百萬分之一為單位。

regulatoryCostsTaxAmountMicros

string (int64 format)

僅供輸出。月結單層級規費的稅金總和,以微秒為單位。

regulatoryCostsTotalAmountMicros

string (int64 format)

僅供輸出。月結單層級的監管費用總額,以微量為單位。

replacedInvoices[]

string

僅供輸出。原始應付憑據的資源名稱,該應付憑據要重新收費或由該應付憑據取代(如適用)。由於合併月結單的關係,可能會經過多張已取代的月結單。更換的應付憑據不得隸屬於同一個付款帳戶。如果已設定 replacedInvoices,系統就不會設定 correctedInvoice。月結單資源名稱的格式為:

customers/{customerId}/invoices/{invoice_id}

accountBudgetSummaries[]

object (AccountBudgetSummary)

僅供輸出。與這份月結單相關聯的帳戶預算資訊摘要清單。

accountSummaries[]

object (AccountSummary)

僅供輸出。與此月結單相關聯的帳戶資訊摘要清單。

id

string

僅供輸出。應付憑據的 ID。此名稱會列在應付憑據 PDF 檔案中的「應付憑據號碼」。

billingSetup

string

僅供輸出。這份月結單帳單設定的資源名稱。

customers/{customerId}/billingSetups/{billing_setup_id}

paymentsAccountId

string

僅供輸出。一組 16 位數 ID,用於識別與帳單設定相關聯的付款帳戶,例如「1234-5678-9012-3456」。這組 ID 會列在月結單 PDF 的「帳單帳號」中。

paymentsProfileId

string

僅供輸出。12 位數的 ID,用於識別與帳單設定相關聯的付款資料,例如「1234-5678-9012」。這組 ID 在 PDF 月結單上會顯示為「帳單 ID」。

issueDate

string

僅供輸出。核發日期,格式為 yyyy-mm-dd。這項資訊會列在月結單 PDF 上的「核發日期」或「月結單日期」。

dueDate

string

僅供輸出。截止日,格式為 yyyy-mm-dd。

currencyCode

string

僅供輸出。貨幣代碼。所有費用都會以這個幣別退回。支援部分由 ISO 4217 標準衍生的貨幣代碼。

exportChargeSubtotalAmountMicros

string (int64 format)

僅供輸出。月結單層級匯出費用的稅前小計金額 (以微秒為單位)。

exportChargeTaxAmountMicros

string (int64 format)

僅供輸出。月結單層級匯出費用的稅金總和 (以微秒為單位)。

exportChargeTotalAmountMicros

string (int64 format)

僅供輸出。月結單層級的匯出費用總額 (以百萬分之一為單位)。

subtotalAmountMicros

string (int64 format)

僅供輸出。稅前小計金額,以百萬分之一為單位。這等於 AccountBudgetSummary 小計金額和 Invoice.adjustments_subtotal_amount_micros 的總和。

taxAmountMicros

string (int64 format)

僅供輸出。應付憑據上所有稅金的總和 (以微秒為單位)。等於 AccountBudgetSummary 稅額的總和,加上未與特定帳戶預算相關聯的稅金。

totalAmountMicros

string (int64 format)

僅供輸出。總金額 (以百萬分之一為單位)。這個值等於 Invoice.subtotal_amount_micros、Invoice.tax_amount_micros、Invoice.regulatory_costs_subtotal_amount_micros 和 Invoice.export_charge_subtotal_amount_micros (以 V14.1 開頭的單獨明細項目中)。

correctedInvoice

string

僅供輸出。由這份應付憑據更正、註銷或取消的原始應付憑據資源名稱 (如適用)。如果已設定 correctedInvoice,系統就不會設定 replacedInvoices。月結單資源名稱的格式為:

customers/{customerId}/invoices/{invoice_id}

pdfUrl

string

僅供輸出。應付憑據 PDF 副本的網址。使用者必須傳遞 OAuth 權杖,才能透過這個網址要求 PDF。

InvoiceType

可能的應付憑據類型。

列舉
UNSPECIFIED 未指定。
UNKNOWN 僅適用於傳回值。代表此版本中未知的值。
CREDIT_MEMO 金額為負值的月結單。這個帳戶會收到抵免額。
INVOICE 金額為正的月結單。帳戶餘額不足。

AccountBudgetSummary

代表摘要的帳戶預算可結算費用。

JSON 表示法
{
  "billableActivityDateRange": {
    object (DateRange)
  },
  "invalidActivitySummaries": [
    {
      object (InvalidActivitySummary)
    }
  ],
  "customer": string,
  "customerDescriptiveName": string,
  "accountBudget": string,
  "accountBudgetName": string,
  "purchaseOrderNumber": string,
  "subtotalAmountMicros": string,
  "taxAmountMicros": string,
  "totalAmountMicros": string,
  "servedAmountMicros": string,
  "billedAmountMicros": string,
  "overdeliveryAmountMicros": string,
  "invalidActivityAmountMicros": string
}
欄位
billableActivityDateRange

object (DateRange)

僅供輸出。在這份月結單的服務日期範圍內,帳戶預算的可計費活動日期範圍。結束日期未含。可以與帳戶預算的開始和結束時間不同。

invalidActivitySummaries[]

object (InvalidActivitySummary)

僅供輸出。無效活動抵免額和原始連結的匯總清單。

customer

string

僅供輸出。與這個帳戶預算相關聯的客戶的資源名稱。其中包含客戶 ID (列在 PDF 月結單上,格式為「帳戶 ID」)。客戶資源名稱的格式為:

customers/{customerId}

customerDescriptiveName

string

僅供輸出。帳戶預算顧客的描述性名稱。名稱會顯示在 PDF 應付憑據上,名稱為「帳戶」。

accountBudget

string

僅供輸出。與這份可結算費用摘要相關聯的帳戶預算資源名稱。AccountBudget 資源名稱的格式為:

customers/{customerId}/accountBudgets/{account_budget_id}

accountBudgetName

string

僅供輸出。帳戶預算的名稱。這類金額會顯示在月結單 PDF 中,並標示為「帳戶預算」。

purchaseOrderNumber

string

僅供輸出。帳戶預算的訂購單號碼。此名稱會列在應付憑據 PDF 檔的「訂購單」中。

subtotalAmountMicros

string (int64 format)

僅供輸出。服務期間可計入這筆預算的稅前小計金額 (以微秒為單位)。

taxAmountMicros

string (int64 format)

僅供輸出。服務期間,此預算的稅額 (以百萬分之一表示)。

totalAmountMicros

string (int64 format)

僅供輸出。服務期間,此預算的總金額 (以微秒為單位)。等於帳戶預算小計金額和帳戶預算稅額的總和。

servedAmountMicros

string (int64 format)

僅供輸出。在服務期間,這筆預算的稅前放送金額 (以微秒為單位)。這只適用於核對月結單和寄送資料。

billedAmountMicros

string (int64 format)

僅供輸出。在服務期間,此預算的稅前帳單金額 (以微秒為單位)。這並不會將任何調整項納入考量。

overdeliveryAmountMicros

string (int64 format)

僅供輸出。服務期間,這筆預算的稅前超量放送金額,以微量 (負值) 為單位。

invalidActivityAmountMicros

string (int64 format)

僅供輸出。過去幾個月,這筆預算的稅前無效活動金額,以微量 (負值) 為單位。

InvalidActivitySummary

月結單的無效活動詳細資料,內含需進行修正的月結單的其他詳細資料。

JSON 表示法
{
  "originalMonthOfService": enum (MonthOfYear),
  "originalYearOfService": string,
  "originalInvoiceId": string,
  "originalAccountBudgetName": string,
  "originalPurchaseOrderNumber": string,
  "amountMicros": string
}
欄位
originalMonthOfService

enum (MonthOfYear)

僅供輸出。與這筆無效活動抵免額相關的原始服務月份。

originalYearOfService

string

僅供輸出。與這筆無效活動抵免額相關的原始服務年。

originalInvoiceId

string

僅供輸出。與這筆無效活動抵免額相關的原始應付憑據號碼。

originalAccountBudgetName

string

僅供輸出。與這筆無效活動抵免額相關的原始帳戶預算名稱。

originalPurchaseOrderNumber

string

僅供輸出。與這筆無效活動抵免額相關的原始訂購單號碼。

amountMicros

string (int64 format)

僅供輸出。無效活動金額 (以百萬分之一為單位)。

AccountSummary

代表帳戶層級的摘要資料檢視。

JSON 表示法
{
  "customer": string,
  "billingCorrectionSubtotalAmountMicros": string,
  "billingCorrectionTaxAmountMicros": string,
  "billingCorrectionTotalAmountMicros": string,
  "couponAdjustmentSubtotalAmountMicros": string,
  "couponAdjustmentTaxAmountMicros": string,
  "couponAdjustmentTotalAmountMicros": string,
  "excessCreditAdjustmentSubtotalAmountMicros": string,
  "excessCreditAdjustmentTaxAmountMicros": string,
  "excessCreditAdjustmentTotalAmountMicros": string,
  "regulatoryCostsSubtotalAmountMicros": string,
  "regulatoryCostsTaxAmountMicros": string,
  "regulatoryCostsTotalAmountMicros": string,
  "exportChargeSubtotalAmountMicros": string,
  "exportChargeTaxAmountMicros": string,
  "exportChargeTotalAmountMicros": string,
  "subtotalAmountMicros": string,
  "taxAmountMicros": string,
  "totalAmountMicros": string
}
欄位
customer

string

僅供輸出。與帳戶摘要相關聯的帳戶。

billingCorrectionSubtotalAmountMicros

string (int64 format)

僅供輸出。預付帳單更正小計金額 (以微秒為單位)。

billingCorrectionTaxAmountMicros

string (int64 format)

僅供輸出。帳單更正稅金 (以百萬分之一為單位)。

billingCorrectionTotalAmountMicros

string (int64 format)

僅供輸出。帳單更正總額 (以百萬分之一為單位)。

couponAdjustmentSubtotalAmountMicros

string (int64 format)

僅供輸出。預付優待券調整項小計金額 (以微量為單位)。

couponAdjustmentTaxAmountMicros

string (int64 format)

僅供輸出。優待券調整稅金 (以百萬分之一為單位)。

couponAdjustmentTotalAmountMicros

string (int64 format)

僅供輸出。優待券調整項總額 (以百萬分之一為單位)。

excessCreditAdjustmentSubtotalAmountMicros

string (int64 format)

僅供輸出。稅前超額抵免額調整項小計金額 (以百萬分之一為單位)。

excessCreditAdjustmentTaxAmountMicros

string (int64 format)

僅供輸出。抵免額調整項超額的稅金 (以百萬分之一為單位)。

excessCreditAdjustmentTotalAmountMicros

string (int64 format)

僅供輸出。多餘的抵免額調整項總額 (以百萬分之一為單位)。

regulatoryCostsSubtotalAmountMicros

string (int64 format)

僅供輸出。稅前法規費用小計金額 (以微秒為單位)。

regulatoryCostsTaxAmountMicros

string (int64 format)

僅供輸出。規費稅金 (以百萬分之一為單位)。

regulatoryCostsTotalAmountMicros

string (int64 format)

僅供輸出。規費總額 (以百萬分之一為單位)。

exportChargeSubtotalAmountMicros

string (int64 format)

僅供輸出。稅前出口費用小計金額 (以微秒為單位)。

exportChargeTaxAmountMicros

string (int64 format)

僅供輸出。出口費用稅金 (以百萬分之一為單位)。

exportChargeTotalAmountMicros

string (int64 format)

僅供輸出。匯出費用總額 (以百萬分之一為單位)。

subtotalAmountMicros

string (int64 format)

僅供輸出。服務期間,可計入帳戶的稅前小計金額 (以微秒為單位)。

taxAmountMicros

string (int64 format)

僅供輸出。服務期間,帳戶的應收總額 (以百萬分之一表示)。

totalAmountMicros

string (int64 format)

僅供輸出。服務期間可計入帳戶的總金額 (以百萬分之一為單位)。等於小計 AmountMicros 和 taxAmountMicros 的總和。