查看產品統計資料和問題

你可以使用 aggregateProductStatuses.list 方法,取得 Merchant Center 帳戶中產品狀態的高階總覽。這項功能有助於監控產品資料的整體健康狀態,不必擷取每項產品的資料。這個方法會提供產品總數,並依狀態 (已核准、待處理、已拒登) 細分,也會列出影響產品的任何問題。

特殊注意事項

使用 aggregateProductStatuses.list 方法時,請特別留意以下事項。

  • 資料可用性:插入或更新產品後,系統可能需要超過 30 分鐘,才會在 aggregateProductStatuses 回應中反映產品狀態。
  • 問題一致性aggregateProductStatuses.list 方法傳回的問題標題和說明,應與 Products API 傳回的問題一致。不過,這些說明可能與 Merchant Center 使用者介面中顯示的問題說明不同。

查看所有產品狀態的總覽

這個範例說明如何擷取 AggregateProductStatus 資源清單。每個資源代表特定目的地和國家/地區組合的產品狀態。呼叫 aggregateProductStatuses.list 不含任何參數,會傳回帳戶的所有可用狀態。

GET https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/aggregateProductStatuses

以下是成功呼叫的回應範例:

{
  "aggregateProductStatuses": [
    {
      "name": "accounts/12345/aggregateProductStatuses/SHOPPING_ADS~US",
      "reportingContext": "SHOPPING_ADS",
      "countryCode": "US",
      "statistics": {
        "approvedCount": "1500",
        "pendingCount": "50",
        "disapprovedCount": "25"
      },
      "issues": [
        {
          "issueType": "missing_image",
          "severity": "ERROR",
          "numProducts": "15",
          "sampleProducts": [
            "accounts/12345/products/online~en~US~SKU001",
            "accounts/12345/products/online~en~US~SKU002"
          ]
        },
        {
          "issueType": "invalid_price",
          "severity": "CRITICAL",
          "numProducts": "10",
          "sampleProducts": [
            "accounts/12345/products/online~en~US~SKU003"
          ]
        }
      ]
    },
    {
      "name": "accounts/12345/aggregateProductStatuses/FREE_LISTINGS~US",
      "reportingContext": "FREE_LISTINGS",
      "countryCode": "US",
      "statistics": {
        "approvedCount": "1510",
        "pendingCount": "50",
        "disapprovedCount": "15"
      },
      "issues": [
        {
          "issueType": "missing_image",
          "severity": "ERROR",
          "numProducts": "15",
          "sampleProducts": [
            "accounts/12345/products/online~en~US~SKU001",
            "accounts/12345/products/online~en~US~SKU002"
          ]
        }
      ]
    }
  ]
}

取得特定國家/地區和目的地的產品狀態

您可以使用 filter 查詢參數和 aggregateProductStatuses.list 方法,篩選結果,查看特定國家/地區和目的地的狀態。例如:country = "US" AND reportingContext = "SHOPPING_ADS"。詳情請參閱篩選語法

GET https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/aggregateProductStatuses?filter=countryCode%3D"US"%20AND%20reportingContext%3D"SHOPPING_ADS"

以下是成功呼叫的回應範例:

{
  "aggregateProductStatuses": [
    {
      "name": "accounts/12345/aggregateProductStatuses/SHOPPING_ADS~US",
      "reportingContext": "SHOPPING_ADS",
      "countryCode": "US",
      "statistics": {
        "approvedCount": "1500",
        "pendingCount": "50",
        "disapprovedCount": "25"
      },
      "issues": [
        {
          "issueType": "missing_image",
          "severity": "ERROR",
          "numProducts": "15",
          "sampleProducts": [
            "accounts/12345/products/online~en~US~SKU001",
            "accounts/12345/products/online~en~US~SKU002"
          ]
        },
        {
          "issueType": "invalid_price",
          "severity": "CRITICAL",
          "numProducts": "10",
          "sampleProducts": [
            "accounts/12345/products/online~en~US~SKU003"
          ]
        }
      ]
    }
  ]
}