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

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

主要差異

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

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

要求

Merchant API 會使用 GET 要求和 filter 參數,擷取匯總的產品狀態。如要進一步瞭解篩選器語法,請參閱「篩選器語法」。

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。