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

# 公共接口 — 支付凭证PDF/ZIP

> 公共接口 — 支付凭证PDF/ZIP（POST /common/voucher/pdf）：根据代付订单号生成支付凭证PDF文件（仅当订单状态为成功或失败时）。单个订单号返回PDF文件，多个订单号打包为ZIP压缩包返回；关键请求参数含 orderNos。

> [!NOTE]
>
> 本页所有示例请求均基于**沙盒（测试）环境**，请注意区分正式环境。

> [!NOTE]
>
> 根据代付订单号生成支付凭证 PDF 文件(只有当订单状态为成功或失败时)；当只传一个订单号时返回单个 PDF 文件，多笔订单时返回 ZIP 压缩包。

#### 密钥私钥(生成签名)

## 相关主题

* [公共接口](https://doc.haipay.net/docs/zh/api/version2/CommonApi.md)
* [HaiPay API 文档简介](https://doc.haipay.net/zh/history/V20260801/api-reference/overview.md)
* [HaiPay 配置与签名指南](https://doc.haipay.net/zh/history/V20260801/get-started/configuration-and-signatures.md)
* [代付订单凭证](https://doc.haipay.net/zh/history/V20260801/operations/voucher.md)
* [查阅接口响应结构与错误码](https://doc.haipay.net/zh/history/V20260801/guide/error_response_appendix.md)


## OpenAPI

````yaml docs/zh/api-reference/common/common.openapi.json POST /common/voucher/pdf
openapi: 3.1.0
info:
  title: 公共接口 API
  description: HaiPay 公共接口，包括账户查询、对帐文件下载、代付凭证、汇率查询、支付凭证PDF和商户支付配置查询。
  version: 1.0.0
servers:
  - url: https://uat-interface.haipay.asia
    description: 测试-interface
security: []
tags: []
paths:
  /common/voucher/pdf:
    post:
      tags: []
      summary: 支付凭证PDF/ZIP
      description: 根据代付订单号生成支付凭证PDF文件（仅当订单状态为成功或失败时）。单个订单号返回PDF文件，多个订单号打包为ZIP压缩包返回。
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                appId:
                  type: integer
                  description: 业务ID（后台获取）
                  format: int64
                orderNos:
                  type: array
                  items:
                    type: string
                  description: 代付订单号列表，至少1个，最多100个
                getFee:
                  type: integer
                  description: 是否显示手续费：0=不显示，1=显示，默认：0
                isAmount:
                  type: integer
                  description: 金额显示方式：0=使用实际到账金额，1=使用订单金额，默认：0
                getSubject:
                  type: integer
                  description: 是否显示备注信息：0=不显示，1=显示，默认：0
                lang:
                  type: string
                  description: 凭证语言：zh/en，默认：zh
                sign:
                  type: string
                  description: 签名
              required:
                - appId
                - orderNos
                - sign
            example:
              appId: 1054
              orderNos:
                - P233323000059
              getFee: 0
              isAmount: 0
              getSubject: 0
              lang: zh
              sign: >-
                af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw==
        required: true
      responses:
        '200':
          description: 成功响应：单个订单返回 PDF 文件（application/pdf），多个订单返回 ZIP 压缩包（application/zip）
          content:
            application/pdf:
              schema:
                type: string
                format: binary
                description: PDF文件（单个订单）
            application/zip:
              schema:
                type: string
                format: binary
                description: ZIP压缩包（多个订单）
          headers: {}
        '400':
          description: 参数校验失败或签名错误
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: 状态码
                  error:
                    type: string
                    description: 错误码
                  msg:
                    type: string
                    description: 错误信息
                  data:
                    type: 'null'
              example:
                status: '0'
                error: '1002'
                msg: The field 'orderNos' is required
                data: null
      deprecated: false
      security: []

````

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