# 生产上线

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

当你准备从沙箱切换到生产时，使用这页。

### 本阶段目标

把集成从沙箱迁移到生产。

这是整体接入流程的最后一步。

### 何时开始

满足这些条件后再开始：

* 所需 UAT 已完成
* 预订流程已稳定
* webhook 处理已准备好
* 团队可以监控首批生产订单

在上线清单未准备好前，不要开始生产配置。

只有在 UAT 通过，且客户经理把账号切到 `LIVE` 后，才能生成生产凭证。

### 生产环境会变更什么

需要从沙箱切到生产的内容包括：

* 凭证
* 接口地址
* 支付处理
* 运营监控

请求头规则不变。

生产预订和支付都是真实交易。

### 上线清单

{% stepper %}
{% step %}

### 确认 UAT 完成

先确认所需 UAT 已完成，剩余问题已关闭。
{% endstep %}

{% step %}

### 等待 LIVE 状态

UAT 通过后，客户经理会把账号状态改为 `LIVE`。

状态未切换前，不能生成生产凭证。
{% endstep %}

{% step %}

### 生成生产凭证

账号进入 `LIVE` 后，在 ATRIP 中生成生产 client ID 和 client secret。

同时在同一流程里配置 IP 白名单。

<figure><img src="/files/R6EQ2qizItdeFdsKlxmC" alt=""><figcaption><p>ATRIP 中的生产凭证生成和 IP 白名单配置</p></figcaption></figure>

只有账号已切到 `LIVE`，客户才能自行生成这些值。
{% endstep %}

{% step %}

### 切换环境

在服务端配置中替换沙箱凭证和沙箱接口地址。

沙箱环境使用同一个地址。

生产环境的 API 地址会区分中国地址和海外地址。

如果生产环境要从中国地址切到海外地址，先验证响应压缩行为。

中国地址当前对部分请求行为做了兼容处理。

海外地址不保证兼容这类行为。

如果客户端、代理或网关显式发送 `Accept: application/json`，可能导致压缩链路失效。

切换前建议用真实链路检查：

* 返回头里的 `Content-Encoding`
* 实际响应体大小
* 是否仍按预期使用 gzip
  {% endstep %}

{% step %}

### 运行受控 smoke test

验证首批生产 API 调用、webhook 投递和出票跟进。
{% endstep %}

{% step %}

### 监控首批生产订单

上线后密切跟踪订单状态、支付结果和 webhook 事件。
{% endstep %}
{% endstepper %}

### 完成标准

当生产环境具备以下条件时，本阶段完成：

* 生产凭证可用
* 账号状态已更新为 `LIVE`
* 生产接口地址正确
* smoke test 结果成功
* 已监控首批生产订单和 webhook

### 本阶段产出

* 可用的生产环境
* 正式预订能力
* 已完成首轮上线验证

### 重要说明

* 不要在生产环境使用沙箱测试卡。
* 不要用沙箱票价做生产检查。
* 生产凭证必须保存在服务端。
* 确保生产 IP 白名单持续更新。
* 仅 UAT 完成还不足以生成生产凭证。必须先切到 `LIVE`。
* 沙箱环境的地址规则，不代表生产环境也相同。
* 不要把中国地址上的兼容行为视为海外生产地址的默认行为。
* 切换海外生产地址前，先验证 `Accept`、`Accept-Encoding` 和 gzip 处理是否符合预期。

### 相关页面

* [快速开始](/api-wen-dang/ji-cheng-zhi-nan/quick-start.md)
* [UAT 验证](/api-wen-dang/ji-cheng-zhi-nan/quick-start/uat-submission-guide.md)
* [Webhook 概览](/api-wen-dang/ji-cheng-zhi-nan/webhook-gai-lan.md)


---

# Agent Instructions: 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/ji-cheng-zhi-nan/quick-start/sheng-chan-shang-xian.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.
