> ## 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.

# Common API — Voucher PDF/ZIP

> Common API — Voucher PDF/ZIP (POST /common/voucher/pdf): Generate payout voucher PDF files based on order numbers (only when order status is Success or Failed). A single order returns a PDF file; multiple orders are packaged as a ZIP archive. Key request parameters include orderNos.

> [!NOTE]
>
> All example requests on this page are based on the **sandbox (test) environment**. Please be careful to distinguish it from the production environment.

> [!NOTE]
>
> Generate payout voucher PDF files based on payout order numbers (Only when the order status is "Success" or "Failed"). When only one order number is provided, a single PDF file is returned; when multiple orders are provided, a ZIP package containing multiple PDFs is returned.

#### Secret Key & Private Key (Generate Signature)

## Related Topics

* [Common API](https://doc.haipay.net/en/api-reference/overview.md#public-interfaces)
* [HaiPay API Reference Overview](https://doc.haipay.net/en/api-reference/overview.md)
* [HaiPay Configuration and Signature Guide](https://doc.haipay.net/en/get-started/configuration-and-signatures.md)
* [Payout Order Voucher](https://doc.haipay.net/en/operations/voucher.md)
* [Look Up API Response Structure and Error Codes](https://doc.haipay.net/en/resources/error-responses.md)


## OpenAPI

````yaml docs/en/api-reference/common/common.openapi.json POST /common/voucher/pdf
openapi: 3.1.0
info:
  title: Common API
  description: >-
    HaiPay common APIs for account query, statement file download, payout
    voucher, exchange rate query, voucher PDF, and merchant payment config.
  version: 1.0.0
servers:
  - url: https://uat-interface.haipay.asia
    description: 测试-interface
security: []
tags: []
paths:
  /common/voucher/pdf:
    post:
      tags: []
      summary: Voucher PDF/ZIP
      description: >-
        Generate payout voucher PDF files based on order numbers (only when
        order status is Success or Failed). A single order returns a PDF file;
        multiple orders are packaged as a ZIP archive.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                appId:
                  type: integer
                  description: Business ID (obtained from the backend)
                  format: int64
                orderNos:
                  type: array
                  items:
                    type: string
                  description: Payout order number list, at least 1, max 100
                getFee:
                  type: integer
                  description: 'Whether to display fee: 0=hide, 1=show, default: 0'
                isAmount:
                  type: integer
                  description: >-
                    Amount display mode: 0=actual credited amount, 1=order
                    amount, default: 0
                getSubject:
                  type: integer
                  description: 'Whether to display remark: 0=hide, 1=show, default: 0'
                lang:
                  type: string
                  description: 'Voucher language: zh/en, default: zh'
                sign:
                  type: string
                  description: Signature
              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: >-
            Success: single order returns PDF (application/pdf), multiple orders
            return ZIP (application/zip)
          content:
            application/pdf:
              schema:
                type: string
                format: binary
                description: PDF file (single order)
            application/zip:
              schema:
                type: string
                format: binary
                description: ZIP archive (multiple orders)
          headers: {}
        '400':
          description: Parameter validation or signature error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Status code
                  error:
                    type: string
                    description: Error code
                  msg:
                    type: string
                    description: Error message
                  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.