# 客户分群更新

**Webhook** customers/segment\_update

C 端客户分群更新时触发。

需要 `customer` [访问权限](/zh-CN/docs/app/building-blocks/authentication/access-scopes)。最低支持版本：`202007`。

## 请求头

- `X-Shoplazza-Topic` string

  触发本次推送的事件，例如 orders/create

  **示例：** `orders/create`
- `X-Shoplazza-Hmac-Sha256` string

  请求体的 HMAC-SHA256 签名（base64 编码），使用应用的 Client Secret 生成，用于验证请求来自 Shoplazza
- `X-Shoplazza-Shop-Domain` string

  产生该事件的店铺域名

  **示例：** `example.myshoplaza.com`
- `X-Shoplazza-Api-Version` string

  序列化 payload 使用的 API 版本

  **示例：** `2025-06`
- `X-Shoplazza-Deduplication-ID` string

  本次推送的去重 ID，同一事件重发时保持不变，用于幂等去重

## 请求体

**数据结构 | 示例**

- `customer_segment` object

  - `id` string

    客户分组 ID
  - `name` string

    分组名称
  - `filter` string

    细分条件设置（内嵌 JSON 字符串）
  - `state` string

    分组状态（normal=有效，invalid=无效）
  - `source_name` string

    数据来源（admin=后台，api=API 接口）
  - `app_name` string

    创建该分组的插件名称
  - `created_at` string

    分组创建时间
  - `updated_at` string

    分组更新时间

```json
{
  "customer_segment": {
    "id": "string",
    "name": "string",
    "filter": "string",
    "state": "string",
    "source_name": "string",
    "app_name": "string",
    "created_at": "string",
    "updated_at": "string"
  }
}
```
