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

# 下载付款证明

下载已完成的一笔或多笔付款交易的付款证明（POP）文件。

提交处于 `Completed` 状态的付款交易的 `internalId` 或 `externalId` 值数组。响应是 base64 编码的 ZIP 压缩包，其中每笔所请求的交易对应一份 PDF 付款证明。

> [!NOTE]
>
> 同一请求数组中支持混合使用 `internalId` 和 `externalId` 值。


## OpenAPI

````yaml openapi/zh/localpayment.json POST /api/v1/payouts/proof-of-payment
openapi: 3.1.0
info:
  version: '1.0'
  title: Localpayment
  contact:
    name: Support
    url: mailto:support@localpayment.com
servers:
  - url: https://api.stage.localpayment.com
    description: Stage
security:
  - token: []
paths:
  /api/v1/payouts/proof-of-payment:
    post:
      summary: 下载付款证明
      operationId: download-payout-proof-of-payment
      parameters:
        - name: Authorization
          in: header
          description: >-
            用于身份验证的 Bearer
            访问令牌。该令牌可从[获取访问令牌](/zh/reference/get-token)或[刷新访问令牌](/zh/reference/refresh-token)endpoint
            获取。
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: array
              description: >-
                要生成付款证明文件的交易标识符列表。接受 `internalId` 或 `externalId`
                值，可在同一请求中混合使用。每笔交易都必须处于 `Completed` 状态。
              items:
                type: string
              example:
                - 550e8400-e29b-41d4-a716-446655440000
                - f47ac10b-58cc-4372-a567-0e02b2c3d479
              x-examples:
                Example 1:
                  - 550e8400-e29b-41d4-a716-446655440000
                  - f47ac10b-58cc-4372-a567-0e02b2c3d479
            examples:
              Example 1 - Two internalId/externalId values:
                value:
                  - 550e8400-e29b-41d4-a716-446655440000
                  - f47ac10b-58cc-4372-a567-0e02b2c3d479
        required: true
      responses:
        '200':
          description: >-
            好的。响应正文是 ZIP 压缩包本身，以 base64 编码的纯文本形式返回（未封装在 JSON 字段中），其中包含每个请求交易的
            PDF 付款证明。已与实际捕获的数据进行比对：解码后的字节以 ZIP 文件签名开头（`PK\x03\x04`）。
          content:
            application/json:
              schema:
                type: string
                format: byte
                description: >-
                  包含所请求的付款证明 PDF 文件的 Base64 编码 ZIP 压缩包。直接解码此字符串即可获取 ZIP
                  文件，其中不包含任何 JSON 对象。
              examples:
                Example 1 - Base64-encoded ZIP (truncated):
                  value: UEsFBgAAAAAAAAAAAAAAAAAAAAAAAA==
        '401':
          description: 未经授权。访问令牌缺失、无效或已过期。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 回复的补充信息。
                  code:
                    type: string
                    description: 状态码。
                  messages:
                    type: array
                    description: 消息列表。
                    items:
                      type: object
                      properties:
                        token_class:
                          type: string
                          description: Token 类。
                        token_type:
                          type: string
                          description: 令牌类型。
                        message:
                          type: string
                          description: 包含补充信息的消息。
                x-examples:
                  Example 1:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
              examples:
                token_not_valid - Token invalid or expired:
                  value:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
        '403':
          description: 禁止。付款证明仅适用于状态为 `Completed` 的交易。
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: 错误代码。
                  message:
                    type: string
                    description: 易于理解的错误信息。
                  invalid_transactions:
                    type: array
                    description: 状态不适用于付款证明的交易。
                    items:
                      type: object
                      properties:
                        transaction_id:
                          type: string
                          description: 无效交易的 internalId 或 externalId。
                        current_status:
                          type: string
                          description: 交易的当前状态。
                x-examples:
                  Example 1:
                    error: INVALID_STATUS
                    message: >-
                      Proof of Payment is only available for Completed
                      transactions
                    invalid_transactions:
                      - transaction_id: 5aced5da-40c1-4bec-85ff-c8cd1bcb4526
                        current_status: Cancelled
              examples:
                INVALID_STATUS - Transaction not Completed:
                  value:
                    error: INVALID_STATUS
                    message: >-
                      Proof of Payment is only available for Completed
                      transactions
                    invalid_transactions:
                      - transaction_id: 5aced5da-40c1-4bec-85ff-c8cd1bcb4526
                        current_status: Cancelled
        '404':
          description: 未找到。所请求的交易标识符均不具备可用的付款证明信息。
          content:
            application/json:
              schema:
                type: object
                properties:
                  Status:
                    type: integer
                    description: HTTP状态码。
                  Code:
                    type: string
                    nullable: true
                    description: 内部错误代码（如有）。
                  Message:
                    type: string
                    description: 易于理解的错误信息。
                  TraceId:
                    type: string
                    description: 用于支持目的的跟踪标识符。
                x-examples:
                  Example 1:
                    Status: 404
                    Code: null
                    Message: There is no payments information to generate the file
                    TraceId: 6a907fb4000000001f723f645b1fdee3
              examples:
                404 - No payment information:
                  value:
                    Status: 404
                    Code: null
                    Message: There is no payments information to generate the file
                    TraceId: 6a907fb4000000001f723f645b1fdee3
      security:
        - token: []
components:
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

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