从 Content API for Shopping 迁移配送设置

如需使用 Merchant API 读取配送设置信息,请使用以下请求:

GET https://merchantapi.googleapis.com/accounts/v1beta/accounts/{accountId}/shippingSettings

{accountId} 替换为您的 Merchant Center 帐号的唯一标识符。

如需使用 Merchant API 读取配送设置信息,请使用以下请求:

POST https://merchantapi.googleapis.com/accounts/v1beta/accounts/{accountId}/shippingSettings:insert

Content API for Shopping 与 Merchant API 对比

以下是 Content API for Shopping 与 Merchant Shipping settings API 的对比示例:

Content API 商家 API
网址 https://shoppingcontent.googleapis.com/content/v2.1/{accountId}/shippingsettings:insert https://merchantapi.googleapis.com/accounts/v1beta/accounts/{accountId}/shippingSettings:insert
标识符 {accountId}/shippingsettings/{accountId} {name}

以下列表列出了与 Content API for Shopping 相比,Merchant Shipping settings API 的主要更新:

  1. Merchant API 用户必须在 {name} 字段中输入 accounts/{accountId}/shippingSettings,才能具有相同的行为。
  2. Merchant API 不支持对自定义区域(例如营业地点组)执行读写操作。只能使用地区服务读取或写入营业地点组等自定义区域。
  3. Merchant API 设置 WarehouseBasedDeliveryTime 的方式与 Content API for Shopping 不同。如果您使用的是 Merchant API,则必须在 shippingsettings.warehouses 下定义仓库信息。然后,每项配送服务都可以通过 warehouseBaseDeliveryTime 下的仓库名称引用仓库。
  4. Merchant API 中的一项服务支持多个送货国家/地区。

新增支持的字段

与 Content API for Shopping 相比,Merchant Shipping settings API 支持以下新字段:

  1. 仓库:提供有关履单仓库的信息,该仓库用于存储和处理商品目录。
  2. 会员回馈活动:Merchant API 用户可以在其配送设置中输入会员回馈活动信息。
  3. Etag:Etag 旨在解决不同用户尝试同时使用 Merchant API 和 Merchant Center 界面更新配送设置时出现的异步问题。

重命名的字段

Merchant API 中已重命名以下字段:

Content API for Shopping Merchant Shipping settings API 说明
service services 一项配送服务。
service.name services.serviceName 服务的名称(自由格式),在您的 Merchant Center 账号中必须是唯一的。
service.deliveryCountry services.deliveryCountries 配送服务适用的国家/地区的 CLDR 地区代码。
service.currency services.currencyCode 此服务适用的货币的 CLDR 代码。
service.deliveryTime.minTransitTimeInDays services.deliveryTime.minTransitDays 订单在运送途中花费的最短工作日数。例如,0 表示当天送达,1 表示次日送达。
service.deliveryTime.maxTransitTimeInDays services.deliveryTime.maxTransitDays 订单在运送途中花费的工作日数上限。
service.deliveryTime.minHandlingTimeInDays services.deliveryTime.minHandlingDays 订单发货前至少花费的工作日天数。
service.deliveryTime.maxHandlingTimeInDays services.deliveryTime.maxHandlingDays 订单发货前所需的最长工作日天数。
service.deliveryTime.cutoffTime.timezone services.deliveryTime.cutoffTime.timeZone 截止时间的时区标识符。
service.deliveryTime.transitTimeTable.postalCodeGroupName services.deliveryTime.transitTimeTable.postalCodeGroupNames 邮政编码组的名称。
service.deliveryTime.transitTimeTable.transitTimeLabel services.deliveryTime.transitTimeTable.transitTimeLabel 商品的运送时间标签。
service.rate_group services.rateGroups 配送费率组定义。
service.rate_group.subtable services.rateGroups.subtables 子表格列表。
service.rate_group.carrier_rate services.rateGroups.carrierRates 运输公司费率列表。
service.minimumOrderValueTable.storeCodeSetWithMovs services.minimumOrderValueTable.storeCodeSetWithMovs 一组具有相同最低订单价值的商店代码集。

已废弃的方法

您不能使用 shippingsettings.custombatch 在单个请求中检索和更新多个帐号的运费设置。

已弃用的字段

Merchant API 中已弃用以下字段。请注意,Merchant API 没有为这些字段提供任何替代字段。

Content API for Shopping 商家 API
postal_code_group region
service
  • Pickup_service
    • Eligibility
    • Scheduling_channel
    • Delivery_time
      • Holiday_cutoff
      • Min_scheduling_time_in_days
      • Max_scheduling_time_in_days
      • Scheduling_business_day_config
    • Rate_group
    • |servicePickup_service - Eligibility - Scheduling_channel - Delivery_time - Holiday_cutoff - Min_scheduling_time_in_days - Max_scheduling_time_in_days - Scheduling_business_day_config - Rate_group - single_value_alternative_list

      方法

      以下是 Content API for Shopping 和 Merchant Shipping settings API 中方法的对比:

      方法 Content API for Shopping 商家 API
      customBatch 不支持
      get
      update 不支持
      insert 不支持
      getSupportedCarrier 不支持
      getSupportedHolidays 不支持