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

# GET /api/billing/payments/{id} — 获取支付状态

> 轮询单笔充值支付的状态：待处理、已支付、失败或已过期。可用时包含提供方参考与支付时间戳。

轮询单笔充值支付的当前状态。`POST /api/billing/payments` 之后使用它来检测钱包何时已入账。

**方法：** `GET` **路径：** `/api/billing/payments/{id}` **认证：** 会话 Bearer

## 路径参数

<ParamField path="id" type="string" required>
  来自 `POST /api/billing/payments` 的支付标识。
</ParamField>

## 响应

<ResponseField name="id" type="string">
  支付标识。
</ResponseField>

<ResponseField name="provider" type="string">
  `stripe`、`wechat` 或 `alipay`。
</ResponseField>

<ResponseField name="amount" type="number">
  以 `currency` 计价的金额。
</ResponseField>

<ResponseField name="currency" type="string">
  `USD` 或 `CNY`。
</ResponseField>

<ResponseField name="status" type="string">
  `pending`、`paid`、`failed` 或 `expired`。
</ResponseField>

<ResponseField name="paid_at" type="string">
  ISO 8601 时间戳或 `null`。
</ResponseField>

<ResponseField name="provider_reference" type="string">
  提供方交易 ID（若可用）。
</ResponseField>

## 示例

```bash theme={null}
curl -H "Authorization: Bearer eyJhbGciOi..." \
  https://ariacompute.cn/api/billing/payments/pay_01H...
```

```json theme={null}
{
  "id": "pay_01H...",
  "provider": "wechat",
  "amount": 100,
  "currency": "CNY",
  "status": "paid",
  "paid_at": "2026-09-23T10:03:12Z",
  "provider_reference": "wx20260..."
}
```

## 错误

| 状态    | 含义            |
| ----- | ------------- |
| `401` | 缺失或无效的会话令牌。   |
| `404` | 当前账户未知的支付 ID。 |
