Trạng thái sản phẩm

Bạn có thể sử dụng tài nguyên Product để xem trạng thái chi tiết của các sản phẩm trên Mua sắm.

Với Content API, bạn có thể truy xuất trạng thái sản phẩm bằng cách gọi phương thức ProductStatuses.get. Với Merchant API, bạn có thể truy xuất trạng thái sản phẩm bằng cách truy xuất tài nguyên Accounts.Products.

Bạn có trách nhiệm tuân thủ các chính sách của quảng cáo Mua sắmtrang thông tin miễn phí. Quảng cáo Mua sắm có quyền thực thi các chính sách này và phản hồi một cách thích hợp nếu chúng tôi phát hiện thấy nội dung hoặc hành vi vi phạm các chính sách này.

Yêu cầu

Để xem trạng thái sản phẩm, bạn phải làm như sau:

  • Đăng ký tài khoản của bạn với một đích đến.
  • Cung cấp mã quốc gia hợp lệ ở một trong các thông tin sau:
    • Trường feedLabel.
    • Trường shipping.
    • Ở cấp nguồn cấp dữ liệu.
    • Chế độ cài đặt thông tin vận chuyển trong tài khoản của bạn.

Xem trạng thái của sản phẩm

Truy xuất tài nguyên Accounts.Products để xem trạng thái của một sản phẩm.

Dưới đây là yêu cầu GET mẫu:

GET https://merchantapi.googleapis.com/products/v1beta/{name=accounts/*/products/*}

Tất cả phản hồi của products.get đều có các trường sau:

  • creationDate: Ngày tạo sản phẩm.
  • lastUpdateDate: Lần gần đây nhất sản phẩm được cập nhật.
  • googleExpirationDate: Ngày sản phẩm hết hạn.
  • destinationStatuses: Vị trí xuất hiện dự kiến của sản phẩm.
  • itemLevelIssues: Danh sách tất cả các vấn đề liên quan đến sản phẩm.

Bạn chỉ thấy trường itemLevelIssues trong phản hồi nếu sản phẩm gặp vấn đề ở cấp mặt hàng tại thời điểm bạn yêu cầu.

Dưới đây là phản hồi JSON mẫu:

{
"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"
}

Liệt kê tất cả trạng thái sản phẩm

Sử dụng products.list để xem tất cả sản phẩm và trạng thái của các sản phẩm đó.

Bạn có thể sử dụng các tham số sau để tinh chỉnh truy vấn của mình:

  • pageToken: Dùng để lấy các trang kết quả tiếp theo. Mỗi trang có một nextPageToken mà bạn có thể sử dụng để chuyển sang trang tiếp theo trong trình tự.
  • maxResults: Số kết quả tối đa trên mỗi trang.

Dưới đây là yêu cầu list mẫu với các tham số truy vấn không bắt buộc:

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

Dưới đây là phản hồi JSON mẫu:

{
"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"
  }
]
}

Lệnh gọi productstatuses.list có thể an toàn để kiểm thử trong phiên bản chính thức vì lệnh gọi này không thực hiện bất kỳ thay đổi nào đối với dữ liệu của bạn.

Vấn đề ở cấp mặt hàng

Mỗi vấn đề ở cấp mặt hàng bao gồm các trường sau:

  • code: Mã lỗi của vấn đề.
  • severity: Mức độ nghiêm trọng của vấn đề.
  • resolution: Thông báo xem người bán có thể giải quyết vấn đề hay không.
  • attribute: Tên thuộc tính bị ảnh hưởng.
  • reportingContext: Ngữ cảnh báo cáo có vấn đề.
  • description: Nội dung mô tả vấn đề.
  • detail: Cung cấp thêm thông tin về bài toán.
  • documentation: URL của tài liệu về vấn đề.
  • applicableCountries: Cho biết vấn đề này ảnh hưởng đến sản phẩm ở những quốc gia nào.