准备 Merchant Center 账号

您必须拥有信誉良好的 Merchant Center 账号,并且账号中包含已获批的非付费商品详情。如需开始使用,请参阅以下帮助中心文章:

在您设置好包含商品的 Merchant Center 后,必须先完成本部分中的要求,然后才能构建 API 集成。

1. Merchant Center 设置

确保您的 Google Merchant Center 账号中已配置以下设置:

1.1. 退货政策

您必须在 Merchant Center 中定义退货政策,因为这是记录在案的商家的要求,并且会在结账界面上引用。配置的政策会全局应用于您的账号,不过您可以使用 return_policy_label Feed 属性将指定退货政策限制为仅适用于部分商品。

如果您的 Merchant Center 账号是高级账号,则必须在每个子账号中单独配置退货政策。

您必须提供退货费用、退货速度(期限)以及指向完整政策的链接。如需详细了解如何配置退货,请点击此处

1.2. 客户支持信息

您必须在 Merchant Center 中设置客户服务信息。它将用于在订单确认页面上生成“联系商家”链接。如需详细了解如何设置客户服务信息,请点击此处

2. 产品数据

您必须更新商品 Feed,以表明商品是否符合条件并提供合规性数据。此信息是启用通过 UCP 与 Google 进行结账的必要条件,因为它可以让客服人员确定产品资格、计算准确的总费用,并向用户显示强制性法律警告。

2.1. 智能体结账资格要求

此操作可让商品加入 Google 上的结账体验。

这是通过包含单个布尔值的商品属性 native_commerce 提供的。如果设置为 false 或缺失,相应商品将无法使用结账功能。

2.2. 商品警告

对于有监管警告要求的商品(例如,加州 65 号提案)。您有责任遵守所有适用法律,包括商品警告要求。当您提供这些警告时,它们会醒目地显示在结账界面上。

提供包含两个子属性的 consumer_notice 属性组:

  • consumer_notice_type:必须是 legal_disclaimersafety_warningprop_65 中的一个。
  • consumer_notice_message:字符串(最多 1000 个字符)。系统接受 HTML 标记 <b><br><i>

2.3. 商品标识码

商品 Feed 中的 id 必须与结账 API 预期的商品 ID 一致。如果一致,则无需采取任何行动。否则,请使用 merchant_item_id 自定义属性进行映射。

2.4. 如何为商品添加属性

以下示例概述了向 Merchant Center 提供商品的不同方式。

2.4.1. Feed

我们建议您创建补充数据源点击此处查看相关说明)。您可以将此属性添加到主 Feed 中,但请谨慎操作,因为格式不正确可能会影响常规商品数据提取。

语法注意事项:确保复杂字符串(例如 Prop 65 消息)不包含会破坏文件格式的字符(例如 CSV 中的额外英文逗号),除非已正确转义。

文本文件格式:

ID native_commerce consumer_notice
11111 TRUE prop_65:This product can expose you...
22222 TRUE
33333 FALSE

XML 格式:

<item>
  <g:id>11111</g:id>
  <g:native_commerce>TRUE</g:native_commerce>
  <g:consumer_notice>
    <g:consumer_notice_type>prop_65</g:consumer_notice_type>
    <g:consumer_notice_message>
      This product can expose you to chemicals...
    </g:consumer_notice_message>
  </g:consumer_notice>
</item>
<item>
  <g:id>22222</g:id>
  <g:native_commerce>TRUE</g:native_commerce>
</item>
<item>
  <g:id>33333</g:id>
  <g:native_commerce>FALSE</g:native_commerce>
</item>

2.4.2. Content API

以自定义属性的形式提供这些属性。它们必须包含在包含完整商品的 products.insert 中,因为 products.update 不支持更新 customAttributes。

示例:

"customAttributes": [
  {
    "name": "native commerce",
    "groupValues": [
      {
        "name": "checkout eligibility",
        "value": "true"
      }
    ]
  },
  {
    "name": "consumer notice",
    "groupValues": [
      {
        "name": "notice type",
        "value": "prop_65"
      },
      {
        "name": "notice message",
        "value": "This product can expose you to chemicals..."
      }
    ]
  },
  {
    "name": "merchant item id",
    "value": "some_checkout_item_id_1"
  }
]

2.4.2. Merchant API

以自定义属性的形式提供这些属性。您可以将它们添加到现有的 accounts.productInputs.insert 中,也可以使用 accounts.productInputs.patch 直接更新它们。

插入的示例:

"customAttributes": [
  {
    "name": "native commerce",
    "groupValues": [
      {
        "name": "checkout eligibility",
        "value": "true"
      }
    ]
  },
  {
    "name": "consumer notice",
    "groupValues": [
      {
        "name": "notice type",
        "value": "prop_65"
      },
      {
        "name": "notice message",
        "value": "This product can expose you to chemicals..."
      }
    ]
  },
  {
    "name": "merchant item id",
    "value": "some_checkout_item_id_1"
  }
]

更新示例:

类型 名称
路径参数 productInput.name accounts/{account}/productInputs/en~US~11111
查询参数 updateMask customAttributes.native%20commerce,customAttributes.consumer%20notice,customAttributes.product%20fee,customAttributes.merchant%20item%20id
dataSource dataSources/{datasource}
{
  "offerId": "11111",
  "contentLanguage": "en",
  "feedLabel": "US",
    "customAttributes": [
    {
      "name": "native commerce",
      "groupValues": [
        {
          "name": "checkout eligibility",
          "value": "true"
        }
      ]
    },
    {
      "name": "consumer notice",
      "groupValues": [
        {
          "name": "notice type",
          "value": "prop_65"
        },
        {
          "name": "notice message",
          "value": "This product can expose you to chemicals..."
        }
      ]
    },
    {
      "name": "product fee",
      "groupValues": [
        {
          "name": "product fee type",
          "value": "US_AZ_TIRE_FEE"
        },
        {
          "name": "product fee amount",
          "value": "2.75 USD"
        }
      ]
    },
    {
      "name": "merchant item id",
      "value": "some_checkout_item_id_1"
    }
  ]
}

3. 产品限制

以下类别的商品不符合结账条件。确保这些项的 native_commerce 为空或设置为 false

金融产品和定期付费模式

  • 订阅:需要定期结算周期的商品。
  • 分期付款:需要商家强制执行付款计划或融资的交易。

定制商品和履单选项

  • 个性化商品:需要做出自定义设计决策的商品(例如刻字、字母组合)。
  • 非全新商品或最终销售交易商品:翻新商品、二手商品以及标记为“最终销售交易”(不得退货)的商品。
  • 预订商品:未来发布日期和延迟履单的商品。
  • 捆绑式服务:需要签订额外合同的项目,例如保修、安装或设置。
  • 特殊运费:需要支付非标准运费的商品(例如,货运、加急配送)。
  • 礼品:需要拆分账单物流或向收件人隐藏价格的交易。
  • 实体店激活:必须在零售地点实际激活的产品。

政策和安全限制

  • 有年龄限制:需要进行身份验证的商品(例如,酒精饮料、烟草)。
  • 禁止的内容:武器、成人内容、医疗保健/药品、假冒商品或任何其他受标准 Google 购物政策禁止的类别。

数字化商品和服务

  • 服务:课程、在线课程和旅游套餐(除非使用特定的旅游轨道集成)。
  • 租赁:电影租赁、设备租赁或租赁。
  • 虚拟商品:游戏币、MMORPG 商品或皮肤。
  • 软件依赖项:要求用户在完成购买之前安装特定软件的商品。