將帳戶狀態遷移至匯總產品狀態

擷取匯總產品統計資料和問題的方式已變更。先前在 Shopping Content API 的 accountstatuses 資源中提供的功能,現在已拆分為 Merchant API 中的專屬資源。本指南說明如何遷移整合項目,改用新的 aggregateProductStatuses 資源。

注意:在 Merchant API 中,帳戶層級問題和匯總產品狀態會分開。此外,請參閱accountstatuses遷移至帳戶問題的指南。

主要差異

以下是 Content API for Shopping 和 Merchant API 產品狀態功能的主要差異:

  • 專屬資源:Content API for Shopping 的 accountstatuses 資源現在已分割。在 Merchant API 中,帳戶層級問題可透過 accountissues 資源取得,而匯總產品統計資料和項目層級問題則可透過新的 aggregateProductStatuses 資源取得。
  • 新資源結構AggregateProductStatus 是新資源,代表特定組合的報表內容和國家/地區的統計資料和問題。
  • 篩選機制:Merchant API 會使用 list 方法和 filter 字串,查詢特定報表內容和國家/地區,而不是使用 destinations 等查詢參數選取資料。
  • 移除管道欄位:系統不再使用 channel 欄位。這項資訊現在已隱含在 reportingContext 中。

要求

Merchant API 會使用含有 filter 參數的 GET 要求,擷取匯總的產品狀態。

GET https://merchantapi.googleapis.com/issueresolution/v1/{parent=accounts/*}/aggregateProductStatuses

要求網址格式

要求說明 Content API for Shopping Merchant API
取得產品統計資料和問題 GET /content/v2.1/{merchantId}/accountstatuses/{accountId} GET /issueresolution/v1/accounts/{accountId}/aggregateProductStatuses

ID

為支援新結構,資源的識別方式已有所變更。

ID 格式

ID 說明 Content API for Shopping Merchant API
資源 ID 資源是由 accountId 識別。使用查詢參數選取特定資料切片。 資源名稱會針對特定報表情境和國家/地區,以 accounts/{account}/aggregateProductStatuses/{reportingContext}~{country} 形式提供專屬資料。

方法

擷取產品狀態的方法已更新為支援篩選的 list 方法。

Content API for Shopping 方法 Merchant API 方法 適用情形和注意事項
accountstatuses.get aggregateProductStatuses.list accountstatuses.get 方法會傳回包含所有產品統計資料的單一資源。新的 aggregateProductStatuses.list 方法會傳回資源清單,每個報表內容和國家/地區組合各有一項資源。使用 filter 參數擷取特定資料。如果是帳戶層級問題,請使用 accountissues.list

詳細欄位變更

新版 AggregateProductStatus 資源已更新並重新架構產品統計資料和問題的欄位。

Content API for Shopping Merchant API 說明
products aggregate_product_statuses 清單回應中的 products 陣列會由 aggregate_product_statuses 重複欄位取代。
destination reporting_context destination 欄位會替換為 reporting_context,用於指定統計資料的程式內容。
channel (無對等欄位) channel」欄位已移除,這項資訊現在是「reporting_context」的一部分。
statistics stats statistics 物件已重新命名為 stats。其中的欄位名稱會轉換為 snake_case,例如 activeCount 現在是 active_count
itemLevelIssues.servability item_level_issues.severity servability 列舉會由 severity 列舉取代,用來描述問題的影響。
itemLevelIssues.attributeName item_level_issues.attribute 欄位 attributeName 已重新命名為 attribute
itemLevelIssues.documentation item_level_issues.documentation_uri 欄位 documentation 已重新命名為 documentation_uri
itemLevelIssues.numItems item_level_issues.product_count 欄位 numItems 已重新命名為 product_count