> For the complete documentation index, see [llms.txt](https://help.sesami.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sesami.co/zh-cn/zi-dong-hua/sesami-flows-and-klaviyo/klaviyo-transactional-sms.md).

# Klaviyo 交易短信

此设置允许 Sesami 通过 Klaviyo 发送与预订相关事件的交易短信通知，例如确认、提醒、取消和重新安排。

{% hint style="info" %}
**重要：** 此设置适用于 **交易短信，不是短信营销**.
{% endhint %}

### 先决条件

在开始设置之前，请确保 Klaviyo 账户具备：

* **付费的 Klaviyo SMS 套餐** —— 交易短信所必需。
* **已启用 SMS** 在 Klaviyo 中。
* **一个可用的 SMS 发送号码** ，支持客户所在地区。
* 一个 **私有 API 密钥** ，并具有所需权限。

{% hint style="info" %}
Klaviyo 要求启用 SMS，并为客户所在地区配置合适的发送号码。
{% endhint %}

***

### 1. Sesami App → Flows

一旦 [启用 Klaviyo 预设](https://help.sesami.co/zh-cn/zi-dong-hua/sesami-flows-and-klaviyo.md#step-2-choose-a-klaviyo-preset)，Sesami 中的 Flow 正文 **必须包含客户的电话号码** 使用 `phone_number` 字段。

将以下内容添加到 Flow 正文：

```
"profile": {
  "data": {
    "type": "profile",
    "attributes": {
      "email": "{{CustomerEmail}}",
      "phone_number": "{{CustomerPhone}}"
    }
  }
}
```

### 2. Klaviyo → Flow

使用所需指标作为触发器创建一个 Flow。按照 [此步骤](https://help.sesami.co/zh-cn/zi-dong-hua/sesami-flows-and-klaviyo.md#step-1-create-a-flow-in-klaviyo)&#x20;

示例： \
**Flow 结构：** `Sesami Appointment Created → Transactional SMS Consent → 等待 5 分钟 → SMS 消息`

### 3. 交易短信同意

1\. 添加一个 **Webhook** 作为第一个操作。

<figure><img src="https://1798155128-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnDgiM1CWSLWRIbhORANO%2Fuploads%2FK7d2OYgrdyEy81NmyNAW%2FScreenshot%202026-10-28%20at%2012.04.08.png?alt=media&amp;token=148df9e9-af71-4feb-8617-d3b94c5dd86a" alt=""><figcaption></figcaption></figure>

2\. 配置 **Webhook 详情** ，使用以下设置。

<figure><img src="https://1798155128-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnDgiM1CWSLWRIbhORANO%2Fuploads%2FclCTHD8fZAwXs24fU6ud%2FScreenshot%202026-10-28%20at%2012.06.18.png?alt=media&amp;token=acba24ca-f1da-4fdd-a61e-e5f8378cdfbd" alt=""><figcaption></figcaption></figure>

* **Webhook 名称：** 为 webhook 输入一个名称，例如 `Sesami - Transactional SMS`&#x20;

* **设置：**
  * **目标 URL：复制以下内容：**

`https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs`

* **标头**

**创建以下“键”和“值”**

```
Content-Type application/json
revision 2026-07-15
Authorization Klaviyo-API-Key YOUR_PRIVATE_API_KEY
```

<figure><img src="https://1798155128-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnDgiM1CWSLWRIbhORANO%2Fuploads%2FaMIfqgjLlugG9b487td2%2FScreenshot%202026-10-28%20at%2012.15.23.png?alt=media&amp;token=f20c0e05-35c7-453e-b682-bea1fd839509" alt=""><figcaption></figcaption></figure>

**JSON 正文**\
复制以下内容：

```
{
  "data": {
    "type": "profile-subscription-bulk-create-job",
    "attributes": {
      "profiles": {
        "data": [
          {
            "type": "profile",
            "attributes": {
              "email": "{{ person.email }}",
              "phone_number": "{{ person.phone_number }}",
              "subscriptions": {
                "sms": {
                  "transactional": {
                    "consent": "SUBSCRIBED"
                  }
                }
              }
            }
          }
        ]
      }
    }
  }
}
```

<figure><img src="https://1798155128-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnDgiM1CWSLWRIbhORANO%2Fuploads%2FVyDh22hfdQxWoEyPFaNU%2FScreenshot%202026-10-28%20at%2012.18.18.png?alt=media&amp;token=de7ac4fe-67cc-43d8-872f-5ff2469b681e" alt=""><figcaption></figcaption></figure>

### 4. SMS 消息

在同意 webhook 之后：

1. 添加一个 **5 分钟延迟**.
2. 添加 SMS 操作。
3. 配置预订通知。
4. 将 SMS 设置为 **交易状态**.&#x20;
5. 将 Flow 设为 Live。

<div><figure><img src="https://1798155128-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnDgiM1CWSLWRIbhORANO%2Fuploads%2FgVT6xv8dSen0Rg0JzgEd%2FScreenshot%202026-10-28%20at%2012.19.54.png?alt=media&amp;token=6598bdf7-d27a-443b-ba9f-e6c033f171da" alt=""><figcaption></figcaption></figure> <figure><img src="https://1798155128-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnDgiM1CWSLWRIbhORANO%2Fuploads%2FmYlOGy0AgC2QnRw7TZ8R%2FScreenshot%202026-10-28%20at%2012.20.28.png?alt=media&amp;token=d0d530f7-24b1-44a7-8c77-458d7b5f3939" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
交易同意和交易状态是分开的：

* **交易同意** = 客户接收交易短信的许可。
* **交易状态** = 将该短信消息归类为交易短信。

仅有交易同意的资料可接收交易短信，但不能接收营销短信。
{% endhint %}

### 5. 测试

**在 Sesami 中创建一个新预订并验证：**

* 交易同意 webhook 完成
* 资料 → 交易短信： **已订阅**
* Flow 在 5 分钟延迟后继续
* 收到 SMS

Klaviyo 的订阅 API 是异步的，因此请留出一些时间让订阅结果显示。

<div><figure><img src="https://1798155128-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnDgiM1CWSLWRIbhORANO%2Fuploads%2FYBJh3teX9nGdtObpWCDn%2F1%20webhook%20.png?alt=media&amp;token=917ee541-2e35-4a1a-8160-1e8250fd1714" alt=""><figcaption></figcaption></figure> <figure><img src="https://1798155128-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnDgiM1CWSLWRIbhORANO%2Fuploads%2FAQy7tJdnr5jmYIIZwKRS%2F2%20subscribed.png?alt=media&amp;token=d4d84723-1ade-4285-8ec8-0369727e0302" alt=""><figcaption></figcaption></figure> <figure><img src="https://1798155128-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnDgiM1CWSLWRIbhORANO%2Fuploads%2FjzLj0OEVJKK4WGw9g3hS%2F3%20delay%20.png?alt=media&amp;token=0c778095-b752-4d7c-b84d-92dc95fbd8bd" alt=""><figcaption></figcaption></figure> <figure><img src="https://1798155128-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnDgiM1CWSLWRIbhORANO%2Fuploads%2F8G5SlULFgjuofWHFi4xO%2F4%20Message%20Appointment%20Confirmation-.png?alt=media&amp;token=670ac409-edb2-40c5-ac8a-164eb565cf04" alt=""><figcaption></figcaption></figure></div>

***

### 故障排除

#### HTTP 400 — 电话号码地区

如果 Klaviyo 报告该电话号码不受此账户支持，请检查： **Klaviyo → 设置 → 短信**

确保该账户为客户所在国家/地区配置了一个可用的发送号码。

#### Flow 未触发

检查 **首先检查 Flow 触发器和触发器筛选条件**.

* 触发器必须是 [**Sesami 指标**](https://help.sesami.co/zh-cn/zi-dong-hua/sesami-flows-and-klaviyo.md)
* 删除任何引用事件属性的筛选条件

#### 交易短信不可用

确认商家拥有 **付费的 Klaviyo SMS 套餐**.

免费套餐不支持将交易状态应用于 SMS 消息。

***

### 最终检查清单

**Klaviyo 账户**

* 付费 SMS 套餐
* 已启用 SMS
* 已配置发送号码
* 发送号码支持客户所在地区
* 具有所需权限的私有 API 密钥

**Sesami**

* 已配置 Events API webhook
* 包含电话号码

**Klaviyo Flow**

* 触发器 = `Sesami Appointment Created`
* 没有无效的触发器筛选条件
* 交易短信同意 webhook
* `{{ person.phone_number }}`
* `SUBSCRIBED` 交易同意
* 5 分钟延迟
* SMS 具有交易状态
* Flow 已上线


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.sesami.co/zh-cn/zi-dong-hua/sesami-flows-and-klaviyo/klaviyo-transactional-sms.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
