> For the complete documentation index, see [llms.txt](https://resources.atriptech.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://resources.atriptech.com/api-wen-dang/readme/webhook-gai-lan/incident-notification.md).

# 事件通知

{% hint style="info" %}
遇到 API 接入问题时，可登录 [Eva](https://www.atriptech.com/) 寻求帮助。
{% endhint %}

当 Atlas 检测到影响订单的运营事件时，使用这个 webhook。

### 触发时机

以下场景会触发事件通知：

* `email.schedulechange`
* `order.schedulechange`
* `abnormal.cancelled`

### 收到后建议处理

收到事件后，建议：

* 先识别事件类型
* 判断是否需要旅客进一步处理
* 必要时通知受影响旅客
* 结合事件查询或订单查询继续排查

### 推送方式

Atlas 会向你已注册的 webhook 地址发起 `POST` 请求。

### 建议优先读取的字段

* `type`
* `notificationId`
* `status`
* `data.orderNo`

然后再根据 `type` 读取对应的事件字段。

### 事件类型

#### `email.schedulechange`

Atlas 收到了航司发出的航变邮件。\
重点看 `data.emailSubject` 和 `data.emailLink`。

#### `order.schedulechange`

Atlas 提供了结构化航变数据。\
重点看航段数组和 `scheduleChangeType`。

#### `abnormal.cancelled`

Atlas 检测到异常取消。\
重点看订单号和取消相关字段。

### 说明

* `status` 表示事件确认状态
* `emailLink` 是临时链接，必要时请尽快保存内容
* 依赖这些通知前，请先完成 webhook 地址注册

### 注册请求示例

```json
{
  "cid": "XXXXXXXX",
  "url": "https://xxx.com/xxxx"
}
```

{% tabs %}
{% tab title="字段说明" %}
**cid**

* **类型：** String
* **是否必填：** 是
* **说明：** 用于跟踪请求的客户唯一标识。

**type**

* **类型：** String
* **是否必填：** 是
* **说明：** 事件类型。
* **可选值：**
  * `email.schedulechange`：邮件航变通知
  * `order.schedulechange`：API 航变通知
  * `abnormal.cancelled`：未对账取消

**notificationId**

* **类型：** String
* **是否必填：** 是
* **说明：** 通知事件唯一标识。

**status**

* **类型：** Integer
* **是否必填：** 是
* **说明：** 事件状态。
* **可选值：**
  * `0`：未确认
  * `1`：已确认

**data.orderNo**

* **类型：** String
* **是否必填：** 是
* **说明：** 订单唯一编号。

**data.emailSubject**

* **类型：** String
* **说明：** 邮件航变场景下的邮件主题。

**data.emailLink**

* **类型：** String (URL)
* **说明：** 邮件详情链接。通常只有短时效。
  {% endtab %}

{% tab title="示例" %}
**邮件航变通知**

```json
{
    "cid":"xxxxxxxxxx",
    "type":"email.schedulechange",
    "notificationId":"20230323113246035DNIDD",
    "status":0,
    "data":{
        "orderNo":"TESTS20230323103458265",
        "emailSubject":"IMPORTANT: Flight delay notice. Confirmation Code KDK7QG",
        "emailLink":"https://theatlas/#/email-detail/4378270"
    }
}
```

**API 航变通知**

```json
{
  "cid": "xxxxxxxxxx",
  "data": {
    "orderNo": "XCEWF20221203094515954",
    "previousSegs": [],
    "revisedSegs": [],
    "scheduleChangeType": 1
  },
  "notificationId": "20230424050252711WZDMB",
  "status": 0,
  "type": "order.schedulechange"
}
```

**未对账取消**

```json
{
  "cid": "xxxxxxxxxx",
  "data": {
    "orderNo": "RQWUV20230617185232880",
    "vendorRefundInformation": "FULLY"
  },
  "notificationId": "20230906014000568DRLNX",
  "status": 0,
  "type": "abnormal.cancelled"
}
```

{% endtab %}
{% endtabs %}

### 相关页面

* [Webhook 注册与事件](/api-wen-dang/api-can-kao/webhook-yu-shi-jian-api/webhook-zhu-ce-yu-shi-jian.md)
* [事件查询](/api-wen-dang/readme/webhook-gai-lan/shi-jian-cha-xun.md)
* [航变通知](/api-wen-dang/readme/webhook-gai-lan/schedule-change-notification.md)
* [邮件通知](/api-wen-dang/readme/webhook-gai-lan/email-notification.md)


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://resources.atriptech.com/api-wen-dang/readme/webhook-gai-lan/incident-notification.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
