> 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/support-and-reference/troubleshooting-and-support/errors-handing/202-vs-301-vs-308.md).

# 202 vs 301 vs 308

{% hint style="info" %}
💬 **需要帮助？** 如果遇到问题，请在帮助中心咨询 Eva，快速获取诊断建议。

<a href="https://www.atriptech.com/" class="button primary" data-icon="comments">咨询 Eva</a>
{% endhint %}

当预订失败时，使用本页面判断是需要刷新 `search.do`、刷新 `verify.do` 还是重新启动预订流程。

### 简要回答

`202` 表示 `routingIdentifier` 已过期。

`301` 表示 `sessionId` 已过期。

`308` 表示在创建订单前价格已变动。

它们的恢复路径不同。

### 常见问题

#### `202` 意味着什么？

意味着 `search.do` 中的 `routingIdentifier` 不再有效。

重新运行 `search.do`。

#### `301` 意味着什么？

意味着 `verify.do` 中的 `sessionId` 不再有效。

如果搜索上下文仍可用，重新运行 `verify.do`。

#### `308` 意味着什么？

意味着验证和订单创建之间的预订价格发生了变动。

不要盲目重新提交相同的订单。

首先刷新预订上下文。

### 核心区别

#### `202` — `routingIdentifier` 过期

**失败阶段**

`verify.do`

**什么过期了**

`routingIdentifier`

**典型原因**

`search.do` 后超过 6 小时。

**下一步操作**

重新运行 `search.do`。

然后使用新的 `routingIdentifier` 继续 `verify.do`。

#### `301` — `sessionId` 过期

**失败阶段**

`order.do`

**什么过期了**

`sessionId`

**典型原因**

`verify.do` 后超过 2 小时。

**下一步操作**

重新运行 `verify.do`。

然后使用新的 `sessionId` 继续 `order.do`。

#### `308` — 价格变动

**失败阶段**

`order.do`

**什么变了**

当前价格或票价上下文

**典型原因**

验证后库存或票价发生变化。

**下一步操作**

在再次创建订单前刷新预订上下文。

大多数情况下，从 `search.do` 重新开始并通过 `verify.do` 继续。

### 快速决策规则

在生产中使用此规则：

* `202` — 刷新搜索
* `301` — 刷新验证
* `308` — 刷新预订上下文并重建订单

### 必须重新启动多少流程？

#### 对于 `202`

从 `search.do` 重新开始。

旧的 `routingIdentifier` 无法重用。

#### 对于 `301`

从 `verify.do` 重新开始。

如果原始搜索上下文仍然有效，则不需要先进行新的搜索。

#### 对于 `308`

将之前的预订上下文视为过时。

如果您处于标准搜索流程，从 `search.do` 重新开始。

如果您处于 Get Offer 流程，首先刷新报价。

### 常见错误

#### 在 `202` 后使用相同的 `routingIdentifier` 重试 `verify.do`

不要这样做。

标识符已过期。

#### 在 `301` 后使用相同的 `sessionId` 重试 `order.do`

不要这样做。

会话已过期。

#### 在 `308` 后未重建订单就重试 `order.do`

不要这样做。

价格漂移通常意味着旧的预订假设已过时。

### 最佳实践

一起存储这些值：

* 标识符类型
* 标识符创建时间
* 行程摘要
* 乘客组合
* 流程类型

这使得下一步恢复步骤变得明确。

### 相关页面

* [错误代码](/api-wen-dang/support-and-reference/troubleshooting-and-support/errors-handing.md)
* [标识符](/api-wen-dang/product-guides/booking/booking-overview/identifiers.md)
* [搜索](/api-wen-dang/product-guides/booking/booking-step-guides/search.md)
* [验证](/api-wen-dang/product-guides/booking/booking-step-guides/verify.md)
* [创建订单](/api-wen-dang/product-guides/booking/booking-step-guides/create-order.md)
* [搜索 vs 报价](/api-wen-dang/product-guides/booking/booking-overview/booking-decisions/search-vs-offer.md)
