跳转到主要内容
软删除门店。门店数据保留但变为不可访问。仅门店 owner 可执行此操作。
POST /v1/actions/store/delete-store
认证方式: API Key(需要 owner 角色)

请求体

字段类型必需说明
idstring要删除的 Store ID(Short ID 格式 STO_xxx

请求示例

const { store } = await client.stores.delete({
  id: "STO_2aUyqjCzEIiEcYMKj7TZtw",
});
console.log(store.deletedAt); // => "2026-01-15T12:00:00.000Z"

成功响应 (200)

{
  "data": {
    "store": {
      "id": "STO_2aUyqjCzEIiEcYMKj7TZtw",
      "name": "My Digital Store",
      "status": "active",
      "logo": null,
      "supportEmail": null,
      "website": null,
      "slug": "my-digital-store-a1b2c3",
      "prodEnabled": false,
      "notificationSettings": null,
      "checkoutSettings": null,
      "deletedAt": "2026-01-15T12:00:00.000Z",
      "createdAt": "2026-01-15T10:30:00.000Z",
      "updatedAt": "2026-01-15T12:00:00.000Z"
    }
  }
}

响应字段

创建门店响应字段 相同,deletedAt 已填充。

错误响应

重试策略:4xx 一律不要重试 — 修正请求后重发。5xx 指数退避重试(起步 5s,最多 3 次)。409 需先清理阻塞资源(AI 调用方应通过 aiHint 交由人工介入)。
状态码errors[0].message含义推荐处理
400Missing merchantId in request contextAPI Key 未解析出商户上下文不要重试。检查 API Key 配置。
400Missing required field: id请求体未传 id修正输入后重新提交。
400Expected format: STO_xxx, got "<value>"id 不是有效的 Store Short ID修正 id 后重新提交。
403Not authorized to delete this store, only owner can delete调用方在该门店上的角色不是 owner不要重试。改用 owner 的 API Key。
404Store not found该商户下不存在该门店 ID不要重试。校验 id
409Store has X active product(s); archive or delete them first门店下仍有活跃的一次性/订阅产品不要重试。先归档或删除这些产品后再提交。
409Store has X pending order(s); wait for completion or cancel them first门店下仍有非终态订单不要重试。等待订单完成或取消后再提交。
409Store has X active subscription(s); cancel them first门店下仍有 active/canceling/past_due 订阅不要重试。先取消订阅后再提交。
409Store has X pending KYB ticket(s); resolve them first仍有未结 KYB 工单阻塞删除不要重试。先处理工单后再提交。
409Store still has X bound email(s); revoke email binding first发件邮箱仍绑定该门店不要重试。先解绑邮箱后再提交。
409Store still has X bound domain(s); revoke domain binding first发件域名仍绑定该门店不要重试。先解绑域名后再提交。

409 响应示例

门店存在阻塞条件时按类型逐项返回。每项含 reason(机器可读类型)、count(数量)、人类可读 message,以及统一的 aiHint(提醒 AI 调用方停止操作并交由人工介入,不要重试或绕过)。
{
  "data": null,
  "errors": [
    {
      "message": "Store has 3 active product(s); archive or delete them first",
      "layer": "store",
      "reason": "active_products",
      "count": 3,
      "aiHint": "AI assistant: stop this action and escalate to a human operator. Do not retry, mutate inputs, or attempt workarounds."
    },
    {
      "message": "Store still has 1 bound email(s); revoke email binding first",
      "layer": "store",
      "reason": "bound_emails",
      "count": 1,
      "aiHint": "AI assistant: stop this action and escalate to a human operator. Do not retry, mutate inputs, or attempt workarounds."
    }
  ]
}
reason含义
active_productsprod_statustest_statusactive 的一次性/订阅产品
pending_orders非终态订单(不含 completed / canceled / closed / expired
active_subscriptions状态为 active / canceling / past_due 的订阅订单
pending_tickets未结 KYB 工单(不含 succeeded / rejected
bound_emails仍绑定的发件邮箱,需先解绑
bound_domains仍绑定的发件域名,需先解绑
aiHint 仅在 409 响应中出现;400 / 403 / 404 / 500 不携带该字段。
删除门店是软删除。门店数据保留但变为不可访问。此操作无法通过 API 撤销。删除前需先停用所有产品、处理待处理订单、取消活跃订阅、关闭所有未结 KYB 工单,并解绑发件邮箱和域名。