跳转到主要内容
更新现有门店的名称、状态或配置设置。仅更新请求体中包含的字段;未包含的字段保持不变。
POST /v1/actions/store/update-store
认证方式: API Key(需要 owner 或 admin 角色)

请求体

字段类型必需说明
idstring门店 ID(Short ID 格式 STO_xxx
namestring更新后的门店名称(1-48 个字符)
statusstringactiveinactivesuspended
logostring | null门店 Logo URL(设为 null 可移除)
supportEmailstring | null客服邮箱(设为 null 可移除)
websitestring | null网站 URL(设为 null 可移除)
webhookSettingsobject | nullWebhook 配置(设为 null 可移除)
notificationSettingsobject | null通知偏好(设为 null 可移除)
checkoutSettingsobject | null结账主题配置(设为 null 可移除)

Webhook 设置

字段类型说明
testWebhookUrlstring | null测试环境的 Webhook URL
prodWebhookUrlstring | null生产环境的 Webhook URL
testEventsstring[]测试环境订阅的事件类型
prodEventsstring[]生产环境订阅的事件类型

通知设置

字段类型默认值说明
emailOrderConfirmationbooleantrue订单确认时发送邮件
emailSubscriptionConfirmationbooleantrue订阅创建时发送邮件
emailSubscriptionCycledbooleantrue订阅续费时发送邮件
emailSubscriptionCanceledbooleantrue订阅取消时发送邮件
emailSubscriptionRevokedbooleantrue订阅撤销时发送邮件
emailSubscriptionPastDuebooleantrue订阅逾期时发送邮件
notifyNewOrdersbooleantrue新订单通知商户
notifyNewSubscriptionsbooleantrue新订阅通知商户

结账设置

字段类型说明
defaultDarkModeboolean是否默认使用暗色模式
lightobject亮色主题设置(见下方)
darkobject暗色主题设置(见下方)
结账主题设置lightdark 通用):
字段类型说明
checkoutLogostring | null结账页面 Logo URL
checkoutColorPrimarystring主色调(十六进制)
checkoutColorBackgroundstring背景色(十六进制)
checkoutColorCardstring卡片/面板颜色(十六进制)
checkoutColorTextstring文字颜色(十六进制)
checkoutBorderRadiusstring圆角大小(CSS 值)

请求示例

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

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

const { store } = await client.stores.update({
  id: "STO_2aUyqjCzEIiEcYMKj7TZtw",
  name: "Updated Store Name",
  supportEmail: "help@example.com",
  webhookSettings: {
    testWebhookUrl: "https://example.com/webhooks/test",
    prodWebhookUrl: null,
    testEvents: ["order.completed", "subscription.created"],
    prodEvents: [],
  },
  notificationSettings: {
    emailOrderConfirmation: true,
    emailSubscriptionConfirmation: true,
    emailSubscriptionCycled: true,
    emailSubscriptionCanceled: true,
    emailSubscriptionRevoked: false,
    emailSubscriptionPastDue: true,
    notifyNewOrders: true,
    notifyNewSubscriptions: true,
  },
});

成功响应 (200)

{
  "data": {
    "store": {
      "id": "STO_2aUyqjCzEIiEcYMKj7TZtw",
      "name": "Updated Store Name",
      "status": "active",
      "logo": null,
      "supportEmail": "help@example.com",
      "website": null,
      "slug": "my-digital-store-a1b2c3",
      "prodEnabled": false,
      "webhookSettings": {
        "testWebhookUrl": "https://example.com/webhooks/test",
        "prodWebhookUrl": null,
        "testEvents": ["order.completed", "subscription.created"],
        "prodEvents": []
      },
      "notificationSettings": {
        "emailOrderConfirmation": true,
        "emailSubscriptionConfirmation": true,
        "emailSubscriptionCycled": true,
        "emailSubscriptionCanceled": true,
        "emailSubscriptionRevoked": false,
        "emailSubscriptionPastDue": true,
        "notifyNewOrders": true,
        "notifyNewSubscriptions": true
      },
      "checkoutSettings": {
        "defaultDarkMode": false,
        "light": {
          "checkoutLogo": null,
          "checkoutColorPrimary": "#000000",
          "checkoutColorBackground": "#FFFFFF",
          "checkoutColorCard": "#F5F5F5",
          "checkoutColorText": "#1A1A1A",
          "checkoutBorderRadius": "8px"
        },
        "dark": {
          "checkoutLogo": null,
          "checkoutColorPrimary": "#FFFFFF",
          "checkoutColorBackground": "#1A1A1A",
          "checkoutColorCard": "#2A2A2A",
          "checkoutColorText": "#F5F5F5",
          "checkoutBorderRadius": "8px"
        }
      },
      "deletedAt": null,
      "createdAt": "2026-01-15T10:30:00.000Z",
      "updatedAt": "2026-01-15T11:00:00.000Z"
    }
  }
}

响应字段

创建门店响应字段相同。

错误响应

状态码错误说明
400Missing required field: id请求体中未提供 id
403Access denied: insufficient role商户角色为 member(更新需要 owneradmin
404Store not found门店 ID 不存在或商户不是成员