> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyway.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# 沙盒测试环境

> 使用 Anyway 沙盒测试环境的地址测试集成，再切换到生产环境。

使用 Anyway 的**沙盒测试环境**测试集成。对接时，请将生产环境地址替换为下表中对应的沙盒测试环境地址。

> [!WARNING]
>
> 沙盒测试环境的功能可能不稳定，数据可能随时被清除。

## 环境地址

| 服务 | 沙盒测试环境 | 生产环境 |
| - | - | - |
| 商户 API | `https://merchant-api-stg.anyway.sh` | `https://merchant-api-prod.anyway.sh` |
| Webhook 签名验证：获取公钥 | `https://webapp-api-stg.anyway.sh/v1/webhooks/signing-key` | `https://api.anyway.sh/v1/webhooks/signing-key` |
| Web 应用 / 控制台 | `https://stg.anyway.sh` | `https://app.anyway.sh` |
| 支付链接（示例） | `https://stg.anyway.sh/pay/PL86fdCVV...` | `https://pay.anyway.sh/pay/PL34GUI...` |

上面的支付链接仅用于展示 URL 格式。实际使用时，请使用对应环境中创建的完整支付链接。

## 认证方式与 API 路径

沙盒测试环境和生产环境使用相同的认证方式与 API 路径。例如，商户 API 在两个环境中都使用 `X-API-Key` 请求头。切换地址时，保持 API 路径和请求格式不变：

* `/v1/product`
* `/v1/orders`
* `/v1/subscriptions`
* `/v1/customers`
* `/v1/entitlements/check`

请求详情请参阅[商户 API](https://docs.anyway.sh/zh/api-reference/merchant-api.md)，签名验证方法请参阅 [Webhook](https://docs.anyway.sh/zh/features/webhooks.md)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.