从 Content API for Shopping 迁移产品目录管理系统

您可以使用 Merchant API 管理本地(实体店)和地区性商品目录。

请求数

对于商品目录子 API,请使用以下请求网址格式:

POST https://merchantapi.googleapis.com/inventories/v1beta/{parent}/regionalInventories

在 Merchant API 中,Inventories 子 API 和相关端点称为复数“inventories”。

以下示例比较了 Content API for Shopping 与 Merchant Inventories API 分别适用于本地商品目录请求:

Content API 商家 API
网址 https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/products/{productId}/localinventory https://merchantapi.googleapis.com/inventories/v1beta/{parent}/localInventories
标识符 {merchantId}/products/{productId} {name}

方法

Merchant API 引入了两种新的产品目录管理方法:

  • 列出商品的本地商品目录和地区商品目录
  • 从商品中移除本地商品目录和地区商品目录

以下是 Content API for Shopping 和 Merchant Inventories API 中的商品目录方法对比:

方法 Content API for Shopping 商家 API
customBatch
insert
list
delete

本地商品目录

Merchant Inventories API 中的本地商品目录发生了以下变化:

Content API for Shopping Merchant API 说明
不支持 name:string 添加了新字段,用于区分 product 中的 LocalInventory 资源。Content API for Shopping 按 storeCodeproductId 识别本地商品目录。
不支持 account:string 添加了新字段,用于标识 productLocalInventory 所属的商家帐号。
price: {

object (Price)

}

price: {

object (Price)

}

Price 的定义已更改。
salePrice: {

object (Price)

}

salePrice: {

object (Price)

}

Price 的定义已更改。
salePriceEffectiveDate: string salePriceEffectiveDate: {

object (TimePeriod)

},

salePriceEffectiveDate 使用 Merchant Inventories API 中的新 TimePeriod 类型。
quantity:string, quantity:integer 在 Merchant Inventories API 中,quantity 接受整数而不是字符串。
kind:string 不支持 Merchant Inventories API 不支持 kind
不支持 localShippingLabel:string 在 Merchant Inventories API 中添加了用于为本地配送服务加标签的新字段。

地区商品目录

Merchant Inventories API 中地区性商品目录的变化如下:

Content API for Shopping Merchant API 说明
不支持 name:string 添加了新字段,用于区分 product 中的 regionalInventory 资源。Content API for Shopping 按 regionIdproductId 识别地区商品目录。
不支持 account:string 添加了新字段,用于标识 productregionalInventory 所属的商家帐号。
"regionId": string "region": string regionID 在 Merchant Inventories API 中称为 region
price: {

object (Price)

}

price: {

object (Price)

}

Price 的定义已更改。
salePrice: {

object (Price)

}

salePrice: {

object (Price)

}

Price 的定义已更改。
salePriceEffectiveDate: string salePriceEffectiveDate: {

object (TimePeriod)

},

salePriceEffectiveDate 使用 Merchant Inventories API 中的新 TimePeriod 类型。
kind:string 不支持 Merchant Inventories API 不支持 kind