openapi: 3.0.0
info:
  title: KSEF API
  description: API for the KSeF system
  version: 2.0.7
tags:
  - name: box
    description: High-level functions simplifying and automating the entire process (so-called black-box)
  - name: invoice
    description: Basic functions for sending and receiving invoices
servers:
  - url: https://ksefapi.pl/api
    description: Production environment
  - url: https://ksefapi.pl/api-test
    description: Test environment
paths:
  '/box/upload/invoice':
    post:
      operationId: boxUploadInvoice
      summary: Send invoice to KSeF
      tags:
        - box
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BoxUploadInvoiceRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BoxUploadInvoiceResponse'
        default:
          $ref: '#/components/responses/Error'
  '/box/upload/invoice/{uploadId}':
    get:
      operationId: boxUploadInvoiceStatus
      summary: Retrieve status of invoice sent to KSeF
      tags:
        - box
      parameters:
        - $ref: '#/components/parameters/UploadId'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BoxUploadInvoiceStatusResponse'
        default:
          $ref: '#/components/responses/Error'
  '/box/upload/batch':
    post:
      operationId: boxUploadBatch
      summary: Send invoice batch to KSeF
      tags:
        - box
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                request:
                  $ref: '#/components/schemas/BoxUploadBatchRequest'
                file:
                  type: string
                  format: binary
              required:
                - request
                - file
            encoding:
              request:
                contentType: application/json
              file:
                contentType: application/zip
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BoxUploadBatchResponse'
        default:
          $ref: '#/components/responses/Error'
  '/box/upload/batch/{uploadId}':
    get:
      operationId: boxUploadBatchStatus
      summary: Retrieve status of invoice batch sent to KSeF
      tags:
        - box
      parameters:
        - $ref: '#/components/parameters/UploadId'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BoxUploadBatchStatusResponse'
        default:
          $ref: '#/components/responses/Error'
  '/box/download/invoices':
    post:
      operationId: boxDownloadInvoices
      summary: Submit request to download invoices from KSeF
      tags:
        - box
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BoxDownloadInvoicesRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BoxDownloadInvoicesResponse'
        default:
          $ref: '#/components/responses/Error'
  '/box/download/invoices/{downloadId}':
    get:
      operationId: boxDownloadInvoicesResult
      summary: Retrieve result of invoice download request from KSeF
      tags:
        - box
      parameters:
        - $ref: '#/components/parameters/DownloadId'
      responses:
        '200':
          description: Success
          content:
            application/zip:
              schema:
                type: string
                format: binary
                description: ZIP package with XML invoices
        default:
          $ref: '#/components/responses/Error'
  '/invoice/public/key':
    get:
      operationId: ksefPublicKey
      summary: Retrieve KSeF public key
      tags:
        - invoice
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KsefPublicKeyResponse'
        default:
          $ref: '#/components/responses/Error'
  '/invoice/session/open/online':
    post:
      operationId: ksefSessionOpenOnline
      summary: Open interactive session for sending invoices
      tags:
        - invoice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KsefSessionOpenOnlineRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KsefSessionOpenOnlineResponse'
        default:
          $ref: '#/components/responses/Error'
  '/invoice/session/open/batch':
    post:
      operationId: ksefSessionOpenBatch
      summary: Open batch session for sending invoices
      tags:
        - invoice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KsefSessionOpenBatchRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KsefSessionOpenBatchResponse'
        default:
          $ref: '#/components/responses/Error'
  '/invoice/session/status/{sessionId}':
    get:
      operationId: ksefSessionStatus
      summary: Current session status
      tags:
        - invoice
      parameters:
        - $ref: '#/components/parameters/SessionId'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KsefSessionStatusResponse'
        default:
          $ref: '#/components/responses/Error'
  '/invoice/session/close/{sessionId}':
    get:
      operationId: ksefSessionClose
      summary: Close interactive or batch session for sending invoices
      tags:
        - invoice
      parameters:
        - $ref: '#/components/parameters/SessionId'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KsefSessionCloseResponse'
        default:
          $ref: '#/components/responses/Error'
  '/invoice/session/invoices/{sessionId}':
    get:
      operationId: ksefSessionInvoices
      summary: Retrieve list of all invoices submitted in the session with their statuses
      tags:
        - invoice
      parameters:
        - $ref: '#/components/parameters/SessionId'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KsefSessionInvoicesResponse'
        default:
          $ref: '#/components/responses/Error'
  '/invoice/session/upo/{sessionId}':
    get:
      operationId: ksefSessionUpo
      summary: Retrieve UPO
      tags:
        - invoice
      parameters:
        - $ref: '#/components/parameters/SessionId'
      responses:
        '200':
          description: Success
          content:
            text/xml:
              schema:
                type: string
                format: binary
                description: XML with UPO
        default:
          $ref: '#/components/responses/Error'
  '/invoice/generate':
    post:
      operationId: ksefInvoiceGenerate
      summary: Generate invoice XML
      tags:
        - invoice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KsefInvoiceGenerateRequest'
      responses:
        '200':
          description: Success
          content:
            text/xml:
              schema:
                type: string
                format: binary
                description: Invoice XML
        default:
          $ref: '#/components/responses/Error'
  '/invoice/validate':
    post:
      operationId: ksefInvoiceValidate
      summary: Validate invoice format
      tags:
        - invoice
      requestBody:
        required: true
        content:
          text/xml:
            schema:
              type: string
              format: binary
              description: Invoice XML
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KsefInvoiceValidateResponse'
        default:
          $ref: '#/components/responses/Error'
  '/invoice/send':
    post:
      operationId: ksefInvoiceSend
      summary: Submit invoice
      tags:
        - invoice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KsefInvoiceSendRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KsefInvoiceSendResponse'
        default:
          $ref: '#/components/responses/Error'
  '/invoice/status/{invoiceId}':
    get:
      operationId: ksefInvoiceStatus
      summary: Retrieve invoice processing status
      tags:
        - invoice
      parameters:
        - $ref: '#/components/parameters/InvoiceId'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KsefInvoiceStatusResponse'
        default:
          $ref: '#/components/responses/Error'
  '/invoice/get/{invoiceKsefNumber}':
    get:
      operationId: ksefInvoiceGet
      summary: Retrieve invoice
      tags:
        - invoice
      parameters:
        - $ref: '#/components/parameters/InvoiceKsefNumber'
      responses:
        '200':
          description: Success
          content:
            text/xml:
              schema:
                type: string
                format: binary
                description: Invoice XML
        default:
          $ref: '#/components/responses/Error'
  '/invoice/query/start':
    post:
      operationId: ksefInvoiceQueryStart
      summary: Start invoice search process
      tags:
        - invoice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KsefInvoiceQueryStartRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KsefInvoiceQueryStartResponse'
        default:
          $ref: '#/components/responses/Error'
  '/invoice/query/status/{queryId}':
    get:
      operationId: ksefInvoiceQueryStatus
      summary: Retrieve invoice search process status
      tags:
        - invoice
      parameters:
        - $ref: '#/components/parameters/QueryId'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KsefInvoiceQueryStatusResponse'
        default:
          $ref: '#/components/responses/Error'
  '/invoice/query/result/{queryId}/{partNumber}':
    get:
      operationId: ksefInvoiceQueryResult
      summary: Retrieve search result
      tags:
        - invoice
      parameters:
        - $ref: '#/components/parameters/QueryId'
        - $ref: '#/components/parameters/QueryPartNumber'
      responses:
        '200':
          description: Success
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
                description: Encrypted ZIP archive with XML invoices
        default:
          $ref: '#/components/responses/Error'
  '/invoice/links':
    post:
      operationId: ksefInvoiceLinks
      summary: Generate invoice URL links and QR codes
      tags:
        - invoice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KsefInvoiceLinksRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KsefInvoiceLinksResponse'
        default:
          $ref: '#/components/responses/Error'
  '/invoice/visualize':
    post:
      operationId: ksefInvoiceVisualize
      summary: Generate invoice visualization
      tags:
        - invoice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KsefInvoiceVisualizeRequest'
      responses:
        '200':
          description: Success
          content:
            text/html:
              schema:
                type: string
                format: binary
                description: Visualization in HTML format
            application/pdf:
              schema:
                type: string
                format: binary
                description: Visualization in PDF format
        default:
          $ref: '#/components/responses/Error'
