返回知识库
Agent 购物

ACP 协议配置指南:在 ChatGPT 内完成购物流程

2026-01-17
15 分钟

什么是 ACP?

ACP(Agentic Commerce Protocol)是 OpenAI 与 Stripe 联合发布的购物协议。它让用户能够在 ChatGPT 对话中直接完成商品购买。

ACP 文件结构

ACP 配置文件位于网站根目录的 /agent.json

{
  "schema_version": "1.0",
  "merchant": {
    "name": "Your Brand",
    "domain": "yourbrand.com",
    "logo_url": "https://yourbrand.com/logo.png"
  },
  "product_feed_url": "https://yourbrand.com/products.xml",
  "checkout_enabled": true,
  "checkout_api_url": "https://yourbrand.com/api/checkout",
  "payment_providers": ["stripe"],
  "supported_currencies": ["USD", "EUR", "GBP"],
  "shipping_countries": ["US", "CA", "GB", "DE", "FR"],
  "contact_email": "support@yourbrand.com"
}

配置步骤

1. 准备 Product Feed

创建符合规范的产品数据源,包含:

  • 产品名称、描述、图片
  • 价格和货币
  • 库存状态
  • SKU 和 GTIN(如有)
  • 2. 生成 agent.json

    使用 GeoAction 的 Agent 配置生成器,自动生成配置文件。

    3. 集成 Stripe 支付

    ACP 使用 Stripe 作为支付网关。确保你的网站已集成 Stripe:

  • 创建 Stripe 账号
  • 获取 API 密钥
  • 实现 Checkout API
  • 4. 实现 Checkout API

    创建一个 API 端点来处理来自 ChatGPT 的购买请求:

    POST /api/checkout
    {
      "product_id": "xxx",
      "quantity": 1,
      "payment_method": "stripe"
    }

    5. 部署并验证

    上传 agent.json 到网站根目录,使用 GeoAction 验证配置。

    重要字段说明

    字段必填说明
    merchant.name商家品牌名
    merchant.domain商家域名
    productfeedurl产品数据源 URL
    checkout_enabled是否启用结账
    payment_providers支持的支付方式
    shipping_countries可配送的国家

    安全注意事项

  • 验证请求来源:确保 API 请求来自 OpenAI
  • 保护 API 密钥:不要在前端暴露 Stripe 密钥
  • 实现限流:防止 API 被滥用
  • 记录日志:追踪所有 AI 发起的交易
  • 与 UCP 的区别

    方面UCPACP
    发布者GoogleOpenAI + Stripe
    主要平台Google Search、GeminiChatGPT
    支付集成Google PayStripe
    配置文件.well-known/ucpagent.json

    建议同时配置两者

    为了最大化 AI 流量,建议同时配置 UCP 和 ACP,覆盖 Google 和 OpenAI 两大生态。