> ## 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 和 POST /api/billing/invoices — 列出并申请发票

> 列出已开具发票，或为已支付的微信支付 / 支付宝订单申请新的电子发票（电子发票）。仅中国站，按支付幂等。

对发票集合的两种操作：列出账户上的每张发票，或为已支付的中国站付款申请一张新发票。发票按 `payment_id` 幂等；重复申请返回同一条记录。

<Note>
  发票仅适用于中国站。在国际站，请改用[收据](/api-reference/billing/receipt-download)。
</Note>

## GET /api/billing/invoices

**认证：** 会话 Bearer

### 响应

<ResponseField name="invoices" type="object[]">
  <Expandable title="invoice">
    <ResponseField name="id" type="string">
      发票标识。
    </ResponseField>

    <ResponseField name="payment_id" type="string">
      对应的支付 ID。
    </ResponseField>

    <ResponseField name="title" type="string">
      发票抬头（购买方名称）。
    </ResponseField>

    <ResponseField name="tax_id" type="string">
      购买方税号。
    </ResponseField>

    <ResponseField name="amount" type="number">
      发票金额。
    </ResponseField>

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

    <ResponseField name="status" type="string">
      `issued` 或 `pending`。
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 时间戳。
    </ResponseField>
  </Expandable>
</ResponseField>

## POST /api/billing/invoices

**认证：** 会话 Bearer

### 请求

<ParamField body="payment_id" type="string" required>
  待开票的已支付款项。
</ParamField>

<ParamField body="title" type="string" required>
  发票抬头（购买方中文名称）。
</ParamField>

<ParamField body="tax_id" type="string">
  可选的购买方税号（统一社会信用代码）。
</ParamField>

### 响应

返回创建的发票，结构与 GET 响应相同。

## 示例

```bash theme={null}
curl -X POST https://ariacompute.cn/api/billing/invoices \
  -H "Authorization: Bearer eyJhbGciOi..." \
  -H "Content-Type: application/json" \
  -d '{
    "payment_id": "pay_01H...",
    "title": "北京某某科技有限公司",
    "tax_id": "91110000..."
  }'
```

## 错误

| 状态    | 含义                     |
| ----- | ---------------------- |
| `400` | 缺失字段。                  |
| `401` | 缺失或无效的会话令牌。            |
| `404` | 未找到支付或支付未成功。           |
| `409` | 该支付已存在发票（幂等冲突，返回已有记录）。 |
