将 accountstatuses 迁移到汇总商品状态
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
您检索汇总商品统计信息和问题的方式已发生变化。之前在 Content API for Shopping 的 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 不使用
destinations
等查询参数来选择数据,而是使用 list
方法和 filter
字符串来查询特定报告背景信息和国家/地区。
- 移除渠道字段:不再使用
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 |
标识符
资源标识方式已更改,以支持新结构。
标识符说明 |
Content API for Shopping |
Merchant API |
资源标识符 |
资源由 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 。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-08。
[null,null,["最后更新时间 (UTC):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`. |"]]