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

# Upload custom invoice PDF

> Upload a custom-rendered PDF for an invoice that is currently in the Finalizing state. This endpoint is used by external PDF rendering engines that receive the `invoice.pdf.generation_requested` webhook.

**Enterprise Feature**: This endpoint requires the Custom PDF Rendering feature to be enabled.

After upload, Fynn will:
- Optionally embed ZUGFeRD/Factur-X XML data (if configured)
- Continue the invoice finalization process
- Send notifications and trigger payment collection

<sup>Required permissions: `invoice:write`</sup>



## OpenAPI

````yaml post /invoices/{id}/pdf
openapi: 3.1.0
info:
  title: Fynn API
  description: ''
  termsOfService: https://www.fynn.eu/tos
  contact:
    name: Fynn UG (haftungsbeschränkt)
    url: https://www.fynn.eu
    email: hi@fynn.eu
  license:
    name: Proprietary
    url: https://www.fynn.eu/license
  version: 0.0.0
servers:
  - url: https://coreapi.io
    description: Production
  - url: https://preview.coreapi.io
    description: Sandbox
security:
  - JWT: []
tags: []
paths:
  /invoices/{id}/pdf:
    parameters: []
    post:
      tags:
        - Invoice
      summary: Upload custom invoice PDF
      description: >-
        Upload a custom-rendered PDF for an invoice that is currently in the
        Finalizing state. This endpoint is used by external PDF rendering
        engines that receive the `invoice.pdf.generation_requested` webhook.


        **Enterprise Feature**: This endpoint requires the Custom PDF Rendering
        feature to be enabled.


        After upload, Fynn will:

        - Optionally embed ZUGFeRD/Factur-X XML data (if configured)

        - Continue the invoice finalization process

        - Send notifications and trigger payment collection


        <sup>Required permissions: `invoice:write`</sup>
      operationId: uploadInvoicePdf
      parameters:
        - name: id
          in: path
          description: Invoice identifier
          required: true
          deprecated: false
          schema:
            type: string
            format: uuid
          style: simple
          explode: false
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: The PDF file to upload
      responses:
        '200':
          description: PDF uploaded and invoice finalization continued
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The invoice ID
                  status:
                    type: string
                    description: The new invoice status
                  message:
                    type: string
                    description: Success message
        '404':
          description: Invoice not found
        '409':
          description: Invoice is not in Finalizing state
        '422':
          description: Uploaded file is not a valid PDF
      deprecated: false
      security:
        - JWT:
            - invoice:write
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl -X POST \
             /invoices/{id}/pdf \
             --header "Authorization: Bearer <token>" \
             --form "file=@invoice.pdf"
components:
  securitySchemes:
    JWT:
      type: http
      scheme: bearer

````