Buyer Consent 买家同意扩展

基本信息

  • Capability Namedev.ucp.shopping.buyer_consent
  • Version2026-01-11
  • 官方规范buyer-consent.md

概述

Buyer Consent 扩展允许平台向商家传输买家关于数据使用和通信偏好的同意选择。

当此扩展支持时,结账中的 buyer 对象扩展为包含 consent 字段,包含布尔同意状态。

同意类别

类别描述
analytics分析和数据收集同意
preferences偏好设置同意
marketing营销通信同意
sale_of_data数据出售同意

发现

商家在 Profile 中声明同意支持:

{
  "capabilities": [
    {
      "name": "dev.ucp.shopping.buyer_consent",
      "version": "2026-01-11",
      "extends": "dev.ucp.shopping.checkout"
    }
  ]
}

Schema 组合

同意扩展扩展结账中的 buyer 对象

  • 基础扩展模式:结账 via buyer 对象
  • 路径checkout.buyer.consent
  • Schema 引用buyer_consent.json

使用

平台在结账操作的 buyer 对象中包含同意。

示例:创建带同意的结账

POST /checkouts

{
  "line_items": [
    {
      "item": {
        "id": "prod_123",
        "title": "Blue T-Shirt",
        "price": 1999
      },
      "id": "li_1",
      "quantity": 1
    }
  ],
  "buyer": {
    "email": "[email protected]",
    "first_name": "Jane",
    "last_name": "Doe",
    "consent": {
      "analytics": true,
      "preferences": true,
      "marketing": false,
      "sale_of_data": false
    }
  }
}

安全与隐私考虑

  1. 同意是声明性的 — 协议传达同意,但不强制执行
  2. 法律合规 仍是商家的责任
  3. 平台不应 在没有明确用户操作的情况下假设同意
  4. 未提供同意时的默认行为 是商家特定的
  5. 同意状态 应与实际用户选择一致,而非平台默认值