security:
  - basicAuth: []
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  parameters:
    SessionId:
      in: path
      name: sessionId
      description: Session identifier
      required: true
      schema:
        type: string
    InvoiceId:
      name: invoiceId
      in: path
      description: Invoice identifier (technical)
      required: true
      schema:
        type: string
    InvoiceKsefNumber:
      name: invoiceKsefNumber
      in: path
      description: KSeF invoice number
      required: true
      schema:
        type: string
    QueryId:
      in: path
      name: queryId
      description: Search process identifier
      required: true
      schema:
        type: string
    QueryPartNumber:
      in: path
      name: partNumber
      description: Identifier of a part of the invoice search order result
      required: true
      schema:
        type: string
    UploadId:
      in: path
      name: uploadId
      description: Identifier of the submitted invoice or invoice batch
      required: true
      schema:
        type: string
    DownloadId:
      in: path
      name: downloadId
      description: Identifier of the downloaded invoice batch
      required: true
      schema:
        type: string
    UserLogin:
      in: path
      name: login
      description: User login
      required: true
      schema:
        type: string
  schemas:
    KsefPublicKeyResponse:
      type: object
      properties:
        algorithm:
          type: string
          enum: [RSA]
        publicKey:
          type: string
          format: byte
      required:
        - algorithm
        - publicKey
    KsefInvoiceVersion:
      type: string
      enum: [v2, v3]
    EncryptionInfo:
      type: object
      properties:
        initVector:
          type: string
          format: byte
        encryptedKey:
          type: string
          format: byte
      required:
        - initVector
        - encryptedKey
    KsefSessionOpenOnlineRequest:
      type: object
      properties:
        invoiceVersion:
          $ref: '#/components/schemas/KsefInvoiceVersion'
        encryptionInfo:
          $ref: '#/components/schemas/EncryptionInfo'
      required:
        - invoiceVersion
        - encryptionInfo
    KsefSessionOpenOnlineResponse:
      type: object
      properties:
        id:
          type: string
        created:
          type: string
          format: date-time
      required:
        - id
        - created
    BatchPartInfo:
      type: object
      properties:
        ordinal:
          type: integer
          format: int32
        partSize:
          type: integer
          format: int64
        partHash:
          type: string
          format: byte
      required:
        - ordinal
        - partSize
        - partHash
    BatchInfo:
      type: object
      properties:
        batchSize:
          type: integer
          format: int32
        batchHash:
          type: string
          format: byte
        batchParts:
          type: array
          items:
            $ref: '#/components/schemas/BatchPartInfo'
          maxItems: 50
      required:
        - batchSize
        - batchHash
        - batchParts
    KsefSessionOpenBatchRequest:
      type: object
      properties:
        invoiceVersion:
          $ref: '#/components/schemas/KsefInvoiceVersion'
        encryptionInfo:
          $ref: '#/components/schemas/EncryptionInfo'
        offline:
          type: boolean
        batchInfo:
          $ref: '#/components/schemas/BatchInfo'
      required:
        - invoiceVersion
        - encryptionInfo
        - offline
        - batchInfo
    PartUploadHeader:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
      required:
        - name
        - value
    PartUploadInfo:
      type: object
      properties:
        ordinal:
          type: integer
          format: int32
        method:
          type: string
        url:
          type: string
        headers:
          type: array
          items:
            $ref: '#/components/schemas/PartUploadHeader'
      required:
        - ordinal
        - method
        - url
        - headers
    KsefSessionOpenBatchResponse:
      type: object
      properties:
        id:
          type: string
        partUploads:
          type: array
          items:
            $ref: '#/components/schemas/PartUploadInfo'
          maxItems: 50
      required:
        - id
        - partUploads
    SessionInfo:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/StatusInfo'
        batch:
          type: boolean
        invoiceCount:
          type: integer
          format: int32
        successfulInvoiceCount:
          type: integer
          format: int32
        failedInvoiceCount:
          type: integer
          format: int32
      required:
        - status
    KsefSessionStatusResponse:
      type: object
      properties:
        sessionInfo:
          $ref: '#/components/schemas/SessionInfo'
      required:
        - sessionInfo
    KsefSessionCloseResponse:
      type: object
      properties:
        result:
          type: boolean
      required:
        - result
    KsefSessionInvoicesResponse:
      type: object
      properties:
        invoices:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceInfo'
      required:
        - invoices
    KsefInvoiceGenerateRequest:
      type: object
      properties:
        invoice:
          $ref: '#/components/schemas/Faktura'
      required:
        - invoice
    KsefInvoiceValidateResponse:
      type: object
      properties:
        valid:
          type: boolean
        invoiceVersion:
          $ref: '#/components/schemas/KsefInvoiceVersion'
        canonicalForm:
          type: string
          format: byte
      required:
        - valid
        - invoiceVersion
        - canonicalForm
    KsefInvoiceEncrypted:
      type: object
      properties:
        invoiceSize:
          type: integer
          format: int32
        invoiceHash:
          type: string
          format: byte
        encryptedInvoice:
          type: string
          format: byte
      required:
        - invoiceSize
        - invoiceHash
        - encryptedInvoice
    KsefInvoiceSendRequest:
      type: object
      properties:
        sessionId:
          type: string
        encrypted:
          $ref: '#/components/schemas/KsefInvoiceEncrypted'
      required:
        - sessionId
        - encrypted
    KsefInvoiceSendResponse:
      type: object
      properties:
        id:
          type: string
        created:
          type: string
          format: date-time
      required:
        - id
        - created
    KsefInvoiceStatusResponse:
      type: object
      properties:
        invoiceInfo:
          $ref: '#/components/schemas/InvoiceInfo'
      required:
        - invoiceInfo
    KsefInvoiceQueryStartRange:
      type: object
      properties:
        from:
          type: string
          format: date-time
        to:
          type: string
          format: date-time
      required:
        - from
        - to
    KsefInvoiceQueryStartRequest:
      type: object
      properties:
        encryptionInfo:
          $ref: '#/components/schemas/EncryptionInfo'
        subjectType:
          type: string
          enum: [Subject1, Subject2, Subject3, SubjectAuthorized]
        range:
          $ref: '#/components/schemas/KsefInvoiceQueryStartRange'
      required:
        - encryptionInfo
        - subjectType
        - range
    KsefInvoiceQueryStartResponse:
      type: object
      properties:
        queryId:
          type: string
      required:
        - queryId
    KsefInvoiceQueryStatusResponse:
      type: object
      properties:
        numberOfInvoices:
          type: integer
          format: int32
        packageSize:
          type: integer
          format: int32
        isTruncated:
          type: boolean
        truncatedAt:
          type: string
          format: date-time
        partNumbers:
          type: array
          items:
            type: string
      required:
        - numberOfInvoices
        - packageSize
        - isTruncated
        - partNumbers
    KsefInvoiceLinksRequest:
      type: object
      properties:
        nip:
          type: string
        issueDate:
          type: string
          format: date
        invoiceHash:
          type: string
          format: byte
        invoiceKsefNumber:
          type: string
      required:
        - nip
        - issueDate
        - invoiceHash
    KsefQrCode:
      type: object
      properties:
        link:
          type: string
        image:
          type: string
      required:
        - link
        - image
    KsefInvoiceLinksResponse:
      type: object
      properties:
        invoice:
          $ref: '#/components/schemas/KsefQrCode'
        certificate:
          $ref: '#/components/schemas/KsefQrCode'
      required:
        - invoice
    KsefInvoiceVisualizeRequest:
      type: object
      properties:
        templateName:
          type: string
        offline:
          type: boolean
        invoiceKsefNumber:
          type: string
        invoiceData:
          type: string
          format: byte
        outputFormat:
          type: string
          enum: [html, pdf]
        outputLanguage:
          type: string
          enum: [pl]
      required:
        - offline
        - invoiceData
        - outputFormat
        - outputLanguage
    BoxUploadInvoiceRequest:
      type: object
      properties:
        uploadId:
          type: string
        offline:
          type: boolean
        notify:
          type: boolean
        upo:
          type: boolean
        invoiceData:
          type: string
          format: byte
      required:
        - uploadId
        - offline
        - notify
        - invoiceData
    BoxUploadInvoiceResponse:
      type: object
      properties:
        result:
          type: boolean
      required:
        - result
    BoxUploadBatchRequest:
      type: object
      properties:
        uploadId:
          type: string
        offline:
          type: boolean
        notify:
          type: boolean
        upo:
          type: boolean
        invoiceVersion:
          $ref: '#/components/schemas/KsefInvoiceVersion'
      required:
        - uploadId
        - offline
        - notify
        - invoiceVersion
    BoxUploadBatchResponse:
      type: object
      properties:
        result:
          type: boolean
      required:
        - result
    BoxDownloadInvoicesRequest:
      type: object
      properties:
        downloadId:
          type: string
        notify:
          type: boolean
        subjectType:
          type: string
          enum: [Subject1, Subject2, Subject3, SubjectAuthorized]
        range:
          $ref: '#/components/schemas/KsefInvoiceQueryStartRange'
      required:
        - downloadId
        - notify
        - subjectType
        - range
    BoxDownloadInvoicesResponse:
      type: object
      properties:
        result:
          type: boolean
      required:
        - result
    StatusInfoAttribute:
      type: object
      properties:
        key:
          type: string
        value:
          type: string
      required:
        - key
        - value
    StatusInfo:
      type: object
      properties:
        code:
          type: integer
          format: int32
        description:
          type: string
        details:
          type: string
        extensions:
          type: array
          items:
            $ref: '#/components/schemas/StatusInfoAttribute'
      required:
        - code
        - description
    InvoiceInfo:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/StatusInfo'
        ordinal:
          type: integer
          format: int32
        invoiceNumber:
          type: string
        ksefNumber:
          type: string
        acquisitionDate:
          type: string
          format: date-time
        permanentStorageDate:
          type: string
          format: date-time
        invoicingMode:
          type: string
          enum: [online, offline]
      required:
        - status
    BoxUploadInvoiceStatusResponse:
      type: object
      properties:
        uploadId:
          type: string
        invoiceInfo:
          $ref: '#/components/schemas/InvoiceInfo'
        sessionId:
          type: string
        upo:
          type: string
          format: byte
      required:
        - uploadId
        - invoiceInfo
        - sessionId
    BoxUploadBatchStatusResponse:
      type: object
      properties:
        uploadId:
          type: string
        invoiceInfo:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceInfo'
        sessionId:
          type: string
        upo:
          type: string
          format: byte
      required:
        - uploadId
        - invoiceInfo
        - sessionId
    Error:
      type: object
      properties:
        code:
          type: integer
          format: int32
        description:
          type: string
        details:
          type: string
      required:
        - code
        - description
    ErrorResult:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/Error'
      required:
        - error
    Faktura:
      description: VAT invoice
      type: object
      properties:
        Naglowek:
          $ref: '#/components/schemas/TNaglowek'
        Podmiot1:
          $ref: '#/components/schemas/Podmiot1'
        Podmiot2:
          $ref: '#/components/schemas/Podmiot2'
        Podmiot3:
          type: array
          items:
            $ref: '#/components/schemas/Podmiot3'
          maxItems: 100
        PodmiotUpowazniony:
          $ref: '#/components/schemas/PodmiotUpowazniony'
        Fa:
          $ref: '#/components/schemas/Fa'
        Stopka:
          $ref: '#/components/schemas/Stopka'
        Zalacznik:
          type: object
          properties:
            BlokDanych:
              type: array
              items:
                $ref: '#/components/schemas/BlokDanych'
              maxItems: 1000
    Podmiot3:
      description: Data of third-party entity/entities (other than the seller and the buyer listed in Podmiot2)
        related to the invoice
      allOf:
        - $ref: '#/components/schemas/Podmiot3Dane'
        - oneOf:
            - $ref: '#/components/schemas/Podmiot3Rola'
            - $ref: '#/components/schemas/Podmiot3RolaInna'
    Podmiot3Dane:
      type: object
      properties:
        IDNabywcy:
          $ref: '#/components/schemas/IDNabywcy'
        NrEORI:
          $ref: '#/components/schemas/TZnakowy'
        DaneIdentyfikacyjne:
          $ref: '#/components/schemas/TPodmiot3'
        Adres:
          $ref: '#/components/schemas/TAdres'
        AdresKoresp:
          $ref: '#/components/schemas/TAdres'
        DaneKontaktowe:
          type: array
          items:
            $ref: '#/components/schemas/DaneKontaktowe'
          maxItems: 3
        Udzial:
          $ref: '#/components/schemas/TProcentowy'
        NrKlienta:
          $ref: '#/components/schemas/TZnakowy'
    Podmiot3Rola:
      type: object
      properties:
        Rola:
          $ref: '#/components/schemas/TRolaPodmiotu3'
    Podmiot3RolaInna:
      type: object
      properties:
        RolaInna:
          $ref: '#/components/schemas/TWybor1'
        OpisRoli:
          $ref: '#/components/schemas/TZnakowy'
    Stopka:
      description: Other data on the invoice
      type: object
      properties:
        Informacje:
          type: array
          items:
            $ref: '#/components/schemas/Informacje'
          maxItems: 3
        Rejestry:
          type: array
          items:
            $ref: '#/components/schemas/Rejestry'
          maxItems: 100
    Podmiot1:
      description: Taxpayer data. First and last name or business name of the seller of goods or services
      type: object
      properties:
        PrefiksPodatnika:
          $ref: '#/components/schemas/TKodyKrajowUE'
        NrEORI:
          $ref: '#/components/schemas/TZnakowy'
        DaneIdentyfikacyjne:
          $ref: '#/components/schemas/TPodmiot1'
        Adres:
          $ref: '#/components/schemas/TAdres'
        AdresKoresp:
          $ref: '#/components/schemas/TAdres'
        DaneKontaktowe:
          type: array
          items:
            $ref: '#/components/schemas/DaneKontaktowe'
          maxItems: 3
        StatusInfoPodatnika:
          $ref: '#/components/schemas/TStatusInfoPodatnika'
    TNaglowek:
      description: Header
      type: object
      properties:
        KodFormularza:
          $ref: '#/components/schemas/TKodFormularza'
        WariantFormularza:
          $ref: '#/components/schemas/WariantFormularza'
        DataWytworzeniaFa:
          $ref: '#/components/schemas/DataWytworzeniaFa'
        SystemInfo:
          $ref: '#/components/schemas/TZnakowy'
    Fa:
      description: Based on Art. 106a-106q of the Act. Fields concerning sales value
        and tax are completed in the currency in which the invoice was issued, except
        for fields concerning tax converted in accordance with the provisions of Chapter VI
        in conjunction with Art. 106e(11) of the Act. If a corrective invoice is issued,
        all fields are completed according to the post-correction state, and fields concerning
        the tax base, tax, and total amount due are completed as the difference
      allOf:
        - type: object
          properties:
            KodWaluty:
              $ref: '#/components/schemas/TKodWaluty'
            P_1:
              $ref: '#/components/schemas/TDataT'
            P_1M:
              $ref: '#/components/schemas/TZnakowy'
            P_2:
              $ref: '#/components/schemas/TZnakowy'
            WZ:
              type: array
              items:
                $ref: '#/components/schemas/TZnakowy'
              maxItems: 1000
            P_13_1:
              $ref: '#/components/schemas/TKwotowy'
            P_14_1:
              $ref: '#/components/schemas/TKwotowy'
            P_14_1W:
              $ref: '#/components/schemas/TKwotowy'
            P_13_2:
              $ref: '#/components/schemas/TKwotowy'
            P_14_2:
              $ref: '#/components/schemas/TKwotowy'
            P_14_2W:
              $ref: '#/components/schemas/TKwotowy'
            P_13_3:
              $ref: '#/components/schemas/TKwotowy'
            P_14_3:
              $ref: '#/components/schemas/TKwotowy'
            P_14_3W:
              $ref: '#/components/schemas/TKwotowy'
            P_13_4:
              $ref: '#/components/schemas/TKwotowy'
            P_14_4:
              $ref: '#/components/schemas/TKwotowy'
            P_14_4W:
              $ref: '#/components/schemas/TKwotowy'
            P_13_5:
              $ref: '#/components/schemas/TKwotowy'
            P_14_5:
              $ref: '#/components/schemas/TKwotowy'
            P_13_6_1:
              $ref: '#/components/schemas/TKwotowy'
            P_13_6_2:
              $ref: '#/components/schemas/TKwotowy'
            P_13_6_3:
              $ref: '#/components/schemas/TKwotowy'
            P_13_7:
              $ref: '#/components/schemas/TKwotowy'
            P_13_8:
              $ref: '#/components/schemas/TKwotowy'
            P_13_9:
              $ref: '#/components/schemas/TKwotowy'
            P_13_10:
              $ref: '#/components/schemas/TKwotowy'
            P_13_11:
              $ref: '#/components/schemas/TKwotowy'
            P_15:
              $ref: '#/components/schemas/TKwotowy'
            KursWalutyZ:
              $ref: '#/components/schemas/TIlosci'
            Adnotacje:
              $ref: '#/components/schemas/Adnotacje'
            RodzajFaktury:
              $ref: '#/components/schemas/TRodzajFaktury'
            PrzyczynaKorekty:
              $ref: '#/components/schemas/TZnakowy'
            TypKorekty:
              $ref: '#/components/schemas/TTypKorekty'
            DaneFaKorygowanej:
              type: array
              items:
                $ref: '#/components/schemas/DaneFaKorygowanej'
            OkresFaKorygowanej:
              $ref: '#/components/schemas/TZnakowy'
            NrFaKorygowany:
              $ref: '#/components/schemas/TZnakowy'
            Podmiot1K:
              $ref: '#/components/schemas/Podmiot1K'
            Podmiot2K:
              type: array
              items:
                $ref: '#/components/schemas/Podmiot2K'
              maxItems: 101
            P_15ZK:
              $ref: '#/components/schemas/TKwotowy'
            KursWalutyZK:
              $ref: '#/components/schemas/TIlosci'
            ZaliczkaCzesciowa:
              type: array
              items:
                $ref: '#/components/schemas/ZaliczkaCzesciowa'
              maxItems: 31
            FP:
              $ref: '#/components/schemas/TWybor1'
            TP:
              $ref: '#/components/schemas/TWybor1'
            DodatkowyOpis:
              type: array
              items:
                $ref: '#/components/schemas/TKluczWartosc'
              maxItems: 10000
            FakturaZaliczkowa:
              type: array
              items:
                $ref: '#/components/schemas/FakturaZaliczkowa'
              maxItems: 100
            ZwrotAkcyzy:
              $ref: '#/components/schemas/TWybor1'
            FaWiersz:
              type: array
              items:
                $ref: '#/components/schemas/FaWiersz'
              maxItems: 10000
            Rozliczenie:
              $ref: '#/components/schemas/Rozliczenie'
            Platnosc:
              $ref: '#/components/schemas/Platnosc'
            WarunkiTransakcji:
              $ref: '#/components/schemas/WarunkiTransakcji'
            Zamowienie:
              $ref: '#/components/schemas/Zamowienie'
        - oneOf:
            - $ref: '#/components/schemas/FaP6'
            - $ref: '#/components/schemas/OkresFa'
    PodmiotUpowazniony:
      description: Data of the authorized entity related to the invoice
      type: object
      properties:
        NrEORI:
          $ref: '#/components/schemas/TZnakowy'
        DaneIdentyfikacyjne:
          $ref: '#/components/schemas/TPodmiot1'
        Adres:
          $ref: '#/components/schemas/TAdres'
        AdresKoresp:
          $ref: '#/components/schemas/TAdres'
        DaneKontaktowe:
          type: array
          items:
            $ref: '#/components/schemas/DaneKontaktowePU'
          maxItems: 3
        RolaPU:
          $ref: '#/components/schemas/TRolaPodmiotuUpowaznionego'
    Podmiot2:
      description: Buyer data
      type: object
      properties:
        NrEORI:
          $ref: '#/components/schemas/TZnakowy'
        DaneIdentyfikacyjne:
          $ref: '#/components/schemas/TPodmiot2'
        Adres:
          $ref: '#/components/schemas/TAdres'
        AdresKoresp:
          $ref: '#/components/schemas/TAdres'
        DaneKontaktowe:
          type: array
          items:
            $ref: '#/components/schemas/DaneKontaktowe'
          maxItems: 3
        NrKlienta:
          $ref: '#/components/schemas/TZnakowy'
        IDNabywcy:
          $ref: '#/components/schemas/IDNabywcy'
        JST:
          description: JST subordinate unit flag (1 - invoice concerns a subordinate JST unit,
            2 - invoice does not concern a subordinate JST unit).
          type: integer
          format: int32
          enum: [1, 2]
        GV:
          description: VAT group member flag (1 - invoice concerns a VAT group member, 2 - invoice
            does not concern a VAT group member).
          type: integer
          format: int32
          enum: [1, 2]
    TDataT:
      description: Event date in the period from 2006-01-01 to 2050-01-01
      type: string
      format: date
    FaP6:
      description: Date of supply or completion of delivery of goods or performance of services, or date of receipt of payment,
        referred to in Art. 106b(1)(4) of the Act, if such date is specified and differs from the invoice issue date.
        This field is completed when a common date applies to all invoice items.
      type: object
      properties:
        P_6:
          $ref: '#/components/schemas/TDataT'
    OkresFa:
      description: Period to which the invoice relates in the cases referred to in
        Art. 19a(3) first sentence and (4) and (5)(4) of the Act.
      type: object
      properties:
        P_6_Od:
          $ref: '#/components/schemas/TDataT'
        P_6_Do:
          $ref: '#/components/schemas/TDataT'
    Adnotacje:
      description: Other notes on the invoice
      type: object
      properties:
        P_16:
          $ref: '#/components/schemas/TWybor1_2'
        P_17:
          $ref: '#/components/schemas/TWybor1_2'
        P_18:
          $ref: '#/components/schemas/TWybor1_2'
        P_18A:
          $ref: '#/components/schemas/TWybor1_2'
        Zwolnienie:
          $ref: '#/components/schemas/Zwolnienie'
        NoweSrodkiTransportu:
          $ref: '#/components/schemas/NoweSrodkiTransportu'
        P_23:
          $ref: '#/components/schemas/TWybor1_2'
        PMarzy:
          $ref: '#/components/schemas/PMarzy'
    Podmiot1K:
      description: If correcting seller data, provide the full seller data as shown on the corrected invoice.
        This field does not apply when correcting an incorrect NIP on the original invoice - in such case,
        a correction invoice to zero values is required
      type: object
      properties:
        PrefiksPodatnika:
          $ref: '#/components/schemas/TKodyKrajowUE'
        DaneIdentyfikacyjne:
          $ref: '#/components/schemas/TPodmiot1'
        Adres:
          $ref: '#/components/schemas/TAdres'
    TRodzajFaktury:
      description: Invoice type (VAT - basic invoice, KOR - corrective invoice, ZAL - invoice documenting
        receipt of payment or part of payment before the transaction and an invoice issued under Art. 106f(4)
        of the Act, ROZ - invoice issued under Art. 106f(3) of the Act, UPR - invoice referred to in Art. 106e(5)(3)
        of the Act, KOR_ZAL - corrective invoice to an invoice documenting receipt of payment or part of payment
        before the transaction and to an invoice issued under Art. 106f(4) of the Act,
        KOR_ROZ - corrective invoice to an invoice issued under Art. 106f(3) of the Act)
      type: string
      enum:
        - VAT
        - KOR
        - ZAL
        - ROZ
        - UPR
        - KOR_ZAL
        - KOR_ROZ
    TZnakowy:
      description: String type limited to 256 characters
      type: string
      minLength: 1
      maxLength: 256
    TRolaPodmiotuUpowaznionego:
      description: Role of the authorized entity (1 - enforcement authority - in the case referred to in Art. 106c(1) of the Act,
        2 - court bailiff - in the case referred to in Art. 106c(2) of the Act, 3 - tax representative
        - when the invoice includes data of a tax representative referred to in Art. 18a-18d of the Act
      type: integer
      format: int32
      enum: [1, 2, 3]
    Informacje:
      description: Other data
      type: object
      properties:
        StopkaFaktury:
          $ref: '#/components/schemas/TTekstowy'
    Podmiot2K:
      description: If correcting data of the buyer shown as Podmiot2 or an additional buyer shown as Podmiot3,
        provide the full data of that entity as shown on the corrected invoice. Incorrect identification numbers
        of the buyer and additional buyer are not subject to correction. When correcting other buyer data,
        the indicated identification number must match the number in the Podmiot2 or Podmiot3 section
        of the corrective invoice
      type: object
      properties:
        DaneIdentyfikacyjne:
          $ref: '#/components/schemas/TPodmiot2'
        Adres:
          $ref: '#/components/schemas/TAdres'
        IDNabywcy:
          $ref: '#/components/schemas/IDNabywcy'
    Rozliczenie:
      description: Additional settlements on the invoice
      type: object
      properties:
        Obciazenia:
          type: array
          items:
            $ref: '#/components/schemas/Obciazenia'
          maxItems: 100
        SumaObciazen:
          $ref: '#/components/schemas/TKwotowy'
        Odliczenia:
          type: array
          items:
            $ref: '#/components/schemas/Odliczenia'
          maxItems: 100
        SumaOdliczen:
          $ref: '#/components/schemas/TKwotowy'
        DoZaplaty:
          $ref: '#/components/schemas/TKwotowy'
        DoRozliczenia:
          $ref: '#/components/schemas/TKwotowy'
    Platnosc:
      description: Payment terms
      type: object
      properties:
        Zaplacono:
          $ref: '#/components/schemas/TWybor1'
        DataZaplaty:
          $ref: '#/components/schemas/TData'
        ZnacznikZaplatyCzesciowej:
          $ref: '#/components/schemas/TWybor1'
        ZaplataCzesciowa:
          type: array
          items:
            $ref: '#/components/schemas/ZaplataCzesciowa'
          maxItems: 100
        TerminPlatnosci:
          type: array
          items:
            $ref: '#/components/schemas/TerminPlatnosci'
          maxItems: 100
        FormaPlatnosci:
          $ref: '#/components/schemas/TFormaPlatnosci'
        PlatnoscInna:
          $ref: '#/components/schemas/TWybor1'
        OpisPlatnosci:
          $ref: '#/components/schemas/TZnakowy'
        RachunekBankowy:
          type: array
          items:
            $ref: '#/components/schemas/TRachunekBankowy'
          maxItems: 100
        RachunekBankowyFaktora:
          type: array
          items:
            $ref: '#/components/schemas/TRachunekBankowy'
          maxItems: 20
        Skonto:
          $ref: '#/components/schemas/Skonto'
    TStatusInfoPodatnika:
      description: Taxpayer status (1 - taxpayer in liquidation, 2 - taxpayer undergoing restructuring proceedings,
        3 - taxpayer in bankruptcy, 4 - estate business)
      type: integer
      format: int32
      enum: [1, 2, 3, 4]
    Rejestry:
      description: Entity or group numbers in other registers and databases
      type: object
      properties:
        PelnaNazwa:
          $ref: '#/components/schemas/TZnakowy'
        KRS:
          $ref: '#/components/schemas/TNrKRS'
        REGON:
          $ref: '#/components/schemas/TNrREGON'
        BDO:
          $ref: '#/components/schemas/BDO'
    TKodFormularza:
      type: object
      properties:
        kodFormularza:
          type: string
          enum: [FA]
        kodSystemowy:
          type: string
          enum: [FA_V2, FA_V3]
        wersjaSchemy:
          type: string
          enum: [1_0E]
    TPodmiot2:
      description: Set of identification and address data of the buyer
      allOf:
        - oneOf:
            - $ref: '#/components/schemas/TPodmiot2PL'
            - $ref: '#/components/schemas/TPodmiot2UE'
            - $ref: '#/components/schemas/TPodmiot2Inny'
            - $ref: '#/components/schemas/TPodmiot2Brak'
        - $ref: '#/components/schemas/TPodmiot2Nazwa'
    TPodmiot2PL:
      type: object
      properties:
        NIP:
          $ref: '#/components/schemas/TNrNIP'
    TPodmiot2UE:
      type: object
      properties:
        KodUE:
          $ref: '#/components/schemas/TKodyKrajowUE'
        NrVatUE:
          $ref: '#/components/schemas/TNrVatUE'
    TPodmiot2Inny:
      type: object
      properties:
        KodKraju:
          $ref: '#/components/schemas/TKodKraju'
        NrID:
          $ref: '#/components/schemas/NrID'
    TPodmiot2Brak:
      type: object
      properties:
        BrakID:
          $ref: '#/components/schemas/TWybor1'
    TPodmiot2Nazwa:
      type: object
      description: Optional data for cases referred to in Art. 106e(5)(3)
      properties:
        Nazwa:
          $ref: '#/components/schemas/TZnakowy512'
    DaneKontaktowe:
      description: Contact data
      type: object
      properties:
        Email:
          $ref: '#/components/schemas/TAdresEmail'
        Telefon:
          $ref: '#/components/schemas/TNumerTelefonu'
    DaneKontaktowePU:
      description: Contact data of the authorized entity
      type: object
      properties:
        EmailPU:
          $ref: '#/components/schemas/TAdresEmail'
        TelefonPU:
          $ref: '#/components/schemas/TNumerTelefonu'
    TKluczWartosc:
      description: Composite type, key-value
      type: object
      properties:
        NrWiersza:
          $ref: '#/components/schemas/TNaturalny'
        Klucz:
          $ref: '#/components/schemas/TZnakowy'
        Wartosc:
          $ref: '#/components/schemas/TZnakowy'
    IDNabywcy:
      description: Unique key linking buyer data on corrective invoices when buyer data on the corrective invoice
        has changed compared to the corrected invoice
      type: string
      minLength: 1
      maxLength: 32
    TRolaPodmiotu3:
      description: Role of the third-party entity (1 - factor - when the invoice includes factor data,
        2 - recipient - when the invoice includes data of internal units/branches within the buyer that are not
        themselves buyers within the meaning of the Act, 3 - original entity - when the invoice includes data of an entity
        that, in relation to the taxpayer, has been acquired or transformed and provided the service or supplied the goods.
        Excluding cases referred to in Art. 106j(2)(3) of the Act where these data are shown in Podmiot1K, 4 - additional buyer -
        when the invoice includes data of subsequent buyers (other than the one listed in Podmiot2), 5 - invoice issuer -
        when the invoice includes data of the entity issuing the invoice on behalf of the taxpayer. Does not apply when the buyer
        issues the invoice, 6 - payer - when the invoice includes data of the entity settling the liability instead of the buyer,
        7 - local government unit - issuer, 8 - local government unit - recipient, 9 - VAT group member - issuer, 10 - VAT group member
        - recipient
      type: integer
      format: int32
      enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    TTypKorekty:
      description: Type of correction effect in VAT records (1 - correction effective on the original invoice date,
        2 - correction effective on the corrective invoice date, 3 - correction effective on another date, including when
        dates differ for various items on the corrective invoice)
      type: integer
      format: int32
      enum: [1, 2, 3]
    TPodmiot3:
      description: Set of identification and address data of third parties
      allOf:
        - oneOf:
            - $ref: '#/components/schemas/TPodmiot3PL'
            - $ref: '#/components/schemas/TPodmiot3Wew'
            - $ref: '#/components/schemas/TPodmiot3UE'
            - $ref: '#/components/schemas/TPodmiot3Inny'
            - $ref: '#/components/schemas/TPodmiot3Brak'
        - $ref: '#/components/schemas/TPodmiot3Nazwa'
    TPodmiot3PL:
      type: object
      properties:
        NIP:
          $ref: '#/components/schemas/TNrNIP'
    TPodmiot3Wew:
      type: object
      properties:
        IDWew:
          $ref: '#/components/schemas/TNIPIdWew'
    TPodmiot3UE:
      type: object
      properties:
        KodUE:
          $ref: '#/components/schemas/TKodyKrajowUE'
        NrVatUE:
          $ref: '#/components/schemas/TNrVatUE'
    TPodmiot3Inny:
      type: object
      properties:
        KodKraju:
          $ref: '#/components/schemas/TKodKraju'
        NrID:
          $ref: '#/components/schemas/NrID'
    TPodmiot3Brak:
      type: object
      properties:
        BrakID:
          $ref: '#/components/schemas/TWybor1'
    TPodmiot3Nazwa:
      type: object
      properties:
        Nazwa:
          $ref: '#/components/schemas/TZnakowy512'
    TProcentowy:
      description: Percentage value with precision to 6 decimal places
      type: number
      format: double
      minimum: 0
      maximum: 100
    TPodmiot1:
      description: Set of identification and address data of the taxpayer
      type: object
      properties:
        NIP:
          $ref: '#/components/schemas/TNrNIP'
        Nazwa:
          $ref: '#/components/schemas/TZnakowy512'
    DataWytworzeniaFa:
      description: Invoice creation date and time
      type: string
      format: date-time
    TAdres:
      type: object
      description: Address details
      properties:
        KodKraju:
          $ref: '#/components/schemas/TKodKraju'
        AdresL1:
          $ref: '#/components/schemas/TZnakowy512'
        AdresL2:
          $ref: '#/components/schemas/TZnakowy512'
        GLN:
          $ref: '#/components/schemas/TGLN'
    FakturaZaliczkowa:
      description: Advance invoice numbers or their KSeF numbers if issued using KSeF
      type: object
      properties:
        NrKSeFZN:
          $ref: '#/components/schemas/TWybor1'
        NrFaZaliczkowej:
          $ref: '#/components/schemas/TZnakowy'
        NrKSeFFaZaliczkowej:
          $ref: '#/components/schemas/TNumerKSeF'
    TIlosci:
      description: Type used to specify quantity. Numeric value, max 22 digits including 6 decimal places
      type: number
      format: double
    FaWiersz:
      description: Detailed invoice line items in the currency in which the invoice was issued
        - optional node for advance invoices, corrective invoices to advance invoices,
        and corrective invoices covering all supplies of goods or services provided in a given period,
        as referred to in Art. 106j(3) of the Act, for which discount/reduction data must be provided
        by tax rates and procedures in the Fa section. For corrective invoices referred to in Art. 106j(3)
        of the Act, when the discount or price reduction relates to part of the supplies in a given period,
        the FaWiersz section should include the names (types) of goods or services covered by the correction.
        For invoices referred to in Art. 106f(3) of the Act, the full values of the order or contract must be shown.
        For invoices correcting invoice items (including corrections to invoices referred to in Art. 106f(3)
        if the correction concerns the order value), show the differences resulting from corrections of individual
        items or show the corrected item data before and after correction as separate rows. For corrective invoices
        to invoices referred to in Art. 106f(3), if the correction does not concern the order value and at the same
        time changes the tax base or tax amount, enter a record for the state before correction and a record after
        correction to confirm no change in the value of the given invoice item
      type: object
      properties:
        NrWierszaFa:
          $ref: '#/components/schemas/TNaturalny'
        UU_ID:
          $ref: '#/components/schemas/TZnakowy50'
        P_6A:
          $ref: '#/components/schemas/TDataT'
        P_7:
          $ref: '#/components/schemas/TZnakowy'
        Indeks:
          $ref: '#/components/schemas/TZnakowy50'
        GTIN:
          $ref: '#/components/schemas/TZnakowy20'
        PKWiU:
          $ref: '#/components/schemas/TZnakowy50'
        CN:
          $ref: '#/components/schemas/TZnakowy50'
        PKOB:
          $ref: '#/components/schemas/TZnakowy50'
        P_8A:
          $ref: '#/components/schemas/TZnakowy'
        P_8B:
          $ref: '#/components/schemas/TIlosci'
        P_9A:
          $ref: '#/components/schemas/TKwotowy2'
        P_9B:
          $ref: '#/components/schemas/TKwotowy2'
        P_10:
          $ref: '#/components/schemas/TKwotowy2'
        P_11:
          $ref: '#/components/schemas/TKwotowy'
        P_11A:
          $ref: '#/components/schemas/TKwotowy'
        P_11Vat:
          $ref: '#/components/schemas/TKwotowy'
        P_12:
          $ref: '#/components/schemas/TStawkaPodatku'
        P_12_XII:
          $ref: '#/components/schemas/TProcentowy'
        P_12_Zal_15:
          $ref: '#/components/schemas/TWybor1'
        KwotaAkcyzy:
          $ref: '#/components/schemas/TKwotowy'
        GTU:
          $ref: '#/components/schemas/TGTU'
        Procedura:
          $ref: '#/components/schemas/TOznaczenieProcedury'
        KursWaluty:
          $ref: '#/components/schemas/TIlosci'
        StanPrzed:
          $ref: '#/components/schemas/TWybor1'
    TKodWaluty:
      description: Currency code list
      type: string
      enum:
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BOV
        - BRL
        - BSD
        - BTN
        - BWP
        - BYN
        - BZD
        - CAD
        - CDF
        - CHE
        - CHF
        - CHW
        - CLF
        - CLP
        - CNY
        - COP
        - COU
        - CRC
        - CUC
        - CUP
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ERN
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GGP
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HRK
        - HTG
        - HUF
        - IDR
        - ILS
        - IMP
        - INR
        - IQD
        - IRR
        - ISK
        - JEP
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KPW
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MRU
        - MUR
        - MVR
        - MWK
        - MXN
        - MXV
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SDG
        - SEK
        - SGD
        - SHP
        - SLL
        - SOS
        - SRD
        - SSP
        - STN
        - SVC
        - SYP
        - SZL
        - THB
        - TJS
        - TMT
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - USN
        - UYI
        - UYU
        - UYW
        - UZS
        - VES
        - VND
        - VUV
        - WST
        - XAF
        - XAG
        - XAU
        - XBA
        - XBB
        - XBC
        - XBD
        - XCD
        - XDR
        - XOF
        - XPD
        - XPF
        - XPT
        - XSU
        - XUA
        - XXX
        - YER
        - ZAR
        - ZMW
        - ZWL
    DaneFaKorygowanej:
      description: Corrected invoice data
      type: object
      properties:
        DataWystFaKorygowanej:
          $ref: '#/components/schemas/TDataT'
        NrFaKorygowanej:
          $ref: '#/components/schemas/TZnakowy'
        NrKSeF:
          $ref: '#/components/schemas/TWybor1'
        NrKSeFFaKorygowanej:
          $ref: '#/components/schemas/TNumerKSeF'
        NrKSeFN:
          $ref: '#/components/schemas/TWybor1'
    ZaliczkaCzesciowa:
      description: Data for cases of invoices documenting receipt of more than one payment
        referred to in Art. 106b(1)(4) of the Act. If an invoice referred to in Art. 106f(3)
        of the Act simultaneously documents receipt of part of the payment before the transaction,
        the difference between the amount in field P_15 and the sum of individual P_15Z fields is the
        remaining amount above the payments received before the transaction documented by the invoice
      type: object
      properties:
        P_6Z:
          $ref: '#/components/schemas/TDataT'
        P_15Z:
          $ref: '#/components/schemas/TKwotowy'
        KursWalutyZW:
          $ref: '#/components/schemas/TIlosci'
    TKodyKrajowUE:
      description: EU member country codes, including the code for Northern Ireland
      type: string
      enum:
        - AT
        - BE
        - BG
        - CY
        - CZ
        - DK
        - EE
        - FI
        - FR
        - DE
        - EL
        - HR
        - HU
        - IE
        - IT
        - LV
        - LT
        - LU
        - MT
        - NL
        - PL
        - PT
        - RO
        - SK
        - SI
        - ES
        - SE
        - XI
    WarunkiTransakcji:
      description: Transaction terms, if any
      type: object
      properties:
        Umowy:
          type: array
          items:
            $ref: '#/components/schemas/Umowy'
          maxItems: 100
        Zamowienia:
          type: array
          items:
            $ref: '#/components/schemas/Zamowienia'
          maxItems: 100
        NrPartiiTowaru:
          type: array
          items:
            $ref: '#/components/schemas/TZnakowy'
          maxItems: 1000
        WarunkiDostawy:
          $ref: '#/components/schemas/TZnakowy'
        KursUmowny:
          $ref: '#/components/schemas/TIlosci'
        WalutaUmowna:
          $ref: '#/components/schemas/TKodWaluty'
        Transport:
          type: array
          items:
            $ref: '#/components/schemas/Transport'
          maxItems: 20
        PodmiotPosredniczacy:
          $ref: '#/components/schemas/TWybor1'
    TWybor1:
      description: Single-choice field
      type: integer
      format: int32
      minimum: 1
      maximum: 1
    TKwotowy:
      description: Numeric value, max 18 digits including 2 decimal places
      type: number
      format: double
    WariantFormularza:
      description: Schema version (2 - v2, 3 - v3)
      type: integer
      format: int32
      enum: [2, 3]
    Zamowienie:
      description: Order or contract referred to in Art. 106f(1)(4) of the Act
        (for advance invoices) in the currency in which the advance invoice was issued.
        For a corrective invoice to an advance invoice, show differences resulting from corrections
        of individual order/contract items or show corrected items before and after correction as separate rows
        if the correction concerns the order/contract value. For corrective invoices to advance invoices,
        if the correction does not concern the order/contract value and at the same time changes the tax base
        or tax amount, enter a record for the state before correction and a record after correction to confirm
        no change in the value of the given item
      type: object
      properties:
        WartoscZamowienia:
          $ref: '#/components/schemas/TKwotowy'
        ZamowienieWiersz:
          type: array
          items:
            $ref: '#/components/schemas/ZamowienieWiersz'
          maxItems: 10000
    TNumerTelefonu:
      description: Phone number
      type: string
      maxLength: 16
    BDO:
      description: Waste Database number
      type: string
      minLength: 1
      maxLength: 9
    PMarzy:
      type: object
      properties:
        P_PMarzy:
          $ref: '#/components/schemas/TWybor1'
        P_PMarzy_2:
          $ref: '#/components/schemas/TWybor1'
        P_PMarzy_3_1:
          $ref: '#/components/schemas/TWybor1'
        P_PMarzy_3_2:
          $ref: '#/components/schemas/TWybor1'
        P_PMarzy_3_3:
          $ref: '#/components/schemas/TWybor1'
        P_PMarzyN:
          $ref: '#/components/schemas/TWybor1'
    Obciazenia:
      description: Charges
      type: object
      properties:
        Kwota:
          $ref: '#/components/schemas/TKwotowy'
        Powod:
          $ref: '#/components/schemas/TZnakowy'
    TGLN:
      description: Global Location Number type
      type: string
      minLength: 1
      maxLength: 13
    TKodKraju:
      description: Country code list
      type: string
      enum:
        - AF
        - AX
        - AL
        - DZ
        - AD
        - AO
        - AI
        - AQ
        - AG
        - AN
        - SA
        - AR
        - AM
        - AW
        - AU
        - AT
        - AZ
        - BS
        - BH
        - BD
        - BB
        - BE
        - BZ
        - BJ
        - BM
        - BT
        - BY
        - BO
        - BQ
        - BA
        - BW
        - BR
        - BN
        - IO
        - BG
        - BF
        - BI
        - XC
        - CL
        - CN
        - HR
        - CW
        - CY
        - TD
        - ME
        - DK
        - DM
        - DO
        - DJ
        - EG
        - EC
        - ER
        - EE
        - ET
        - FK
        - FJ
        - PH
        - FI
        - FR
        - TF
        - GA
        - GM
        - GH
        - GI
        - GR
        - GD
        - GL
        - GE
        - GU
        - GG
        - GY
        - GF
        - GP
        - GT
        - GN
        - GQ
        - GW
        - HT
        - ES
        - HN
        - HK
        - IN
        - ID
        - IQ
        - IR
        - IE
        - IS
        - IL
        - JM
        - JP
        - YE
        - JE
        - JO
        - KY
        - KH
        - CM
        - CA
        - QA
        - KZ
        - KE
        - KG
        - KI
        - CO
        - KM
        - CG
        - CD
        - KP
        - XK
        - CR
        - CU
        - KW
        - LA
        - LS
        - LB
        - LR
        - LY
        - LI
        - LT
        - LV
        - LU
        - MK
        - MG
        - YT
        - MO
        - MW
        - MV
        - MY
        - ML
        - MT
        - MP
        - MA
        - MQ
        - MR
        - MU
        - MX
        - XL
        - FM
        - UM
        - MD
        - MC
        - MN
        - MS
        - MZ
        - MM
        - NA
        - NR
        - NP
        - NL
        - DE
        - NE
        - NG
        - NI
        - NU
        - NF
        - NO
        - NC
        - NZ
        - PS
        - OM
        - PK
        - PW
        - PA
        - PG
        - PY
        - PE
        - PN
        - PF
        - PL
        - GS
        - PT
        - PR
        - CF
        - CZ
        - KR
        - ZA
        - RE
        - RU
        - RO
        - RW
        - EH
        - BL
        - KN
        - LC
        - MF
        - VC
        - SV
        - WS
        - AS
        - SM
        - SN
        - RS
        - SC
        - SL
        - SG
        - SK
        - SI
        - SO
        - LK
        - PM
        - US
        - SZ
        - SD
        - SS
        - SR
        - SJ
        - SH
        - SY
        - CH
        - SE
        - TJ
        - TH
        - TW
        - TZ
        - TG
        - TK
        - TO
        - TT
        - TN
        - TR
        - TM
        - TV
        - UG
        - UA
        - UY
        - UZ
        - VU
        - WF
        - VA
        - HU
        - VE
        - GB
        - VN
        - IT
        - TL
        - CI
        - BV
        - CX
        - IM
        - SX
        - CK
        - VI
        - VG
        - HM
        - CC
        - MH
        - FO
        - SB
        - ST
        - TC
        - ZM
        - CV
        - ZW
        - AE
        - XI
    TGTU:
      description: >
        Designation for supplies of goods and provision of services:
          * `GTU_01` - Supplies of goods referred to in Sec. 10(3)(1)(a) of the regulation on the detailed scope
            of data contained in tax returns and VAT records
          * `GTU_02` - Supplies of goods referred to in Sec. 10(3)(1)(b) of the regulation on the detailed scope
            of data contained in tax returns and VAT records
          * `GTU_03` - Supplies of goods referred to in Sec. 10(3)(1)(c) of the regulation on the detailed scope
            of data contained in tax returns and VAT records
          * `GTU_04` - Supplies of goods referred to in Sec. 10(3)(1)(d) of the regulation on the detailed scope
            of data contained in tax returns and VAT records
          * `GTU_05` - Supplies of goods referred to in Sec. 10(3)(1)(e) of the regulation on the detailed scope
            of data contained in tax returns and VAT records
          * `GTU_06` - Supplies of goods referred to in Sec. 10(3)(1)(f) of the regulation on the detailed scope
            of data contained in tax returns and VAT records
          * `GTU_07` - Supplies of goods referred to in Sec. 10(3)(1)(g) of the regulation on the detailed scope
            of data contained in tax returns and VAT records
          * `GTU_08` - Supplies of goods referred to in Sec. 10(3)(1)(h) of the regulation on the detailed scope
            of data contained in tax returns and VAT records
          * `GTU_09` - Supplies of goods referred to in Sec. 10(3)(1)(i) of the regulation on the detailed scope
            of data contained in tax returns and VAT records
          * `GTU_10` - Supplies of goods referred to in Sec. 10(3)(1)(j) of the regulation on the detailed scope
            of data contained in tax returns and VAT records
          * `GTU_11` - Services referred to in Sec. 10(3)(2)(a) of the regulation on the detailed scope
            of data contained in tax returns and VAT records
          * `GTU_12` - Services referred to in Sec. 10(3)(2)(b) of the regulation on the detailed scope
            of data contained in tax returns and VAT records
          * `GTU_13` - Services referred to in Sec. 10(3)(2)(c) of the regulation on the detailed scope
            of data contained in tax returns and VAT records
      type: string
      enum:
        - GTU_01
        - GTU_02
        - GTU_03
        - GTU_04
        - GTU_05
        - GTU_06
        - GTU_07
        - GTU_08
        - GTU_09
        - GTU_10
        - GTU_11
        - GTU_12
        - GTU_13
    Skonto:
      description: Cash discount
      type: object
      properties:
        WarunkiSkonta:
          $ref: '#/components/schemas/TZnakowy'
        WysokoscSkonta:
          $ref: '#/components/schemas/TZnakowy'
    TStawkaPodatku:
      description: Tax rate
      type: string
      enum:
        - 23
        - 22
        - 8
        - 7
        - 5
        - 4
        - 3
        - 0 KR
        - 0 WDT
        - 0 EX
        - zw
        - oo
        - np I
        - np II
    Umowy:
      type: object
      properties:
        DataUmowy:
          $ref: '#/components/schemas/TData'
        NrUmowy:
          $ref: '#/components/schemas/TZnakowy'
    TNaturalny:
      description: Natural numbers greater than zero
      type: integer
      format: int32
      minimum: 0
      exclusiveMinimum: true
    Zamowienia:
      type: object
      properties:
        DataZamowienia:
          $ref: '#/components/schemas/TData'
        NrZamowienia:
          $ref: '#/components/schemas/TZnakowy'
    TNrKRS:
      description: National Court Register number
      type: string
      pattern: '^\d{10}$'
    TOznaczenieProcedury:
      description: Markings for invoice procedures
      type: string
      enum:
        - WSTO_EE
        - IED
        - TT_D
        - I_42
        - I_63
        - B_SPV
        - B_SPV_DOSTAWA
        - B_MPV_PROWIZJA
    TData:
      description: Event date in the period from 2016-07-01 to 2050-01-01
      type: string
      format: date
    TKwotowy2:
      description: Numeric value, max 22 digits including 8 decimal places
      type: number
      format: double
    ZamowienieWiersz:
      description: Detailed order or contract line items in the currency in which the advance invoice was issued
      type: object
      properties:
        NrWierszaZam:
          $ref: '#/components/schemas/TNaturalny'
        UU_IDZ:
          $ref: '#/components/schemas/TZnakowy50'
        P_7Z:
          $ref: '#/components/schemas/TZnakowy'
        IndeksZ:
          $ref: '#/components/schemas/TZnakowy50'
        GTINZ:
          $ref: '#/components/schemas/TZnakowy20'
        PKWiUZ:
          $ref: '#/components/schemas/TZnakowy50'
        CNZ:
          $ref: '#/components/schemas/TZnakowy50'
        PKOBZ:
          $ref: '#/components/schemas/TZnakowy50'
        P_8AZ:
          $ref: '#/components/schemas/TZnakowy'
        P_8BZ:
          $ref: '#/components/schemas/TIlosci'
        P_9AZ:
          $ref: '#/components/schemas/TKwotowy2'
        P_11NettoZ:
          $ref: '#/components/schemas/TKwotowy'
        P_11VatZ:
          $ref: '#/components/schemas/TKwotowy'
        P_12Z:
          $ref: '#/components/schemas/TStawkaPodatku'
        P_12Z_XII:
          $ref: '#/components/schemas/TProcentowy'
        P_12Z_Zal_15:
          $ref: '#/components/schemas/TWybor1'
        GTUZ:
          $ref: '#/components/schemas/TGTU'
        ProceduraZ:
          $ref: '#/components/schemas/TOznaczenieProceduryZ'
        KwotaAkcyzyZ:
          $ref: '#/components/schemas/TKwotowy'
        StanPrzedZ:
          $ref: '#/components/schemas/TWybor1'
    TNIPIdWew:
      description: Internal identifier
      type: string
      pattern: '^[1-9]((\d[1-9])|([1-9]\d))\d{7}-\d{5}$'
    TZnakowy2:
      description: String type limited to 256 characters
      type: string
      minLength: 1
      maxLength: 256
    TZnakowy512:
      description: String type limited to 512 characters
      type: string
      minLength: 1
      maxLength: 512
    TZnakowy50:
      description: String type limited to 50 characters
      type: string
      minLength: 1
      maxLength: 50
    Odliczenia:
      description: Deductions
      type: object
      properties:
        Kwota:
          $ref: '#/components/schemas/TKwotowy'
        Powod:
          $ref: '#/components/schemas/TZnakowy'
    TRachunekBankowy:
      description: Account information
      type: object
      properties:
        NrRB:
          $ref: '#/components/schemas/TNrRB'
        SWIFT:
          $ref: '#/components/schemas/SWIFT_Type'
        RachunekWlasnyBanku:
          $ref: '#/components/schemas/TRachunekWlasnyBanku'
        NazwaBanku:
          $ref: '#/components/schemas/TZnakowy'
        OpisRachunku:
          $ref: '#/components/schemas/TZnakowy'
    TTekstowy:
      description: String type limited to 3500 characters
      type: string
      minLength: 1
      maxLength: 3500
    TerminPlatnosci:
      type: object
      properties:
        Termin:
          $ref: '#/components/schemas/TData'
        TerminOpis:
          $ref: '#/components/schemas/TTerminOpis'
    TTerminOpis:
      type: object
      properties:
        Ilosc:
          type: integer
          format: int32
        Jednostka:
          $ref: '#/components/schemas/TZnakowy50'
        ZdarzeniePoczatkowe:
          $ref: '#/components/schemas/TZnakowy'
    NrID:
      description: Other tax identifier
      type: string
      pattern: '^[a-zA-Z0-9]{1,50}$'
    TFormaPlatnosci:
      description: Payment method types (1 - Cash, 2 - Card, 3 - Voucher, 4 - Cheque, 5 - Credit, 6 - Transfer, 7 - Mobile)
      type: integer
      format: int32
      enum: [1, 2, 3, 4, 5, 6, 7]
    NoweSrodkiTransportu:
      type: object
      title: NoweSrodkiTransportuTyp
      properties:
        P_22:
          $ref: '#/components/schemas/TWybor1'
        P_42_5:
          $ref: '#/components/schemas/TWybor1_2'
        NowySrodekTransportu:
          type: array
          items:
            $ref: '#/components/schemas/NowySrodekTransportu'
          maxItems: 10000
        P_22N:
          $ref: '#/components/schemas/TWybor1'
    TAdresEmail:
      description: Email address
      type: string
      minLength: 3
      maxLength: 255
      pattern: '^(.)+@(.)+$'
    TNrREGON:
      description: REGON number
      type: string
      pattern: '^\d{9}|\d{14}$'
    TWybor1_2:
      description: Two-choice field
      type: integer
      format: int32
      minimum: 1
      maximum: 2
    TNumerKSeF:
      description: Invoice identifier number in the National e-Invoice System (KSeF)
      type: string
      pattern: '^([1-9]((\d[1-9])|([1-9]\d))\d{7}|M\d{9}|[A-Z]{3}\d{7})-(20[2-9][0-9]|2[1-9][0-9]{2}|[3-9][0-9]{3})(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])-([0-9A-F]{6})-?([0-9A-F]{6})-([0-9A-F]{2})$'
    Zwolnienie:
      type: object
      properties:
        P_19:
          $ref: '#/components/schemas/TWybor1'
        P_19A:
          $ref: '#/components/schemas/TZnakowy'
        P_19B:
          $ref: '#/components/schemas/TZnakowy'
        P_19C:
          $ref: '#/components/schemas/TZnakowy'
        P_19N:
          $ref: '#/components/schemas/TWybor1'
    Transport:
      type: object
      properties:
        RodzajTransportu:
          $ref: '#/components/schemas/TRodzajTransportu'
        TransportInny:
          $ref: '#/components/schemas/TWybor1'
        OpisInnegoTransportu:
          $ref: '#/components/schemas/TZnakowy50'
        Przewoznik:
          $ref: '#/components/schemas/Przewoznik'
        NrZleceniaTransportu:
          $ref: '#/components/schemas/TZnakowy'
        OpisLadunku:
          $ref: '#/components/schemas/TLadunek'
        LadunekInny:
          $ref: '#/components/schemas/TWybor1'
        OpisInnegoLadunku:
          $ref: '#/components/schemas/TZnakowy50'
        JednostkaOpakowania:
          $ref: '#/components/schemas/TZnakowy'
        DataGodzRozpTransportu:
          $ref: '#/components/schemas/TDataCzas'
        DataGodzZakTransportu:
          $ref: '#/components/schemas/TDataCzas'
        WysylkaZ:
          $ref: '#/components/schemas/TAdres'
        WysylkaPrzez:
          type: array
          items:
            $ref: '#/components/schemas/TAdres'
          maxItems: 20
        WysylkaDo:
          $ref: '#/components/schemas/TAdres'
    TNrVatUE:
      description: EU counterparty VAT identification number
      type: string
      pattern: '^(\d|[A-Z]|\+|\*){1,12}$'
    TNrNIP:
      description: NIP tax identifier
      type: string
      pattern: '^[1-9]((\d[1-9])|([1-9]\d))\d{7}$'
    TZnakowy20:
      description: String type limited to 20 characters
      type: string
      minLength: 1
      maxLength: 20
    ZaplataCzesciowa:
      description: Partial payment data
      type: object
      properties:
        KwotaZaplatyCzesciowej:
          $ref: '#/components/schemas/TKwotowy'
        DataZaplatyCzesciowej:
          $ref: '#/components/schemas/TData'
        FormaPlatnosci:
          $ref: '#/components/schemas/TFormaPlatnosci'
        PlatnoscInna:
          $ref: '#/components/schemas/TWybor1'
        OpisPlatnosci:
          $ref: '#/components/schemas/TZnakowy'
    TRachunekWlasnyBanku:
      description: Types of own accounts (1 - bank account or credit union account used to settle monetary receivables
        acquired by that bank or credit union, 2 - bank account or credit union account used by that bank or credit union
        to collect amounts due from the buyer/recipient for the supply of goods or services documented by an invoice
        and to transfer them in whole or in part to the supplier or service provider,
        3 - bank account or credit union account maintained by that bank or credit union for its own operations,
        not a settlement account)
      type: integer
      format: int32
      enum: [1, 2, 3]
    SWIFT_Type:
      description: SWIFT code
      type: string
      pattern: '^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3}){0,1}$'
    TOznaczenieProceduryZ:
      description: Markings for order procedures
      type: string
      enum:
        - WSTO_EE
        - IED
        - TT_D
        - B_SPV
        - B_SPV_DOSTAWA
        - B_MPV_PROWIZJA
    TLadunek:
      description: Cargo types (1 - can, 2 - barrel, 3 - cylinder, 4 - carton, 5 - canister, 6 - crate, 7 - container,
        8 - basket, 9 - berry crate, 10 - outer packaging, 11 - parcel, 12 - package, 13 - pallet, 14 - container,
        15 - container for solid bulk cargo, 16 - container for liquid bulk cargo,
        17 - box, 18 - tin, 19 - crate, 20 - sack)
      type: integer
      format: int32
      enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
    TRodzajTransportu:
      description: Transport type (1 - maritime transport, 2 - rail transport, 3 - road transport,
        4 - air transport, 5 - postal shipment, 7 - fixed transport installations, 8 - inland waterway transport)
      type: integer
      format: int32
      enum: [1, 2, 3, 4, 5, 7, 8]
    TNrRB:
      description: Account number
      type: string
      pattern: '^[0-9A-Z]{10,32}$'
    Przewoznik:
      type: object
      properties:
        DaneIdentyfikacyjne:
          $ref: '#/components/schemas/TPodmiot2'
        AdresPrzewoznika:
          $ref: '#/components/schemas/TAdres'
    TDataCzas:
      description: Event date and time in the period from 2021-10-01T00:00:00Z to 2050-01-01T23:59:59Z
      type: string
      format: date-time
    NowySrodekTransportu:
      allOf:
        - type: object
          properties:
            P_22A:
              $ref: '#/components/schemas/TDataT'
            P_NrWierszaNST:
              $ref: '#/components/schemas/TNaturalny'
            P_22BMK:
              $ref: '#/components/schemas/TZnakowy'
            P_22BMD:
              $ref: '#/components/schemas/TZnakowy'
            P_22BK:
              $ref: '#/components/schemas/TZnakowy'
            P_22BNR:
              $ref: '#/components/schemas/TZnakowy'
            P_22BRP:
              $ref: '#/components/schemas/TZnakowy'
        - oneOf:
            - $ref: '#/components/schemas/NowySrodekTransportuB'
            - $ref: '#/components/schemas/NowySrodekTransportuC'
            - $ref: '#/components/schemas/NowySrodekTransportuD'
    NowySrodekTransportuB:
      type: object
      properties:
        P_22B:
          $ref: '#/components/schemas/TZnakowy'
        P_22B1:
          $ref: '#/components/schemas/TZnakowy'
        P_22B2:
          $ref: '#/components/schemas/TZnakowy'
        P_22B3:
          $ref: '#/components/schemas/TZnakowy'
        P_22B4:
          $ref: '#/components/schemas/TZnakowy'
        P_22BT:
          $ref: '#/components/schemas/TZnakowy'
    NowySrodekTransportuC:
      type: object
      properties:
        P_22C:
          $ref: '#/components/schemas/TZnakowy'
        P_22C1:
          $ref: '#/components/schemas/TZnakowy'
    NowySrodekTransportuD:
      type: object
      properties:
        P_22D:
          $ref: '#/components/schemas/TZnakowy'
        P_22D1:
          $ref: '#/components/schemas/TZnakowy'
    BlokDanych:
      type: object
      properties:
        ZNaglowek:
          $ref: '#/components/schemas/TZnakowy512'
        MetaDane:
          type: array
          items:
            $ref: '#/components/schemas/ZMetaDane'
          maxItems: 1000
        Tekst:
          type: object
          properties:
            Akapit:
              type: array
              items:
                $ref: '#/components/schemas/TZnakowy512'
              maxItems: 10
        Tabela:
          type: array
          items:
            $ref: '#/components/schemas/TTabela'
          maxItems: 1000
    ZMetaDane:
      type: object
      properties:
        ZKlucz:
          $ref: '#/components/schemas/TZnakowy'
        ZWartosc:
          $ref: '#/components/schemas/TZnakowy'
    TTabela:
      type: object
      properties:
        TMetaDane:
          type: array
          items:
            $ref: '#/components/schemas/TMetaDane'
          maxItems: 1000
        Opis:
          $ref: '#/components/schemas/TZnakowy512'
        TNaglowek:
          $ref: '#/components/schemas/TNaglowekTabeli'
        Wiersz:
          type: array
          items:
            $ref: '#/components/schemas/TWiersz'
          maxItems: 1000
        Suma:
          $ref: '#/components/schemas/TSumaTabeli'
    TMetaDane:
      type: object
      properties:
        TKlucz:
          $ref: '#/components/schemas/TZnakowy'
        TWartosc:
          $ref: '#/components/schemas/TZnakowy'
    TNaglowekTabeli:
      type: object
      properties:
        Kol:
          type: array
          items:
            $ref: '#/components/schemas/TKol'
          maxItems: 20
    TKol:
      type: object
      properties:
        NKom:
          $ref: '#/components/schemas/TZnakowy2'
        Typ:
          type: string
          enum:
            - date
            - datetime
            - dec
            - int
            - time
            - txt
    TWiersz:
      type: object
      properties:
        WKom:
          type: array
          items:
            $ref: '#/components/schemas/TZnakowy2'
          maxItems: 20
    TSumaTabeli:
      type: object
      properties:
        SKom:
          type: array
          items:
            $ref: '#/components/schemas/TZnakowy2'
          maxItems: 20
  responses:
    Error:
      description: Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResult'
