عرض إحصاءات المنتج والمشاكل المتعلّقة به

يمكنك استخدام طريقة 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/{ACCOUNT_ID}/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/{ACCOUNT_ID}/products/online~en~US~SKU001",
            "accounts/{ACCOUNT_ID}/products/online~en~US~SKU002"
          ]
        },
        {
          "issueType": "invalid_price",
          "severity": "CRITICAL",
          "numProducts": "10",
          "sampleProducts": [
            "accounts/{ACCOUNT_ID}/products/online~en~US~SKU003"
          ]
        }
      ]
    },
    {
      "name": "accounts/{ACCOUNT_ID}/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/{ACCOUNT_ID}/products/online~en~US~SKU001",
            "accounts/{ACCOUNT_ID}/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/{ACCOUNT_ID}/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/{ACCOUNT_ID}/products/online~en~US~SKU001",
            "accounts/{ACCOUNT_ID}/products/online~en~US~SKU002"
          ]
        },
        {
          "issueType": "invalid_price",
          "severity": "CRITICAL",
          "numProducts": "10",
          "sampleProducts": [
            "accounts/{ACCOUNT_ID}/products/online~en~US~SKU003"
          ]
        }
      ]
    }
  ]
}