迁移促销活动管理

您可以使用 MerchantPromotion API 在 Google 上创建和管理促销活动。借助 accounts.promotions 资源,您可以展示在 Google 上销售的商品的特别优惠。如需了解详情,请参阅 MerchantPromotion API 概览

请求

如需发出请求,请使用以下网址。

POST https://merchantapi.googleapis.com/promotions/v1beta/{account_name}/promotions

从 Content API for Shopping 迁移

下文比较了用于购物的 Content API 与用于促销相关请求的 MerchantPromotion API。

网址

在 Content API for Shopping 中:

https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/promotions

转换为:

https://merchantapi.googleapis.com/promotions/v1beta/{parent=accounts/*}/promotions

标识符

在 Content API for Shopping 中:

{merchantId}/promotions/{promotionId}

转换为:

{name}

方法

Merchant API 支持以下促销方法:

  • 插入促销信息
  • 获取促销优惠
  • 列出促销信息

下面对比了 Content API for Shopping 和 Merchant API 中促销方式的可用性:

方法 Content API for Shopping 商家 API
插入
获取
列表
customBatch
删除 (待定)

资源名称

下表显示了 MerchantPromotion API 中促销活动功能的变化。

如需查看参考示例,请参阅本地商品目录

Content API for Shopping 商家 API 说明
(不支持) custom_attributes 自定义(商家提供的)属性列表。
您也可以使用它以通用形式提交 Feed
规范的任何属性。
例如:
{
  "name": "size type", "value": "regular"
}
这对于提交 API 未明确
提供的属性非常有用。
不支持 data_source 创建促销活动需要使用现有的数据源。
不支持 属性 促销专用属性(例如
long_tilepromotion_effective_timeperiod
及其他)是属性消息的一部分。
item_id item_id_inclusion 对促销活动适用的商品 ID 列表
进行了重命名。
store_id store_id_inclusion 对促销活动适用的
的商店 ID 列表进行了重命名。
prduct_type product_type_inclusion 对促销活动适用的
商品类型列表进行了重命名。
item_group_id item_group_id_inclusion 对促销活动适用的
的商品组 ID 列表进行了重命名。
brand brand_inclusion 对促销活动适用的
品牌列表进行了重命名。
store_code store_codes_inclusion 对促销活动适用的
商店代码列表进行了重命名。
price: {
  object (Price)
}
price: {
  object (Price)
}
Price 的定义发生了变化。

在 Content API for Shopping 中,Price
是一个字符串形式的十进制数字。

Price 金额现在以微单位记录,
,其中 100 万微单位相当于您所用币种的
标准单位。

amount 字段名称已从值更改为
amountMicros

currency 字段名称已更改为
currencyCode。仍采用
ISO 4217 格式。(维基百科)

order_limit (不支持) 不支持 order_limit 属性。
shippingServiceNames[]] (不支持) shippingServiceNames[] 不受支持。
money_budget (不支持) money_budget
promotion_destination_ids promotion_destinations promotionDestinationIds 已重命名。
促销活动状态
{
  "destinationStatuses": [
    {
      "destination": string,
      "status": enum (State)
    }
  ],
  "promotionIssue": [
    {
    "code": string,
    "detail": string
    }
  ],
  "creationDate": string,
  "lastUpdateDate": string
}
促销状态已更改。
如需了解更精细的详细信息,请参阅这些问题。
promotionStatus = {
  destinationStatuses = [
     {
     reportingContext = Enum
     status = Enum
     },
  ],
  itemLevelIssues = [
    {
    code = String
    severity = Enum
    resolution = String
    reportingContext = Enum
    description = String
    detail = String
    documentation = String applicableCountries = [
      String,
    ]
    }
  ]
}