检索商品状态

您可以使用 accounts.products 资源查看购物产品的详细状态。

如果您使用 Content API for Shopping 添加商品,请参阅迁移指南,了解如何开始使用 Merchant Products API。

您有责任遵守购物广告非付费商品详情政策。如果我们发现违反这些政策的内容或行为,Google 购物广告保留强制执行这些政策的权利,并会做出适当的回应。

要求

如需查看商品状态,您必须执行以下操作:

  • 为您的账号注册计划
  • 请提供以下任一国家/地区的有效国家/地区代码(商品将面向所提供国家/地区的联合体销售):

获取商品的状态

检索 accounts.products 资源以查看商品的状态。

以下是一个示例 GET 请求:

GET https://merchantapi.googleapis.com/products/v1beta/accounts/ACCOUNT_ID/products/PRODUCT_ID

来自 products.get 的所有响应都包含 ProductStatus 消息,其中包含以下字段:

  • creationDate:商品的创建日期。
  • lastUpdateDate:商品的上次更新时间。
  • googleExpirationDate:商品的到期日期。
  • destinationStatuses:商品的预期目标国家/地区以及每个目标国家/地区的状态。
  • itemLevelIssues:与商品相关的所有问题的列表。

只有在您发出请求时商品存在商品级问题时,响应中才会显示 itemLevelIssues 字段。

JSON 响应示例如下:

