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

# Download invoice PDF

> Renders the invoice and returns the resulting PDF as a binary stream.

The response body is the raw PDF binary. The `Content-Disposition` header includes a suggested filename based on the invoice number.

If you only need a public link rather than the bytes, the full invoice representation includes a `publicPdfUrl` field that can be shared without an API token.


## OpenAPI

````yaml GET /v1/invoices/{invoiceId}/pdf
openapi: 3.1.0
info:
  title: infinity.swiss Open API
  version: '1.0'
  summary: ''
servers:
  - url: https://api.infinity.swiss
security:
  - apiKey: []
paths:
  /v1/invoices/{invoiceId}/pdf:
    parameters:
      - schema:
          type: string
        name: invoiceId
        in: path
        description: The id of the invoice to render.
        required: true
    get:
      tags: []
      summary: Download invoice PDF
      description: Renders the invoice and returns the resulting PDF as a binary stream.
      operationId: download-invoice-pdf-v1
      responses:
        '200':
          description: The invoice PDF.
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '401':
          $ref: '#/components/responses/Unauthorised'
        '404':
          $ref: '#/components/responses/CustomerInvoiceNotFound'
components:
  responses:
    Unauthorised:
      description: >-
        An unauthorised request was submitted. You may be using an incorrect or
        expired API token, or are attempting to access a document outside of the
        scope of the token.
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                x-stoplight:
                  id: 08hkw8ukmi2lp
                description: Specific error code
          examples:
            Unauthorised request:
              value:
                code: general/unauthorised
    CustomerInvoiceNotFound:
      description: >-
        No invoice or estimate with the given id could be found in this
        organisation. Also returned when the id refers to the other kind of
        document, e.g. an estimate id on an invoice endpoint.
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                description: Specific error code.
          examples:
            Not found:
              value:
                code: customer-invoice/not-found
  securitySchemes:
    apiKey:
      name: x-api-token
      type: apiKey
      in: header
      description: >-
        API token for authentication. Obtain from your Infinity account
        settings.

````