Method: customers.invoices.list

傳回在特定月份中,與帳單設定相關的所有月結單。

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

HTTP 要求

GET https://googleads.googleapis.com/v16/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」。這筆金額會列在應付憑據的 PDF 中,並顯示為「帳單帳號」。

paymentsProfileId

string

僅供輸出。12 位數的 ID,用來識別與帳單設定相關聯的付款資料,例如「1234-5678-9012」。這筆費用會列在應付憑據的 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 (以「帳戶 ID」的形式在應付憑據 PDF 上顯示)。客戶資源名稱的格式如下:

customers/{customerId}

customerDescriptiveName

string

僅供輸出。帳戶預算客戶的描述性名稱。這筆金額會顯示在應付憑據的 PDF 中,並標示為「帳戶」。

accountBudget

string

僅供輸出。與這筆匯總可結算費用相關聯的帳戶預算資源名稱。AccountBudget 資源名稱的格式如下:

customers/{customerId}/accountBudgets/{account_budget_id}

accountBudgetName

string

僅供輸出。帳戶預算的名稱。月結單的 PDF 版本會顯示為「帳戶預算」。

purchaseOrderNumber

string

僅供輸出。帳戶預算的訂購單號碼。這筆金額會是「訂購單」。

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)

僅供輸出。服務期間內,可歸因於帳戶的總金額 (以百萬分之一為單位)。這等於小 totalAmountMicros 和 taxAmountMicros 的總和。