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

# 下载发票 PDF

> 以 PDF 文件（`application/pdf`）形式直接返回发票——不经重定向

```
GET /openapi/memorylake/admin/v1/billing/invoices/{invoice_id}/pdf
```

以 PDF 文件（`application/pdf`）形式直接返回发票——不经重定向。已保存开票信息时，返回包含这些信息的版本；否则返回支付服务商自己的版本。若服务商尚未为该发票生成 PDF，返回 409。

<Note>
  **所需权限：** `invoice:read`
</Note>

### 路径参数

<ParamField path="invoice_id" type="string" required>
  发票 ID（`invoice_id`）
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET 'https://app.memorylake.ai/openapi/memorylake/admin/v1/billing/invoices/2501a637ff332794f7dc5edee0556e67/pdf' \
    -H 'Authorization: Bearer sk_xxxxxx'
  ```
</RequestExample>

### 响应

以 PDF 文件返回发票（`Content-Type: application/pdf`）。

### 错误

出错时返回 `success: false`、`message` 和 `error_code`。全部错误码见[错误码](/zh/features/memorylake/api-reference/errors)。

| 状态码 | 含义 |
| - | - |
| `401` | API Key 缺失、无效、已停用或已过期 |
| `403` | 该 Key 无权执行此操作 |
| `404` | 资源不存在 |
| `409` | 请求与当前状态冲突，例如重复或已达上限 |
| `422` | 请求体或参数未通过校验 |
| `429` | 请求过多，请按 `Retry-After` 等待后重试 |
| `500` | 服务端错误 |
| `503` | 暂时不可用，请稍后重试 |


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