您可以使用 Merchant API 以编程方式上传和管理商品。借助 accounts.products 资源,您可以创建网店目录,即商品和优惠列表。如需详细了解如何使用 Merchant API 上传和管理商品,请参阅 Merchant Products API 概览。
以下是 Content API for Shopping 与 Merchant Products API 的示例比较:
|
Content API for Shopping |
Merchant Products API |
说明 |
网址 |
https://shoppingcontent.googleapis.com/content/v2.1/ {merchantId}/products/
|
https://merchantapi.googleapis.com/products/v1beta/ {parent}/productInputs:insert
|
Merchant API 请求网址中的 {parent} 变量表示帐号的唯一标识符。 |
标识符 |
{id} |
{name} |
|
方法
下面对比了 Content API for Shopping 和 Merchant Products API 中的“商品”方法:
方法 |
Content API for Shopping |
Merchant Products API |
customBatch |
是 |
不支持 |
insert |
是 |
是 |
get |
是 |
是 |
update |
是 |
不详 |
delete |
是 |
是 |
list |
是 |
是 |
以下是 Content API for Shopping 和 Merchant Products API 的 GET
方法的示例比较:
Content API for Shopping |
商家 API |
GET https://shoppingcontent.googleapis.com/content/v2.1/ {accountId}/products/ {productId} |
GET https://merchantapi.googleapis.com/products/v1beta/ {name=accounts/*/products/*} |
请求
方法 |
Content API for Shopping 中的网址 |
Merchant Products API 中的网址 |
Content API 中的标识符 |
Merchant Products API 中的标识符 |
insert |
POST https://shoppingcontent.googleapis.com/content/v2.1/ {merchantId}/products |
POST https://merchantapi.googleapis.com/products/v1beta/ {parent}/productsInputs:insert?dataSource={dataSourceName} |
{merchantId} |
{parent} |
update |
PATCH https://shoppingcontent.googleapis.com/content/v2.1/ {merchantId}/products/ {productId} |
不详 |
|
|
delete |
DELETE https://shoppingcontent.googleapis.com/content/v2.1/ {merchantId}/products/ {productId} |
DELETE https://merchantapi.googleapis.com/products/v1beta/{name=accounts/*/productInputs/*}?dataSource={dataSourceName} |
{merchantId}/datafeeds/ {productId} |
{name=accounts/*/productInputs/*} |
get |
GET https://shoppingcontent.googleapis.com/content/v2.1/ {merchantId}/products/ {productId} |
GET https://merchantapi.googleapis.com/products/v1beta/{name=accounts/*/products/*} |
{merchantId}/datafeeds/ {productId} |
{name=accounts/*/products/*} |
list |
GET https://shoppingcontent.googleapis.com/content/v2.1/ {merchantId}/products |
GET https://merchantapi.googleapis.com/products/v1beta/ {parent=accounts/*}/products |
{merchantId} |
{parent=accounts/*} |
资源
Content API for Shopping |
Merchant Products API |
说明 |
|
|
Content API for Shopping 中 Product 资源中的多个字段已移至 Merchant Products API 中 ProductInput 资源的 Attribute 字段下。 |