store.store_webhooks 中删除,无软删除标记。历史 webhook_deliveries 记录保留以供审计(storeWebhookId 外键被置为 null)。
请求体
| 字段 | 类型 | 必需 | 说明 |
|---|---|---|---|
id | string | 是 | Webhook UUID |
请求示例
成功响应 (200)
返回删除前一刻的 Webhook 实体(便于调用方确认所删除的内容)。结构与add-webhook 相同。
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | Webhook UUID |
storeId | string | 所属门店的 UUID |
channel | string | Webhook 通道 |
url | string | 目标 Webhook URL |
events | string[] | 订阅的事件类型 |
testMode | boolean | true 对测试交易触发,false 对生产交易触发 |
secret | string | null | 通道特定凭据,未设置时为 null |
createdAt | string | 创建时间戳(ISO 8601) |
updatedAt | string | 最后更新时间戳(ISO 8601) |
错误响应
重试策略:4xx 一律不要重试 — 修正请求后重发。5xx 指数退避重试(起步 5s,最多 3 次)。
| 状态码 | errors[0].message | 含义 | 推荐处理 |
|---|---|---|---|
| 400 | Missing required field: id | 未提供 id | 修正请求体后重发 |
| 400 | id must be a valid UUID | id 不是合法 UUID | 修正 id 后重发 |
| 403 | Not authorized to manage webhooks for this store | 调用方在所属门店上的 merchant 角色不是 owner 或 admin | 换用拥有所需角色的 API Key |
| 404 | Webhook not found | 指定 id 的 webhook 不存在(或已被删除) | Webhook 已不存在 — 按成功处理,并对齐本地状态 |
| 500 | Internal server error | 服务端意外失败 | 指数退避重试(起步 5s,最多 3 次) |