將帳戶狀態遷移至匯總產品狀態
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
擷取匯總產品統計資料和問題的方式已變更。先前在 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 說明 |
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 。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-08 (世界標準時間)。
[null,null,["上次更新時間:2025-08-08 (世界標準時間)。"],[],[],null,["# Migrate accountstatuses to Aggregate Product Statuses\n\nThe way you retrieve aggregated product statistics and issues has changed. The\nfunctionality previously available in the `accountstatuses` resource in the\nContent API for Shopping is now split into dedicated resources in the Merchant\nAPI. This guide explains how to migrate your integration to use the new\n[`aggregateProductStatuses`](/merchant/api/reference/rest/issueresolution_v1/accounts.aggregateProductStatuses)\nresource.\n\n**Note** : In Merchant API, account-level issues and aggregate product statuses\nare split. Also review our guide to migrate from `accountstatuses` to\n[account issues](/merchant/api/guides/compatibility/migrate-view-issues).\n\nKey differences\n---------------\n\nHere are the key differences between the product status features in Content\nAPI for Shopping and Merchant API:\n\n- **Dedicated resources** : The `accountstatuses` resource from Content API for Shopping is now split. In Merchant API, account-level issues are available through the [`accountissues`](/merchant/api/reference/rest/accounts_v1/accounts.issues) resource, while aggregated product statistics and item-level issues are available through the new [`aggregateProductStatuses`](/merchant/api/reference/rest/issueresolution_v1/accounts.aggregateProductStatuses) resource.\n- **New resource structure** : `AggregateProductStatus` is a new resource that represents the statistics and issues for a specific combination of a reporting context and a country.\n- **Filtering mechanism** : Instead of using query parameters like `destinations` to select data, Merchant API uses a `list` method with a `filter` string to query for specific reporting contexts and countries.\n- **Channel field removal** : The `channel` field is no longer used. This information is now implicitly part of the `reportingContext`.\n\nRequests\n--------\n\nMerchant API uses a `GET` request with a `filter` parameter to retrieve\naggregated product statuses.\n\n`GET\nhttps://merchantapi.googleapis.com/issueresolution/v1/{parent=accounts/*}/aggregateProductStatuses`\n\n### Request URL format\n\n| Request description | Content API for Shopping | Merchant API |\n|-----------------------------------|--------------------------------------------------------------|-------------------------------------------------------------------------|\n| Get product statistics and issues | `GET /content/v2.1/{merchantId}/accountstatuses/{accountId}` | `GET /issueresolution/v1/accounts/{accountId}/aggregateProductStatuses` |\n\nIdentifiers\n-----------\n\nThe way resources are identified has changed to support the new structure.\n\n### Identifier format\n\n| Identifier description | Content API for Shopping | Merchant API |\n|------------------------|-------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Resource Identifier | The resource was identified by `accountId`. Specific data slices were selected with query parameters. | The resource name uniquely identifies the data for a specific reporting context and country: `accounts/{account}/aggregateProductStatuses/{reportingContext}~{country}`. |\n\nMethods\n-------\n\nThe method for retrieving product statuses has been updated to a `list` method\nthat supports filtering.\n\n| Content API for Shopping method | Merchant API method | Availability \\& notes |\n|---------------------------------|---------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `accountstatuses.get` | `aggregateProductStatuses.list` | The `accountstatuses.get` method returned a single resource containing all product statistics. The new `aggregateProductStatuses.list` method returns a list of resources, one for each reporting context and country combination. Use the `filter` parameter to retrieve specific data. For account-level issues, use `accountissues.list`. |\n\nDetailed field changes\n----------------------\n\nThe fields for product statistics and issues have been updated and restructured\nin the new `AggregateProductStatus` resource.\n\n| Content API for Shopping | Merchant API | Description |\n|---------------------------------|---------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| `products` | `aggregate_product_statuses` | The `products` array is replaced by the `aggregate_product_statuses` repeated field in the list response. |\n| `destination` | `reporting_context` | The `destination` field is replaced by `reporting_context`, which specifies the program context for the stats. |\n| `channel` | (no equivalent field) | The `channel` field is removed. This information is now part of the `reporting_context`. |\n| `statistics` | `stats` | The `statistics` object is renamed to `stats`. Field names within are converted to snake_case, for example, `activeCount` is now `active_count`. |\n| `itemLevelIssues.servability` | `item_level_issues.severity` | The `servability` enum is replaced by the `severity` enum to describe the impact of an issue. |\n| `itemLevelIssues.attributeName` | `item_level_issues.attribute` | The field `attributeName` is renamed to `attribute`. |\n| `itemLevelIssues.documentation` | `item_level_issues.documentation_uri` | The field `documentation` is renamed to `documentation_uri`. |\n| `itemLevelIssues.numItems` | `item_level_issues.product_count` | The field `numItems` is renamed to `product_count`. |"]]