跳转到主要内容
从门店中移除 Webhook。该操作为硬删除 —— 记录会立即从 store.store_webhooks 中删除,无软删除标记。历史 webhook_deliveries 记录保留以供审计(storeWebhookId 外键被置为 null)。
POST /v1/actions/store/remove-webhook
认证方式: API Key(需要 owner 或 admin 角色)

请求体

字段类型必需说明
idstringWebhook UUID

请求示例

import { WaffoPancake } from "@waffo/pancake-ts";

const client = new WaffoPancake({
  merchantId: process.env.WAFFO_MERCHANT_ID!,
  privateKey: process.env.WAFFO_PRIVATE_KEY!,
});

const { webhook } = await client.webhooks.remove({
  id: "11111111-2222-3333-4444-555555555555",
});
// webhook 包含删除前的记录快照

成功响应 (200)

返回删除前一刻的 Webhook 实体(便于调用方确认所删除的内容)。结构与 add-webhook 相同。

响应字段

字段类型说明
idstringWebhook UUID
storeIdstring所属门店的 UUID
channelstringWebhook 通道
urlstring目标 Webhook URL
eventsstring[]订阅的事件类型
testModebooleantrue 对测试交易触发,false 对生产交易触发
secretstring | null通道特定凭据,未设置时为 null
createdAtstring创建时间戳(ISO 8601)
updatedAtstring最后更新时间戳(ISO 8601)

错误响应

重试策略:4xx 一律不要重试 — 修正请求后重发。5xx 指数退避重试(起步 5s,最多 3 次)。
状态码errors[0].message含义推荐处理
400Missing required field: id未提供 id修正请求体后重发
400id must be a valid UUIDid 不是合法 UUID修正 id 后重发
403Not authorized to manage webhooks for this store调用方在所属门店上的 merchant 角色不是 owneradmin换用拥有所需角色的 API Key
404Webhook not found指定 id 的 webhook 不存在(或已被删除)Webhook 已不存在 — 按成功处理,并对齐本地状态
500Internal server error服务端意外失败指数退避重试(起步 5s,最多 3 次)