rocket
Giới thiệu
Merchant API – API chính thức thay thế cho Content API for Shopping.
add_alert
Lưu ý: Content API for Shopping sẽ ngừng hoạt động từ ngày 18 tháng 8 năm 2026.
ID sản phẩm
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Dưới đây là các loại mã sản phẩm trong Content API for Shopping:
- Mã ưu đãi
offerId
là một chuỗi do người bán gán cho một sản phẩm. Mã nhận dạng này đại diện cho một sản phẩm riêng lẻ.
offerId
là mã duy nhất cho tập hợp các mặt hàng trong cơ sở dữ liệu của Merchant Center và thường là một số tuần tự.
offerId
có thể là một mã SKU nội bộ mà người bán gán cho sản phẩm.
- ID REST
- Mã REST là giá trị nhận dạng duy nhất cho một sản phẩm do Google chỉ định.
- Mã REST là
productId
cho lệnh gọi API REST.
Mã REST được tổng hợp theo định dạng online:en:label:1111111111
. Mã REST bao gồm 4 phần sau, được phân tách bằng dấu hai chấm:
- Kênh ("trực tuyến" hoặc "địa phương")
- Ngôn ngữ của nội dung (sử dụng ký hiệu 2 chữ cái, ví dụ:
en
hoặc fr
)
- Nhãn nguồn cấp dữ liệu (có thể là mã hai chữ cái cho quốc gia mục tiêu của nguồn cấp dữ liệu, ví dụ:
US
hoặc FR
)
- Mã ưu đãi
Bạn đặt các mã này cùng nhau dưới dạng channel:contentLanguage:feedLabel:offerId
, ví dụ: online:en:US:1111111111
.
- Mã người bán bên ngoài (Trang web thương mại)
Trang web thương mại phải chỉ định external_seller_id
cho các mặt hàng đã tải lên tài khoản nhiều người bán. Trường này đại diện cho người bán cá nhân.
Các giá trị external_seller_id
có phân biệt chữ hoa chữ thường và phải đáp ứng các tiêu chí sau:
- Độ dài từ 1 đến 50 ký tự
- Chỉ các ký tự ASCII gồm chữ và số, dấu gạch dưới (_), dấu gạch nối (-), dấu chấm (.) và dấu ngã (~)
Trường này không giống với trường seller_id
nội bộ.
Bảng sau đây tóm tắt một số mã nhận dạng có thể liên kết với một sản phẩm:
Thuộc tính |
Mô tả |
Ví dụ: |
Ghi chú |
offerId |
Mã nhận dạng do người bán gán cho một sản phẩm. |
1111111111 |
Loại dữ liệu chuỗi, giá trị nhận dạng duy nhất cho sản phẩm của sản phẩm. |
ID REST |
Mã nhận dạng do Google gán cho một sản phẩm. Ở định dạng channel:contentLanguage:feedLabel:offerId . |
online:en:label:1111111111 |
Mã đầy đủ bao gồm offerId . |
productId |
Dùng để tham chiếu đến mã REST trong lệnh gọi API. |
online:en:label:1111111111 |
Đây là mã REST của một sản phẩm. |
id |
Có cùng giá trị với mã REST và productId . |
online:en:label:1111111111 |
Dùng bên trong phần nội dung JSON của một sản phẩm để tham chiếu đến productId của sản phẩm đó. |
external_seller_id |
Mã người bán do Thị trường chọn. |
example-Seller1 |
Bắt buộc đối với tài khoản nhiều người bán. Mật khẩu phải dài từ 1 đến 50 ký tự. Phân biệt chữ hoa chữ thường. Chúng tôi chấp nhận chữ số và các ký tự đặc biệt _, -, ., ~.
|
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-13 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-13 UTC."],[[["\u003cp\u003eThe Merchant API is the new version of the Content API for Shopping and represents the future of product data integration with Google.\u003c/p\u003e\n"],["\u003cp\u003eThe beta version of the Merchant API is now available for developers to explore and help shape its future development.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can learn more about the benefits and features of the Merchant API, including how it can enhance integrations, in the official announcement blog post.\u003c/p\u003e\n"],["\u003cp\u003eProducts in the Merchant API are identified using various IDs, such as \u003ccode\u003eofferId\u003c/code\u003e, REST ID, \u003ccode\u003eproductId\u003c/code\u003e, and \u003ccode\u003eexternal_seller_id\u003c/code\u003e, each with specific characteristics and usage contexts.\u003c/p\u003e\n"],["\u003cp\u003eA comprehensive table provides detailed explanations and examples of different product ID attributes, outlining their purpose and format.\u003c/p\u003e\n"]]],["The beta version of the Merchant API, the new Content API for Shopping, is introduced. Merchants assign an `offerId` to products. Google assigns a unique REST ID in the format `channel:contentLanguage:feedLabel:offerId`; this is also the `productId` and `id` in API calls. Marketplaces assign `external_seller_id` to offers for multi-seller accounts, it has specific format requirements. The Merchant API offers integration improvements; details on this and providing feedback are available via a linked article.\n"],null,["# Product IDs\n\nHere are the different kinds of product IDs in the Content API for Shopping:\n\nOffer ID\n: An `offerId` is a string assigned to a product by a merchant. This ID\n represents an individual product.\n: `offerId` is unique to the set of offers in the Merchant Center database, and\n is usually a numeric sequential number.\n: `offerId` can be an internal SKU number that a merchant assigns to the product.\n\nREST ID\n: A REST ID is the unique identifier for a product assigned by Google.\n: REST ID is the `productId` for REST API calls.\n\n: REST IDs are aggregates with the format `online:en:label:1111111111`. The\n REST ID consists of the following 4 parts, separated by colons:\n\n 1. Channel (\"online\" or \"local\")\n 2. Content Language (using the 2-letter designation, for example `en` or `fr`)\n 3. Feed label (might be the two-letter code for the feed's target country, for example `US` or `FR`)\n 4. Offer ID\n\n: You put this together as `channel:contentLanguage:feedLabel:offerId`, for\n example, `online:en:US:1111111111`.\n\nExternal Seller ID (Marketplaces)\n\n: [Marketplaces](//support.google.com/merchants/answer/6363319)\n must assign an `external_seller_id` to offers uploaded to a multi-seller\n account. This field represents an individual seller.\n\n `external_seller_id` values are case-sensitive, and must meet the following\n criteria:\n\n - 1-50 characters in length\n - Only alphanumeric ASCII characters, and underscore (_), hyphen (-), period (.), and tilde (\\~)\n\n This isn't the same as the internal\n [`seller_id`](/shopping-content/reference/rest/v2.1/accounts) field.\n\nThe following table summarizes some of the IDs that can be associated with a\nproduct:\n\n| Attribute | Description | Example | Notes |\n|----------------------|---------------------------------------------------------------------------------------------------|------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|\n| `offerId` | An ID assigned to a product by a merchant. | `1111111111` | String data type, unique identifier for a product's offer. |\n| REST ID | An ID assigned to a product by Google. In the format `channel:contentLanguage:feedLabel:offerId`. | `online:en:label:1111111111` | Full ID including `offerId`. |\n| `productId` | Used to refer to the REST ID in API calls. | `online:en:label:1111111111` | This is the REST ID of a product. |\n| `id` | Same value as REST ID and `productId`. | `online:en:label:1111111111` | Used inside JSON body of a product to refer to its `productId`. |\n| `external_seller_id` | A seller ID chosen by the Marketplace. | `example-Seller1` | Required for multi-seller accounts. Must be 1-50 characters. Case-sensitive. Digits, and special characters _, -, ., and \\~ are accepted. |"]]