为门店新增 Webhook 端点。每个门店在所有通道下最多可配置 20 个 Webhook。Documentation Index
Fetch the complete documentation index at: https://docs.waffo.ai/llms.txt
Use this file to discover all available pages before exploring further.
请求体
| 字段 | 类型 | 必需 | 说明 |
|---|---|---|---|
storeId | string | 是 | Store ID(Short ID 格式 STO_xxx) |
channel | string | 是 | 取值为 http、feishu、discord、telegram、slack 之一 |
url | string | 是 | 目标 Webhook URL(HTTPS;商户需确保 URL 与所选通道匹配) |
events | string[] | 是 | 订阅的事件类型 —— 例如 ["order.completed", "refund.succeeded"]。空数组表示不向该 Webhook 触发任何事件。 |
testMode | boolean | 是 | true = 仅对测试交易触发;false = 仅对生产交易触发 |
secret | string | null | 否 | 通道特定凭据(如 Telegram 的 chat_id)。以不透明字符串形式存储。 |
请求示例
成功响应 (200)
返回的
webhook.id 是 UUID,而非 Short ID —— Webhook ID 不属于 IdPrefix 范围。请将其原样传入 update-webhook 与 remove-webhook。响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | Webhook UUID |
storeId | string | 所属门店的 UUID |
channel | string | Webhook 通道(http、feishu、discord、telegram 或 slack) |
url | string | 目标 Webhook URL |
events | string[] | 订阅的事件类型 |
testMode | boolean | true 对测试交易触发,false 对生产交易触发 |
secret | string | null | 通道特定凭据(不透明字符串),未设置时为 null |
createdAt | string | 创建时间戳(ISO 8601) |
updatedAt | string | 最后更新时间戳(ISO 8601) |
错误响应
| 状态码 | 说明 |
|---|---|
| 400 | channel 不在允许列表、url 不是合法 HTTPS URL、events 不是字符串数组、secret 不是 string/null,或门店已达 20 个 Webhook 上限 |
| 403 | 调用方不是该门店的 owner 或 admin |