{
"name": "accounts/123/products/online~en~US~1",
"channel": "ONLINE",
"offerId": "1",
"contentLanguage": "en",
"feedLabel": "US",
"dataSource": "accounts/123/dataSources/456",
"attributes": {
  "title": "Color Headphones",
  "description": "A light and elegant design and super sound quality make these over-ear headphones a constant companion. Foldable to save space, and printed with the white Google logo on one earpiece.",
  "imageLink": "http://tmp53317.purecake.com/images/headphones.jpg",
  "availability": "in stock",
  "brand": "Google",
  "condition": "new",
  "googleProductCategory": "Electronics \u003e Audio \u003e Audio Components \u003e Headphones",
  "gtin": "00050644632143",
  "mpn": "90000007101",
  "price": {
    "amountMicros": "288000",
    "currencyCode": "USD"
  }
},
"productStatus": {
  "destinationStatuses": [
    {
      "reportingContext": "FREE_LISTINGS",
      "disapprovedCountries": [
        "US"
      ]
    }
  ],
  "itemLevelIssues": [
    {
      "code": "pending_phone_verification",
      "severity": "NOT_IMPACTED",
      "resolution": "merchant_action",
      "reportingContext": "FREE_LISTINGS",
      "description": "Unverified phone number",
      "detail": "Go to the Business information page to verify your business phone number",
      "documentation": "https://support.google.com/merchants/answer/10139041",
      "applicableCountries": [
        "US"
      ]
    },
    {
      "code": "pending_initial_policy_review_free_listings",
      "severity": "DISAPPROVED",
      "resolution": "pending_processing",
      "reportingContext": "FREE_LISTINGS",
      "description": "Pending initial review",
      "detail": "Please wait up to 3 business days for the review to be completed",
      "documentation": "https://support.google.com/merchants/answer/2948694",
      "applicableCountries": [
        "US"
      ]
    },
    {
      "code": "url_does_not_match_homepage",
      "severity": "DISAPPROVED",
      "resolution": "merchant_action",
      "attribute": "link",
      "reportingContext": "FREE_LISTINGS",
      "description": "Mismatched domains [link]",
      "detail": "Use the same domain for product landing page URLs as in your Merchant Center website setting",
      "documentation": "https://support.google.com/merchants/answer/160050",
      "applicableCountries": [
        "US"
      ]
    }
  ],
  "creationDate": "2024-05-27T16:15:31.791730Z",
  "lastUpdateDate": "2024-05-27T16:15:31.791730Z",
  "googleExpirationDate": "2024-06-26T16:15:31.791730Z"
}

检索所有未获批准的商品

如需检索所有被拒批或不符合条件的商品,请使用以下 accounts.reports.search 请求:

POST https://merchantapi.googleapis.com/reports/v1beta/accounts/{ACCOUNT_ID}/reports:search

{
  "query": "SELECT id,offer_id,feed_label,title FROM product_view WHERE aggregated_reporting_context_status = 'NOT_ELIGIBLE_OR_DISAPPROVED'"
}

如需详细了解如何使用 Merchant Reports API 过滤和检索商品,请参阅评估商品

检索所有待审核的商品

如需检索所有待审核商品,请使用以下请求:

POST https://merchantapi.googleapis.com/reports/v1beta/accounts/{ACCOUNT_ID}/reports:search

{
  "query": "SELECT id,offer_id,feed_label,title FROM product_view WHERE aggregated_reporting_context_status = 'PENDING'"
}

列出所有商品状态

使用 products.list 查看您的所有商品及其状态。

您可以使用以下参数来优化查询:

  • pageToken:用于获取后续页面的结果。每个页面都有一个 nextPageToken,您可以使用它来获取序列中的下一页。
  • maxResults:每页的结果数上限。

以下是包含可选查询参数的 list 请求示例:

GET https://merchantapi.googleapis.com/products/v1beta/{PARENT}/products?maxResults=1&pageToken=5108b52782905aa9

JSON 响应示例如下:

{
"nextPageToken": "632fd090c95712c6",
"products": [
 {
  "name": "accounts/123/products/online~en~US~1",
  "channel": "ONLINE",
  "offerId": "1",
  "contentLanguage": "en",
  "feedLabel": "US",
  "dataSource": "accounts/123/dataSources/10355371287",
  "attributes": {
    "title": "Color Headphones",
    "description": "A light and elegant design and super sound quality make these over-ear headphones a constant companion. Foldable to save space, and printed with the white Google logo on one earpiece.",
    "imageLink": "http://tmp53317.purecake.com/images/headphones.jpg",
    "availability": "in stock",
    "brand": "Google",
    "condition": "new",
    "googleProductCategory": "Electronics \u003e Audio \u003e Audio Components \u003e Headphones",
    "gtin": "00050644632143",
    "mpn": "90000007101",
    "price": {
      "amountMicros": "28800000",
      "currencyCode": "USD"
    }
  },
  "productStatus": {
    "destinationStatuses": [
      {
        "reportingContext": "FREE_LISTINGS",
        "disapprovedCountries": [
          "US"
        ]
      }
    ],
    "itemLevelIssues": [
      {
        "code": "pending_phone_verification",
        "severity": "NOT_IMPACTED",
        "resolution": "merchant_action",
        "reportingContext": "FREE_LISTINGS",
        "description": "Unverified phone number",
        "detail": "Go to the Business information page to verify your business phone number",
        "documentation": "https://support.google.com/merchants/answer/10139041",
        "applicableCountries": [
          "US"
        ]
      },
      {
        "code": "pending_initial_policy_review_free_listings",
        "severity": "DISAPPROVED",
        "resolution": "pending_processing",
        "reportingContext": "FREE_LISTINGS",
        "description": "Pending initial review",
        "detail": "Please wait up to 3 business days for the review to be completed",
        "documentation": "https://support.google.com/merchants/answer/2948694",
        "applicableCountries": [
          "US"
        ]
      },
      {
        "code": "url_does_not_match_homepage",
        "severity": "DISAPPROVED",
        "resolution": "merchant_action",
        "attribute": "link",
        "reportingContext": "FREE_LISTINGS",
        "description": "Mismatched domains [link]",
        "detail": "Use the same domain for product landing page URLs as in your Merchant Center website setting",
        "documentation": "https://support.google.com/merchants/answer/160050",
        "applicableCountries": [
          "US"
        ]
      }
    ],
    "creationDate": "2024-05-27T16:15:31.791730Z",
    "lastUpdateDate": "2024-05-27T16:15:31.791730Z",
    "googleExpirationDate": "2024-06-26T16:15:31.791730Z"
  }
]
}

在生产环境中测试 productstatuses.list 调用是安全的,因为它不会对您的数据进行任何更改。

商品级问题

每个商品级问题都包含以下字段:

  • code:问题的错误代码。
  • severity:问题的严重程度。
  • resolution:通知商家是否可以解决问题。
  • attribute:受影响的属性名称。
  • reportingContext:问题适用的报告上下文。
  • description:问题说明。
  • detail:提供有关问题的更多信息。
  • documentation:与问题相关的文档的网址。
  • applicableCountries:指明问题会影响哪些国家/地区的商品。