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

# Download PDF

> Generates and downloads a PDF file for the selected invoice.



## OpenAPI

````yaml https://logistics.api.smartcp.org/openapi/invoices.openapi.json GET /invoices/{invoice_id}/pdf
openapi: 3.0.3
info:
  title: SmartCP Logistics Invoices API
  version: 1.0.0
  description: >-
    Invoice listing and PDF download endpoints for the SmartCP Logistics public
    REST API.
servers:
  - url: https://logistics.api.smartcp.org/v1
    description: Production
security:
  - bearerAuth: []
    directoryHeader: []
paths:
  /invoices/{invoice_id}/pdf:
    get:
      summary: Download PDF
      description: Generates and downloads a PDF file for the selected invoice.
      operationId: downloadInvoicePdf
      parameters:
        - name: invoice_id
          in: path
          required: true
          description: Invoice ID.
          schema:
            type: integer
          example: 1045
        - name: locale
          in: query
          description: 'Two-letter document language code. Default: `en`.'
          schema:
            type: string
            enum:
              - cs
              - de
              - en
              - pl
              - ro
              - tr
            minLength: 2
            maxLength: 2
            example: en
        - name: duplicate
          in: query
          description: When set to `true`, marks the document as a duplicate copy.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: PDF file generated successfully
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '401':
          $ref: '#/components/responses/UnauthorizedResponse'
        '404':
          description: Invoice not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringErrorResponse'
              example:
                status: 404
                message: Invoice not found
                data: null
        '422':
          $ref: '#/components/responses/ValidationErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequestsResponse'
components:
  responses:
    UnauthorizedResponse:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StringErrorResponse'
          example:
            status: 401
            message: Authentication failed
            data: null
    ValidationErrorResponse:
      description: Validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StringErrorResponse'
          example:
            status: 422
            message: The given data was invalid.
            data: null
    TooManyRequestsResponse:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StringErrorResponse'
          example:
            status: 429
            message: Too Many Attempts.
            data: null
  schemas:
    StringErrorResponse:
      type: object
      required:
        - status
        - message
        - data
      properties:
        status:
          type: integer
          example: 401
        message:
          type: string
          example: Authentication failed
        data:
          nullable: true
          example: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: Client API key sent as a bearer token.
    directoryHeader:
      type: apiKey
      in: header
      name: X-Client-Directory
      description: >-
        Client directory identifier. Legacy `directory` header is still accepted
        for backward compatibility.

````