openapi: 3.0.1
info:
  title: documents_core API
  description: Merged OpenAPI spec for documents_core domain
  version: 1.0.0
servers:
- url: https://api.btx.fr.banqup.com/documents/core
paths:
  /business/v1/spaces/{spaceId}/documents/{documentId}/documentNumbers:create:
    post:
      description: "Generates a unique document number for the document. The document\
        \ numbers are sequential and unique within the space.\n <br/> Scope: space_read"
      operationId: generateDocumentNumber
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: documentId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateDocumentNumberRequest'
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentNumberResult'
          description: The generated number
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Access denied
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: No matching representation found
      security:
      - oauth2:
        - space_read
      summary: Generate the document number
      tags:
      - Documents
  /business/v1/spaces/{spaceId}/documents:calculate:
    post:
      description: 'Evaluates the provided document and calculates both the lines
        and document metadata. <br/> Scope: space_read'
      operationId: calculateDocument
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentCalculationRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentCalculationResponse'
          description: The calculated document
      security:
      - oauth2:
        - space_read
      summary: Calculate document data
      tags:
      - Documents
  /v1/spaces/documents:validate:
    post:
      operationId: validate_1
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentValidationRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentValidationResponse'
          description: OK
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentValidationResponse'
          description: The result of the validation initiation
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Access denied
      security:
      - oauth2:
        - space_read
      summary: Validates a set of documents
      tags:
      - Document Processor
      description: ' <br/> Scope: space_read'
  /v1/spaces/files:convert:
    post:
      deprecated: true
      description: '@deprecated This endpoint is deprecated. File conversion is now
        triggered automatically via PubSub when a file reaches VIRUS_SCANNED status.'
      operationId: convert
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConvertDocumentRequest'
        required: true
      responses:
        '202':
          description: Accepted
      summary: ⚠️Convert a space file to a document
      tags:
      - Document Processor
  /v1/spaces/files:process:
    post:
      operationId: process
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcessDocumentRequest'
        required: true
      responses:
        '207':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessDocumentResponse'
          description: The list of status of each file
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Access denied
      security:
      - oauth2:
        - space_read
      summary: Process the files along with attachments to the documents
      tags:
      - Document Processor
      description: ' <br/> Scope: space_read'
  /v1/spaces/{spaceId}/documents/{documentId}/documentNumbers:create:
    post:
      operationId: createDocumentNumber_1
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: documentId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDocumentNumberRequest'
      responses:
        '200':
          description: Document number generated
        '202':
          description: Accepted
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Access denied
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Document already has a document number / Document number sequence
            is currently locked / eGenerating document number is processing or finished
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Unsupported document category
      security:
      - oauth2:
        - space_write
      summary: Generate document number and regenerate representations
      tags:
      - Document Processor
      description: ' <br/> Scope: space_write'
  /v1/spaces/{spaceId}/documents/{documentId}/representations/{representationId}:createLink:
    post:
      operationId: createRepresentationContentLinkGeneratorLink
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: documentId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: representationId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDocumentRepresentationLinkRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentRepresentationContentLinkResponse'
          description: The generated link
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Access denied
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: The document or representation could not be found
      security:
      - oauth2:
        - space_read
      summary: Creates a long-lived link for creating signed urls for the content
        of a document representation
      tags:
      - Document Processor
      description: ' <br/> Scope: space_read'
  /v1/spaces/{spaceId}/documents/{documentId}:createVersion:
    post:
      operationId: createVersionDocument
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: documentId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CloneDocumentActionData'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentVersioningResponse'
          description: Latest version of the quote document
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Access denied
      security:
      - oauth2:
        - space_read
        - space_write
      summary: Create new version of quote document
      tags:
      - Document Processor
      description: ' <br/> Scope: space_read, space_write'
  /v1/spaces/{spaceId}/documents/{documentId}:finalize:
    post:
      operationId: finalizeDocument
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: documentId
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Document number and collection paylink generated
        '202':
          description: Accepted
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Access denied
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Document already has a document number / Document number sequence
            is currently locked / eGenerating document number is processing or finished
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Unsupported document category
      security:
      - oauth2:
        - space_read
        - space_write
      summary: Generate document number, collection paylink and regenerate representations
      tags:
      - Document Processor
      description: ' <br/> Scope: space_read, space_write'
  /v1/spaces/{spaceId}/documents/{documentId}:getOrCreateRepresentation:
    post:
      operationId: getOrCreateRepresentation
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: documentId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetOrCreateRepresentationRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentRepresentation'
          description: The matching representation
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Access denied
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: No matching representation found
      security:
      - oauth2:
        - space_write
      summary: Retrieve a document representation of the requested document type
      tags:
      - Document Processor
      description: ' <br/> Scope: space_write'
  /v1/spaces/{spaceId}/documents/{documentId}:processHITLFeedback/{token}/{humanInTheLoopRequestId}:
    post:
      description: 'Callback endpoint for the ONEA Human-In-The-Loop service. This
        endpoint is secured using a JWT token in the URL path. The token must be valid,
        unexpired, and contain ''spaceId'' and ''documentId'' claims that match the
        corresponding path variables. <br/> Scope: []'
      operationId: processHitlFeedback
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: documentId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: token
        required: true
        schema:
          type: string
      - in: path
        name: humanInTheLoopRequestId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HitlFeedbackPayload'
        required: true
      responses:
        '202':
          description: HITL Feedback processed.
        '400':
          description: Bad Request.
        '403':
          description: Forbidden. Returned if the JWT token is missing, invalid, expired,
            or if the 'spaceId' and 'documentId' claims do not match the URL.
        '404':
          description: Not Found.
      summary: Process HITL feedback
      tags:
      - Document Callback Api
  /v2/spaces/documents:validate:
    post:
      operationId: validate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentValidationRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentValidationResponse'
          description: OK
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentValidationResponse'
          description: The result of the validation initiation
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Access denied
      security:
      - oauth2:
        - space_read
      summary: Validates a set of documents
      tags:
      - Document Processor V2
      description: ' <br/> Scope: space_read'
  /v2/spaces/{spaceId}/documents/documentNumbers:
    get:
      description: 'Returns document number series configuration for all categories
        or a specific category. Merges data from extension settings (id, name, pattern)
        and locked settings (nextSequenceNumber, lastUsedAt). <br/> Scope: space_read'
      operationId: getDocumentNumberSeries
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: query
        name: category
        required: false
        schema:
          type: string
          enum:
          - PURCHASE_ORDER
          - ORDER_CONFIRMATION
          - DELIVERY_NOTE
          - GOODS_RECEIVED_NOTE
          - INVOICE
          - INVOICE_REMINDER
          - CREDIT_NOTE
          - RECEIPT
          - STATEMENT
          - QUOTE
          - CREDIT_CARD_STATEMENT
          - THIRD_PARTY_STATEMENT
          - FILE
          - SELF_BILLED_INVOICE
          - SELF_BILLED_CREDIT_NOTE
          - PROFORMA_INVOICE
          - OTHER
      - in: query
        name: includeBlankPatterns
        required: false
        schema:
          type: boolean
          default: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentNumbersResponse'
          description: Document number series configuration
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Access denied - user lacks space_read permission
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: The space hasn't yet performed document numbering migration
            for the category
      security:
      - oauth2:
        - space_read
      summary: Get document numbers configuration
      tags:
      - Document Processor V2
  /v2/spaces/{spaceId}/documents/documentNumbers/{category}/series:
    post:
      description: 'Creates a new document number series for a specified category.
        The series will be appended to the end of the existing series list for the
        category, and a new locked setting will be created with an initial counter
        value of 0. <br/> Scope: space_write'
      operationId: createDocumentNumberSeries
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: category
        required: true
        schema:
          type: string
          enum:
          - PURCHASE_ORDER
          - ORDER_CONFIRMATION
          - DELIVERY_NOTE
          - GOODS_RECEIVED_NOTE
          - INVOICE
          - INVOICE_REMINDER
          - CREDIT_NOTE
          - RECEIPT
          - STATEMENT
          - QUOTE
          - CREDIT_CARD_STATEMENT
          - THIRD_PARTY_STATEMENT
          - FILE
          - SELF_BILLED_INVOICE
          - SELF_BILLED_CREDIT_NOTE
          - PROFORMA_INVOICE
          - OTHER
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDocumentNumberSeriesRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDocumentNumberSeriesResponse'
          description: Series successfully created
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Invalid or unsupported category, or invalid pattern
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Access denied - user lacks space_write permission
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: The space hasn't yet performed document numbering migration
            for the category
      security:
      - oauth2:
        - space_write
      summary: Create document number series
      tags:
      - Document Processor V2
  /v2/spaces/{spaceId}/documents/documentNumbers/{category}/series/{seriesId}:
    delete:
      description: 'Deletes an existing document number series for a specified category.
        This operation removes the series from the extension settings and cleans up
        the corresponding counter state from the locked settings. The default series
        cannot be deleted; assign a new default first. <br/> Scope: space_write'
      operationId: deleteDocumentNumberSeries
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: category
        required: true
        schema:
          type: string
          enum:
          - PURCHASE_ORDER
          - ORDER_CONFIRMATION
          - DELIVERY_NOTE
          - GOODS_RECEIVED_NOTE
          - INVOICE
          - INVOICE_REMINDER
          - CREDIT_NOTE
          - RECEIPT
          - STATEMENT
          - QUOTE
          - CREDIT_CARD_STATEMENT
          - THIRD_PARTY_STATEMENT
          - FILE
          - SELF_BILLED_INVOICE
          - SELF_BILLED_CREDIT_NOTE
          - PROFORMA_INVOICE
          - OTHER
      - in: path
        name: seriesId
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: Series successfully deleted
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Access denied - user lacks space_write permission
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Category or series not found
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Conflict – either the series is currently set as the default
            series, or it is still referenced by documents in DRAFT or AWAITING_VALIDATION
            status
      security:
      - oauth2:
        - space_write
      summary: Delete document number series
      tags:
      - Document Processor V2
    patch:
      description: 'Partially updates an existing document number series. Any omitted
        field retains its current value. Acquires the series lock during the update
        to prevent concurrent number generation. <br/> Scope: space_write'
      operationId: updateDocumentNumberSeries
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: category
        required: true
        schema:
          type: string
          enum:
          - PURCHASE_ORDER
          - ORDER_CONFIRMATION
          - DELIVERY_NOTE
          - GOODS_RECEIVED_NOTE
          - INVOICE
          - INVOICE_REMINDER
          - CREDIT_NOTE
          - RECEIPT
          - STATEMENT
          - QUOTE
          - CREDIT_CARD_STATEMENT
          - THIRD_PARTY_STATEMENT
          - FILE
          - SELF_BILLED_INVOICE
          - SELF_BILLED_CREDIT_NOTE
          - PROFORMA_INVOICE
          - OTHER
      - in: path
        name: seriesId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDocumentNumberSeriesRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateDocumentNumberSeriesResponse'
          description: Series successfully updated
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Invalid pattern
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Access denied - user lacks space_write permission
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Category or series not found
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: The space hasn't yet performed document numbering migration
            for the category
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Failed to apply update — changes have been rolled back
      security:
      - oauth2:
        - space_write
      summary: Update document number series
      tags:
      - Document Processor V2
  /v2/spaces/{spaceId}/documents/documentNumbers/{category}/series/{seriesId}:markAsDefault:
    post:
      description: 'Sets the specified series as the default number series for the
        given category. <br/> Scope: space_write'
      operationId: markSeriesAsDefault
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: category
        required: true
        schema:
          type: string
          enum:
          - PURCHASE_ORDER
          - ORDER_CONFIRMATION
          - DELIVERY_NOTE
          - GOODS_RECEIVED_NOTE
          - INVOICE
          - INVOICE_REMINDER
          - CREDIT_NOTE
          - RECEIPT
          - STATEMENT
          - QUOTE
          - CREDIT_CARD_STATEMENT
          - THIRD_PARTY_STATEMENT
          - FILE
          - SELF_BILLED_INVOICE
          - SELF_BILLED_CREDIT_NOTE
          - PROFORMA_INVOICE
          - OTHER
      - in: path
        name: seriesId
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentNumbersResponse'
          description: Series successfully set as default
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Access denied - user lacks space_write permission
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Category or series not found
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: The space hasn't yet performed document numbering migration
            for the category
      security:
      - oauth2:
        - space_write
      summary: Mark series as default
      tags:
      - Document Processor V2
  /v2/spaces/{spaceId}/documents/{documentId}/documentNumbers:create:
    post:
      description: 'Generates and assigns document numbers based on configured patterns,
        featuring support for autogeneration placeholders, legacy fallback, and existing
        number validation. <br/> Scope: space_read, space_write'
      operationId: createDocumentNumber
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: documentId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDocumentNumberRequest'
      responses:
        '200':
          description: The generated or existing document number
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Access denied
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Document not found or sequence series configuration missing
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Document already has a document number / Document number sequence
            is currently locked / Generating document number is processing or finished
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Invalid configuration or document state
      security:
      - oauth2:
        - space_read
        - space_write
      summary: Generate document number
      tags:
      - Document Processor V2
  /v1/validate:
    post:
      tags:
      - Document validation
      summary: Validation document format
      description: 'This endpoint validates and detects the representation format
        of a document <br/> Scope: []'
      operationId: validateDocumentFormat
      requestBody:
        description: File Validate Request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentValidateRequest'
        required: true
      responses:
        '200':
          description: Validated document and detected its representation format successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentValidateResponse'
              example:
                errors: []
                warnings: []
                status: valid
                document_type: FACTUR X/ZUGFERD
                namespace: null
                profile: MINIMUM
        '400':
          description: Invalid or unsupported file's content type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '401':
          description: Access to this resource is denied due to missing or invalid
            authentication credentials. Please provide valid credentials and try again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
  /v1/files:convert:
    post:
      tags:
      - Document conversion
      summary: Convert document format
      description: 'This endpoint converts a document from one to another format <br/>
        Scope: []'
      operationId: convertDocumentFormat
      requestBody:
        description: File Convert Request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentConvertRequest'
        required: true
      responses:
        '200':
          description: The output document has been uploaded to your outputUrl.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentConvertResponse'
              example:
                inputType: eu.cen.en16931:ubl:1.3.12
                outputType: com.unifiedpost.btx.datastore.json:invoice:2.0
        '400':
          description: Invalid or unsupported outputType
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '401':
          description: Access to this resource is denied due to missing or invalid
            authentication credentials. Please provide valid credentials and try again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
  /v1/outputTypes:
    get:
      tags:
      - Document conversion
      summary: Get list of valid output types.
      description: 'This endpoint provides a list of valid output types for conversion.
        <br/> Scope: []'
      operationId: getOutputDocumentTypes
      responses:
        '200':
          description: List of valid output types.
          content:
            application/json:
              schema:
                type: string
              example:
                inputType: eu.cen.en16931:ubl:1.3.12
                outputType: com.unifiedpost.btx.datastore.json:invoice:2.0
        '401':
          description: Access to this resource is denied due to missing or invalid
            authentication credentials. Please provide valid credentials and try again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
  /v1/inputTypes:
    get:
      tags:
      - Document conversion
      summary: Get list of valid input types.
      description: 'This endpoint provides a list of valid input types for conversion.
        <br/> Scope: []'
      operationId: getInputDocumentTypes
      responses:
        '200':
          description: List of valid input types.
          content:
            application/json:
              schema:
                type: string
              example:
                inputType: eu.cen.en16931:ubl:1.3.12
                outputType: com.unifiedpost.btx.datastore.json:invoice:2.0
        '401':
          description: Access to this resource is denied due to missing or invalid
            authentication credentials. Please provide valid credentials and try again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
  /transaction/v1/spaces/{spaceId}/documents/{documentId}/attachments:
    get:
      tags:
      - Documents
      summary: Get list of document attachments
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get list of document attachments by documentId on the given space, with
        the option to filter out the result, and support pagination. <br/> Scope:
        space_read'
      operationId: getAllDocumentAttachments
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The id of document
        required: true
        schema:
          type: string
          format: uuid
      - name: tags
        in: query
        description: Filter by tags. Can be an array to filter by all tags (AND) -
          e.g. ?tags=first_tag&tags=second_tag. Or it could be a comma-separated list
          to filter by any of the values (OR) - e.g. ?tags=first_tag,second_tag.
        schema:
          type: array
          items:
            type: string
        example:
        - first_tag
        - second_tag
        - third_tag
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        schema:
          type: string
          enum:
          - createdAt
          - createdAt.asc
          - createdAt.desc
        example: createdAt.asc
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllDocumentAttachmentResult'
              examples:
                Document Attachments:
                  description: Document Attachments
                  value:
                    documentAttachments:
                    - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                      documentId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                      filename: doc-1.pdf
                      description: attachment for document DOC-1
                      retentionTime: 2129-01-14 19:58:47+00:00
                      status: AWAITING_UPLOAD
                      fileSize: 1024
                      fileType: pdf
                      contentType: application/pdf
                      uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=
                      tags:
                      - tag1
                      - tag2
                      metadata:
                        virus: hidden
                      createdAt: 2024-06-11 10:15:00+00:00
                      updatedAt: 2024-06-11 12:45:00+00:00
                    totalElements: 1
                    currentPage: 0
                    pageSize: 20
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not found - spaceId and documentId must be valid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2:
        - space_read
    post:
      tags:
      - Documents
      summary: Create document attachment
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Create attachment of the given document <br/> Scope: space_write'
      operationId: createDocumentAttachment
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The id of document
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Attachment data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentAttachmentRequest'
            examples:
              Attachment:
                description: Attachment
                value:
                  filename: doc-1.pdf
                  description: attachment for document DOC-1
                  retentionTime: 2129-01-14 19:58:47+02:00
                  fileSize: 1024
                  fileType: pdf
                  contentType: application/pdf
                  tags:
                  - tag1
                  - tag2
                  metadata:
                    virus: hidden
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentAttachmentResult'
              examples:
                Attachment:
                  description: Attachment
                  value:
                    id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                    documentId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                    filename: doc-1.pdf
                    description: attachment for document DOC-1
                    retentionTime: 2129-01-14 19:58:47+00:00
                    fileSize: 1024
                    fileType: pdf
                    contentType: application/pdf
                    uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=
                    tags:
                    - tag1
                    - tag2
                    metadata:
                      virus: hidden
                    status: AWAITING_UPLOAD
                    createdAt: 2024-06-11 10:15:00+00:00
                    updatedAt: 2024-06-11 12:45:00+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not found - spaceId and documentId must be valid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/documents/{documentId}/attachments/{documentAttachmentId}:
    get:
      tags:
      - Documents
      summary: Get document attachment info
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get document''s attachment information by its ID on the given space
        <br/> Scope: space_read'
      operationId: getDocumentAttachment
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: documentAttachmentId
        in: path
        description: The document attachment's identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentAttachmentResult'
              example:
                id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                documentId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                filename: doc-1.pdf
                description: attachment for document DOC-1
                retentionTime: 2129-01-14 19:58:47+00:00
                fileSize: 1024
                fileType: pdf
                contentType: application/pdf
                uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=
                tags:
                - tag1
                - tag2
                metadata:
                  virus: hidden
                status: AWAITING_UPLOAD
                createdAt: 2024-06-11 10:15:00+00:00
                updatedAt: 2024-06-11 12:45:00+00:00
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
      security:
      - oauth2:
        - space_read
    delete:
      tags:
      - Documents
      summary: Delete document attachment
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Delete document attachment by its ID on the given space. <br/> Scope:
        space_write'
      operationId: deleteDocumentAttachment
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: documentAttachmentId
        in: path
        description: The document attachment's identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
      security:
      - oauth2:
        - space_write
    patch:
      tags:
      - Documents
      summary: Update document attachment
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update attachment of the given document <br/> Scope: space_write'
      operationId: updateDocumentAttachment
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The id of document
        required: true
        schema:
          type: string
          format: uuid
      - name: documentAttachmentId
        in: path
        description: The id of document attachment
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Attachment data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDocumentAttachmentRequest'
            examples:
              Attachment:
                description: Attachment
                value:
                  filename: doc-1.pdf
                  description: attachment for document DOC-1
                  retentionTime: 2129-01-14 19:58:47+02:00
                  fileSize: 1024
                  fileType: pdf
                  status: PROCESSING
                  contentType: application/pdf
                  tags:
                  - tag1
                  - tag2
                  metadata:
                    virus: hidden
        required: true
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentAttachmentResult'
              examples:
                Attachment:
                  description: Attachment
                  value:
                    id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                    documentId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                    filename: doc-1.pdf
                    description: attachment for document DOC-1
                    retentionTime: 2129-01-14 19:58:47+00:00
                    fileSize: 1024
                    fileType: pdf
                    contentType: application/pdf
                    uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=
                    tags:
                    - tag1
                    - tag2
                    metadata:
                      virus: hidden
                    status: AWAITING_UPLOAD
                    createdAt: 2024-06-11 10:15:00+00:00
                    updatedAt: 2024-06-11 12:45:00+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not found - spaceId and documentId must be valid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/documents/{documentId}/attachments/{documentAttachmentId}/content:
    get:
      tags:
      - Documents
      summary: Retrieve document attachment content
      description: 'Retrieve document attachment content by its ID on the given space
        <br/> Scope: space_read'
      operationId: getDocumentAttachmentContent
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentAttachmentId
        in: path
        description: The document attachment identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Ok
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
              examples:
                PDF Example:
                  summary: Example of a document attachment content
                  description: PDF Example
                  value: VGhpcyBpcyBhIGJpbmFyeSBleGFtcGxlIHJlcHJlc2VudGluZyBkb2N1bWVudC4=
        '302':
          description: Found
          headers:
            Location:
              description: Redirect URL
              style: simple
              schema:
                type: string
        '404':
          description: UUID not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2:
        - space_read
  /transaction/v1/spaces/{spaceId}/documents/{documentId}/representations:
    get:
      tags:
      - Documents
      summary: Get list of document representations
      description: "<div class='my-preview'><span>Preview: The API is in development\
        \ or testing phases and the interface could still change slightly.</span></div>\
        \ <br/> \tGet list of document representations on the given space,\n\twith\
        \ the option to filter out the result. The API supports pagination.\n <br/>\
        \ Scope: space_read"
      operationId: getAllDocumentRepresentations
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: mainRepresentation
        in: query
        description: Whether the document is main or not
        schema:
          type: boolean
      - name: original
        in: query
        description: Whether the document is original or not
        schema:
          type: boolean
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllDocumentRepresentationResult'
              example:
                document_representations:
                - id: 0ca2797b-6365-4bf2-a490-247075e3cede
                  documentId: 00000001-0000-0000-0000-000000000001
                  retentionTime: 2023-10-04 14:20:31.502921+00:00
                  type: legal_xml
                  filename: legal_xml.xml
                  contentType: application/xml
                  size: 20
                  main: false
                  metadata:
                    virus: hidden
                  original: false
                  uploadUrl: http://path/to/file.xml
                  createdAt: 2023-10-04 14:20:31.502921+00:00
                  updatedAt: 2023-10-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
    post:
      tags:
      - Documents
      summary: Create document representation
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Create document representation on the given space <br/> Scope: space_write'
      operationId: createDocumentRepresentation
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      requestBody:
        description: Document to add
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentRepresentationRequest'
            example:
              fileSize: 10
              retentionTime: 2023-10-04 14:20:31.502921+00:00
              type: legal_xml
              filename: legal_xml.xml
              contentType: application/xml
              main: false
              md5Hash: 938c2cc0dcc05f2b68c4287040cfcf71
              original: true
              metadata:
                virus: hidden
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentRepresentationResult'
              example:
                id: 0ca2797b-6365-4bf2-a490-247075e3cede
                documentId: 00000001-0000-0000-0000-000000000001
                retentionTime: 2023-10-04 14:20:31.502921+00:00
                type: legal_xml
                filename: legal_xml.xml
                contentType: application/xml
                size: 20
                main: false
                metadata:
                  virus: hidden
                uploadUrl: http://path/to/file.xml
                md5Hash: 938c2cc0dcc05f2b68c4287040cfcf71
                original: true
                createdAt: 2023-10-04 14:20:31.502921+00:00
                updatedAt: 2023-10-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/documents/{documentId}/representations/{documentRepresentationId}:
    get:
      tags:
      - Documents
      summary: Get document representation info
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get document representation information by its ID on the given space
        <br/> Scope: space_read'
      operationId: getDocumentRepresentation
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: documentRepresentationId
        in: path
        description: The document representation identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      responses:
        '200':
          description: Ok. Document representation info.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentRepresentationResult'
              example:
                id: 0ca2797b-6365-4bf2-a490-247075e3cede
                documentId: 00000001-0000-0000-0000-000000000001
                retentionTime: 2023-10-04 14:20:31.502921+00:00
                type: legal_xml
                filename: legal_xml.xml
                contentType: application/xml
                size: 20
                main: false
                metadata:
                  virus: hidden
                uploadUrl: http://path/to/file.xml
                md5Hash: 938c2cc0dcc05f2b68c4287040cfcf71
                original: true
                createdAt: 2023-10-04 14:20:31.502921+00:00
                updatedAt: 2023-10-04 14:20:31.502921+00:00
        '404':
          description: Not Found. Document uuid must be invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
    delete:
      tags:
      - Documents
      summary: Delete document representation
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Delete document representation by its ID on the given space <br/> Scope:
        space_write'
      operationId: deleteDocumentRepresentation
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: documentRepresentationId
        in: path
        description: The document representation identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: Ok.
        '404':
          description: UUID not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
    patch:
      tags:
      - Documents
      summary: Update document representation
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update document representation by its ID on the given space <br/> Scope:
        space_write'
      operationId: updateDocumentRepresentation
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: documentRepresentationId
        in: path
        description: The document representation identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      requestBody:
        description: Document representation to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDocumentRepresentationRequest'
            example:
              retentionTime: 2023-10-04 14:20:31.502921+00:00
              type: legal_xml
              fileSize: 10
              filename: legal_xml.xml
              contentType: application/xml
              md5Hash: 938c2cc0dcc05f2b68c4287040cfcf71
              original: true
              metadata:
                virus: hidden
        required: true
      responses:
        '200':
          description: Update document representation successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentRepresentationResult'
              example:
                id: 0ca2797b-6365-4bf2-a490-247075e3cede
                documentId: 00000001-0000-0000-0000-000000000001
                retentionTime: 2023-10-04 14:20:31.502921+00:00
                type: legal_xml
                filename: legal_xml.xml
                contentType: application/xml
                size: 20
                main: false
                metadata:
                  virus: hidden
                uploadUrl: http://path/to/file.xml
                md5Hash: 938c2cc0dcc05f2b68c4287040cfcf71
                original: true
                createdAt: 2023-10-04 14:20:31.502921+00:00
                updatedAt: 2023-10-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/documents/{documentId}/representations/{documentRepresentationId}/content:
    get:
      tags:
      - Documents
      summary: Retrieve document content
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Retrieve document content by its ID on the given space <br/> Scope:
        space_read'
      operationId: getDocumentRepresentationContent
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: documentRepresentationId
        in: path
        description: The document representation identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Ok.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
              examples:
                PDF Example:
                  summary: Example of a document content
                  description: PDF Example
                  value: VGhpcyBpcyBhIGJpbmFyeSBleGFtcGxlIHJlcHJlc2VudGluZyBkb2N1bWVudC4=
        '302':
          description: Found
          headers:
            Location:
              description: Redirect URL
              style: simple
              schema:
                type: string
          content:
            text/plain:
              examples:
                Redirection Example:
                  summary: Example of a redirection response
                  description: Redirection Example
                  value: http://localhost/file.pdf
        '404':
          description: UUID not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
    put:
      tags:
      - Documents
      summary: Write content to document
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Set the content of document by its ID on the given space <br/> Scope:
        space_write'
      operationId: setDocumentRepresentationContent
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: documentRepresentationId
        in: path
        description: The document representation identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          '*/*':
            schema:
              type: object
      responses:
        '200':
          description: Ok.
        '400':
          description: Storage service does not allow direct uploading of binary content.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: UUID not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/documents/{documentId}:complete:
    post:
      tags:
      - Documents
      summary: Mark document as completed
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Mark document on the given space as completed <br/> Scope: space_write'
      operationId: completeDocument
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      responses:
        '204':
          description: OK
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/documents:
    get:
      tags:
      - Documents
      summary: ⚠️Get list of documents
      description: "\tGet list of documents on the given space, with options to filter\
        \ out the result.\n\tThe API supports pagination and sorting.\n"
      operationId: getAllDocuments
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: metadata
        in: query
        schema:
          type: array
          items:
            type: string
      - name: category
        in: query
        description: Document category to filter.
        schema:
          $ref: '#/components/schemas/DocumentCategory'
        example: PURCHASE_ORDER
      - name: status
        in: query
        schema:
          type: array
          items:
            type: string
      - name: status[ql]
        in: query
        description: Status query language DSL
        schema:
          type: string
        examples:
          example without parentheses:
            description: example without parentheses
            value: document=RECEIVED OR document=AWAITING_VALIDATION OR document=VALIDATED
              OR pay[exists]=true OR pay[notIn]=PARTIALLY_PAID,FULLY_PAID
          example with parentheses:
            description: example with parentheses
            value: (document=FULLY_APPROVED OR document=SENT) AND (pay=FULLY_PAID
              OR pay=PARTIALLY_PAID)
      - name: folder
        in: query
        description: Document folder.
        schema:
          $ref: '#/components/schemas/Folder'
        example: PURCHASES
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        schema:
          type: string
          enum:
          - createdAt
          - createdAt.asc
          - createdAt.desc
        example: createdAt.asc
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllDocumentResult'
              example:
                documents:
                - id: 0ca2797b-6365-4bf2-a490-247075e3cede
                  spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                  description: Sample Document
                  source: Sample Source
                  supplier:
                    id: 00000001-0000-0000-0000-000000000001
                  customer:
                    id: 00000001-0000-0000-0000-000000000002
                  status:
                    pay: FULLY_PAID
                  category: INVOICE
                  metadata:
                    virus: hidden
                  tags:
                  - new
                  tasks:
                  - extensionName: com.unifiedpost.btx.data:approve
                    status: approve
                  retentionTime: 2023-10-04 14:20:31.502921+00:00
                  createdAt: 2023-10-04 14:20:31.502921+00:00
                  updatedAt: 2023-10-04 14:20:31.502921+00:00
                totalElements: 100
                currentPage: 2
                pageSize: 2
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_read
    post:
      tags:
      - Documents
      summary: Create document
      description: Create document on the given space
      operationId: createDocument
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Document to add
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentRequest'
            example:
              waitForComplete: false
              description: This is the invoice for your new phone
              source: choruspro
              metadata:
                documentNumber: DN001
                issueDate: 2024-01-01
                dueDate: 2024-01-02
                documentType: invoice
                currencyCode: EUR
                netAmount: '200.00'
                vatAmount: '30.00'
                grossAmount: '230.00'
                openBalance: '230.00'
                vatDetails:
                - vatCode: AE
                  vatPercentage: '0'
                  netAmount: '100.00'
                  vatAmount: '10.00'
                - vatCode: AE
                  vatPercentage: '20.00'
                  netAmount: '100.00'
                  vatAmount: '20.00'
                - vatCode: AE
                  vatPercentage: '0.9'
                  netAmount: '100.00'
                  vatAmount: '20.00'
                paymentReference:
                  value: 001/4037/32870
                  type: STRUCTURED
                  scheme: OGM_VCS
                uploadId: '123456789'
                delivery:
                  deliveryDate: 2024-01-01
              tags:
              - new
              retentionTime: 2029-01-14 19:58:47+02:00
              supplier: 56079d21-a756-49fb-9286-9859c354aa69
              status:
                accept: ACCEPTED
              category: INVOICE
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResult'
              example:
                id: 0ca2797b-6365-4bf2-a490-247075e3cede
                spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                description: Sample Document
                source: Sample Source
                folder: PURCHASES
                supplier:
                  id: 00000001-0000-0000-0000-000000000001
                customer:
                  id: 00000001-0000-0000-0000-000000000002
                status:
                  pay: FULLY_PAID
                category: INVOICE
                metadata:
                  virus: hidden
                tags:
                - new
                tasks:
                - extensionName: com.unifiedpost.btx.data:approve
                  status: approve
                retentionTime: 2023-10-04 14:20:31.502921+00:00
                createdAt: 2023-10-04 14:20:31.502921+00:00
                updatedAt: 2023-10-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/{folder}/documents:
    get:
      tags:
      - Documents
      summary: ⚠️Get list of documents in folder
      description: "\tGet list of documents in the given folder, with options to filter\
        \ out the result.\n\tThe API supports pagination and sorting.\n"
      operationId: getAllDocumentsInFolder
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: path
        description: Folder name
        required: true
        schema:
          type: string
          enum:
          - purchases
          - sales
          - drafts
          - inbox
          - statements
          - files
      - name: metadata
        in: query
        schema:
          type: array
          items:
            type: string
      - name: category
        in: query
        description: Document category to filter. Can be multiple values separated
          by comma, or just one value
        explode: false
        schema:
          type: array
          items:
            type: string
        example: PURCHASE_ORDER,RECEIPT
      - name: status
        in: query
        schema:
          type: array
          items:
            type: string
      - name: status[ql]
        in: query
        description: Status query language DSL
        schema:
          type: string
        examples:
          example without parentheses:
            description: example without parentheses
            value: document=RECEIVED OR document=AWAITING_VALIDATION OR document=VALIDATED
              OR pay[exists]=true OR pay[notIn]=PARTIALLY_PAID,FULLY_PAID
          example with parentheses:
            description: example with parentheses
            value: (document=FULLY_APPROVED OR document=SENT) AND (pay=FULLY_PAID
              OR pay=PARTIALLY_PAID)
      - name: tags
        in: query
        description: tags
        schema:
          type: array
          items:
            type: string
        example:
        - first_tag
        - second_tag,third_tag
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        schema:
          type: string
          enum:
          - createdAt
          - createdAt.asc
          - createdAt.desc
        example: createdAt.asc
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllDocumentResult'
              example:
                documents:
                - id: 0ca2797b-6365-4bf2-a490-247075e3cede
                  spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                  description: Sample Document
                  source: Sample Source
                  supplier:
                    id: 00000001-0000-0000-0000-000000000001
                  customer:
                    id: 00000001-0000-0000-0000-000000000002
                  status:
                    pay: FULLY_PAID
                  category: INVOICE
                  metadata:
                    virus: hidden
                  tags:
                  - new
                  tasks:
                  - extensionName: com.unifiedpost.btx.data:approve
                    status: approve
                  retentionTime: 2023-10-04 14:20:31.502921+00:00
                  createdAt: 2023-10-04 14:20:31.502921+00:00
                  updatedAt: 2023-10-04 14:20:31.502921+00:00
                totalElements: 100
                currentPage: 2
                pageSize: 2
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_read
    post:
      tags:
      - Documents
      summary: Create document in folder
      description: Create document in the given folder. It can optionally contain
        line items.
      operationId: createDocumentWithFolder
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: path
        description: The folder of document
        required: true
        schema:
          type: string
          enum:
          - purchases
          - sales
          - drafts
          - inbox
          - statements
          - files
      requestBody:
        description: Document to add
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentRequest'
            examples:
              Document:
                description: Document
                value:
                  waitForComplete: false
                  description: This is the invoice for your new phone
                  source: choruspro
                  metadata:
                    documentNumber: DN001
                    issueDate: 2024-01-01
                    dueDate: 2024-01-02
                    documentType: invoice
                    currencyCode: EUR
                    netAmount: '200.00'
                    vatAmount: '30.00'
                    grossAmount: '230.00'
                    openBalance: '230.00'
                    vatDetails:
                    - vatCode: AE
                      vatPercentage: '0'
                      netAmount: '100.00'
                      vatAmount: '10.00'
                    - vatCode: AE
                      vatPercentage: '20.00'
                      netAmount: '100.00'
                      vatAmount: '20.00'
                    - vatCode: AE
                      vatPercentage: '0.9'
                      netAmount: '100.00'
                      vatAmount: '20.00'
                    paymentReference:
                      value: 001/4037/32870
                      type: STRUCTURED
                      scheme: OGM_VCS
                    uploadId: '123456789'
                    delivery:
                      deliveryDate: 2024-01-01
                  tags:
                  - new
                  retentionTime: 2029-01-14 19:58:47+02:00
                  supplier: 56079d21-a756-49fb-9286-9859c354aa69
                  status:
                    accept: ACCEPTED
                  category: INVOICE
              Document containing lines:
                description: Document containing lines
                value:
                  waitForComplete: false
                  description: This is the invoice for your new phone
                  source: choruspro
                  metadata:
                    documentNumber: DN001
                    issueDate: 2024-01-01
                    dueDate: 2024-01-02
                    documentType: invoice
                    currencyCode: EUR
                    netAmount: '200.00'
                    vatAmount: '30.00'
                    grossAmount: '230.00'
                    openBalance: '230.00'
                    vatDetails:
                    - vatCode: AE
                      vatPercentage: '0'
                      netAmount: '100.00'
                      vatAmount: '10.00'
                    - vatCode: AE
                      vatPercentage: '20.00'
                      netAmount: '100.00'
                      vatAmount: '20.00'
                    - vatCode: AE
                      vatPercentage: '0.9'
                      netAmount: '100.00'
                      vatAmount: '20.00'
                    paymentReference:
                      value: 001/4037/32870
                      type: STRUCTURED
                      scheme: OGM_VCS
                    uploadId: '123456789'
                    delivery:
                      deliveryDate: 2024-01-01
                  tags:
                  - new
                  retentionTime: 2029-01-14 19:58:47+02:00
                  supplier: 56079d21-a756-49fb-9286-9859c354aa69
                  status:
                    accept: ACCEPTED
                  category: INVOICE
                  lines:
                  - identifier: identifier 1
                    description: Line item 1
                    itemId: item1
                    itemCategory: category
                    productIdentifiers:
                      commodityCode: '123456'
                    quantity: 2
                    unit: PCS
                    startDate: 2024-01-23
                    endDate: 2024-06-23
                    discounts:
                      value: '20.0'
                    charges:
                      value: '76.67'
                    unitPrice: '40.278192'
                    netAmount: '80.56'
                    grossAmount: '96.67'
                    vatAmount: '16.11'
                    currency: USD
                    vatRate: '0.2'
                    vatCode: VAT
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResult'
              examples:
                Document:
                  description: Document
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    supplier:
                      id: 00000001-0000-0000-0000-000000000001
                    customer:
                      id: 00000001-0000-0000-0000-000000000002
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      virus: hidden
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    retentionTime: 2023-10-04 14:20:31.502921+00:00
                    createdAt: 2023-10-04 14:20:31.502921+00:00
                    updatedAt: 2023-10-04 14:20:31.502921+00:00
                Document containing lines:
                  description: Document containing lines
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    supplier:
                      id: 00000001-0000-0000-0000-000000000001
                    customer:
                      id: 00000001-0000-0000-0000-000000000002
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      virus: hidden
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    retentionTime: 2023-10-04 14:20:31.502921+00:00
                    lines:
                    - id: 7a1cf570-db5c-4e41-992e-9890532212ae
                      sequence: 1
                      identifier: identifier 1
                      description: Line item 1
                      itemId: item1
                      itemCategory: category
                      productIdentifiers:
                        commodityCode: '123456'
                      quantity: 2
                      unit: PCS
                      startDate: 2024-01-23
                      endDate: 2024-06-23
                      discounts:
                        value: '20.0'
                      charges:
                        value: '76.67'
                      unitPrice: '40.278192'
                      netAmount: '80.56'
                      grossAmount: '96.67'
                      vatAmount: '16.11'
                      currency: USD
                      vatRate: '0.2'
                      vatCode: VAT
                    createdAt: 2023-10-04 14:20:31.502921+00:00
                    updatedAt: 2023-10-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/documents/{documentId}:
    get:
      tags:
      - Documents
      summary: ⚠️Get document info
      description: Get document information by its ID on the given space
      operationId: getDocument
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      responses:
        '200':
          description: Ok. Document info.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResult'
              example:
                id: 0ca2797b-6365-4bf2-a490-247075e3cede
                spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                description: Sample Document
                source: Sample Source
                folder: PURCHASES
                supplier:
                  id: 00000001-0000-0000-0000-000000000001
                customer:
                  id: 00000001-0000-0000-0000-000000000002
                status:
                  pay: FULLY_PAID
                category: INVOICE
                metadata:
                  virus: hidden
                tags:
                - new
                tasks:
                - extensionName: com.unifiedpost.btx.data:approve
                  status: approve
                retentionTime: 2023-10-04 14:20:31.502921+00:00
                createdAt: 2023-10-04 14:20:31.502921+00:00
                updatedAt: 2023-10-04 14:20:31.502921+00:00
        '404':
          description: Not Found. Document uuid must be invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_read
    delete:
      tags:
      - Documents
      summary: Delete document
      description: Delete document by its ID on the given space. Will cascade delete
        associated balance offsets.
      operationId: deleteDocument
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      responses:
        '204':
          description: Ok.
        '404':
          description: UUID not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_write
    patch:
      tags:
      - Documents
      summary: Update document
      description: Update document by its ID on the given space by sending json with
        the changes
      operationId: updateDocument
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      requestBody:
        description: Document data to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDocumentRequest'
            example:
              metadata:
                documentNumber: DN001
                issueDate: 2024-01-01
                dueDate: 2024-01-02
                documentType: invoice
                currencyCode: EUR
                netAmount: '200.00'
                vatAmount: '30.00'
                grossAmount: '230.00'
                openBalance: '230.00'
                vatDetails:
                - vatCode: AE
                  vatPercentage: '0'
                  netAmount: '100.00'
                  vatAmount: '10.00'
                - vatCode: AE
                  vatPercentage: '20.00'
                  netAmount: '100.00'
                  vatAmount: '20.00'
                - vatCode: AE
                  vatPercentage: '0.9'
                  netAmount: '100.00'
                  vatAmount: '20.00'
                paymentReference:
                  value: 001/4037/32870
                  type: STRUCTURED
                  scheme: OGM_VCS
                uploadId: '123456789'
                delivery:
                  deliveryDate: 2024-01-01
              tags:
              - seen
              retentionTime: 2029-01-14 19:58:47+02:00
              supplier: 56079d21-a756-49fb-9286-9859c354aa69
              customer: 56079d21-a756-49fb-9286-9859c354aa69
              status:
                accept: UNACCEPTED
              category: INVOICE
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: replace
              path: /description
              value: patched description
            - op: remove
              path: /foo
        required: true
      responses:
        '200':
          description: Update document successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResult'
              example:
                id: 0ca2797b-6365-4bf2-a490-247075e3cede
                spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                description: Sample Document
                source: Sample Source
                folder: PURCHASES
                supplier:
                  id: 00000001-0000-0000-0000-000000000001
                customer:
                  id: 00000001-0000-0000-0000-000000000002
                status:
                  pay: FULLY_PAID
                category: INVOICE
                metadata:
                  virus: hidden
                tags:
                - new
                tasks:
                - extensionName: com.unifiedpost.btx.data:approve
                  status: approve
                retentionTime: 2023-10-04 14:20:31.502921+00:00
                createdAt: 2023-10-04 14:20:31.502921+00:00
                updatedAt: 2023-10-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space and/or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/{folder}/documents/{documentId}:
    get:
      tags:
      - Documents
      summary: ⚠️Get document info in folder
      description: Get document information by its ID in the given folder
      operationId: getDocumentByFolder
      parameters:
      - name: folder
        in: path
        description: The folder of document
        required: true
        schema:
          type: string
          enum:
          - purchases
          - sales
          - drafts
          - inbox
          - statements
          - files
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: includeLines
        in: query
        description: Should include lines in the result? Default is false
        schema:
          type: boolean
      responses:
        '200':
          description: Ok. Document info.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResult'
              examples:
                Document:
                  description: Document
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    supplier:
                      id: 00000001-0000-0000-0000-000000000001
                    customer:
                      id: 00000001-0000-0000-0000-000000000002
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      virus: hidden
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    retentionTime: 2023-10-04 14:20:31.502921+00:00
                    createdAt: 2023-10-04 14:20:31.502921+00:00
                    updatedAt: 2023-10-04 14:20:31.502921+00:00
                Document contains lines:
                  description: Document contains lines
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    supplier:
                      id: 00000001-0000-0000-0000-000000000001
                    customer:
                      id: 00000001-0000-0000-0000-000000000002
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      virus: hidden
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    retentionTime: 2023-10-04 14:20:31.502921+00:00
                    lines:
                    - id: 7a1cf570-db5c-4e41-992e-9890532212ae
                      sequence: 1
                      identifier: identifier 1
                      description: Line item 1
                      itemId: item1
                      itemCategory: category
                      productIdentifiers:
                        commodityCode: '123456'
                      quantity: 2
                      unit: PCS
                      startDate: 2024-01-23
                      endDate: 2024-06-23
                      discounts:
                        value: '20.0'
                      charges:
                        value: '76.67'
                      unitPrice: '40.278192'
                      netAmount: '80.56'
                      grossAmount: '96.67'
                      vatAmount: '16.11'
                      currency: USD
                      vatRate: '0.2'
                      vatCode: VAT
                    createdAt: 2023-10-04 14:20:31.502921+00:00
                    updatedAt: 2023-10-04 14:20:31.502921+00:00
        '404':
          description: Not Found. Document uuid must be invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_read
    delete:
      tags:
      - Documents
      summary: Delete document in folder
      description: Delete document by its ID in the given folder. Will cascade delete
        associated balance offsets.
      operationId: deleteDocumentByFolder
      parameters:
      - name: folder
        in: path
        description: The folder of document
        required: true
        schema:
          type: string
          enum:
          - purchases
          - sales
          - drafts
          - inbox
          - statements
          - files
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      responses:
        '204':
          description: Ok.
        '404':
          description: UUID not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_write
    patch:
      tags:
      - Documents
      summary: Update document in folder
      description: Update document by its ID in the given folder by sending json with
        the changes
      operationId: updateDocumentByFolder
      parameters:
      - name: folder
        in: path
        description: The folder of document
        required: true
        schema:
          type: string
          enum:
          - purchases
          - sales
          - drafts
          - inbox
          - statements
          - files
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      requestBody:
        description: Document data to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDocumentRequest'
            example:
              metadata:
                documentNumber: DN001
                issueDate: 2024-01-01
                dueDate: 2024-01-02
                documentType: invoice
                currencyCode: EUR
                netAmount: '200.00'
                vatAmount: '30.00'
                grossAmount: '230.00'
                openBalance: '230.00'
                vatDetails:
                - vatCode: AE
                  vatPercentage: '0'
                  netAmount: '100.00'
                  vatAmount: '10.00'
                - vatCode: AE
                  vatPercentage: '20.00'
                  netAmount: '100.00'
                  vatAmount: '20.00'
                - vatCode: AE
                  vatPercentage: '0.9'
                  netAmount: '100.00'
                  vatAmount: '20.00'
                paymentReference:
                  value: 001/4037/32870
                  type: STRUCTURED
                  scheme: OGM_VCS
                uploadId: '123456789'
                delivery:
                  deliveryDate: 2024-01-01
              tags:
              - seen
              retentionTime: 2029-01-14 19:58:47+02:00
              supplier: 56079d21-a756-49fb-9286-9859c354aa69
              customer: 56079d21-a756-49fb-9286-9859c354aa69
              status:
                accept: UNACCEPTED
              category: INVOICE
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: replace
              path: /description
              value: patched description
            - op: remove
              path: /foo
        required: true
      responses:
        '200':
          description: Update document successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResult'
              example:
                id: 0ca2797b-6365-4bf2-a490-247075e3cede
                spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                description: Sample Document
                source: Sample Source
                folder: PURCHASES
                supplier:
                  id: 00000001-0000-0000-0000-000000000001
                customer:
                  id: 00000001-0000-0000-0000-000000000002
                status:
                  pay: FULLY_PAID
                category: INVOICE
                metadata:
                  virus: hidden
                tags:
                - new
                tasks:
                - extensionName: com.unifiedpost.btx.data:approve
                  status: approve
                retentionTime: 2023-10-04 14:20:31.502921+00:00
                createdAt: 2023-10-04 14:20:31.502921+00:00
                updatedAt: 2023-10-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space UUID, Folder or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/documents:count:
    get:
      tags:
      - Documents
      summary: ⚠️Get count of documents
      description: Get count of documents on the given space
      operationId: getDocumentCount
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: category
        in: query
        description: Document category to filter.
        required: true
        schema:
          $ref: '#/components/schemas/DocumentCategory'
        example: PURCHASE_ORDER
      - name: status
        in: query
        required: true
        schema:
          type: string
          description: List of document statuses to filter, comma separated
          example: accept,pay
      - name: folder
        in: query
        description: Document folder to filter
        required: true
        schema:
          $ref: '#/components/schemas/Folder'
        example: PURCHASES
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllStatusCountResult'
              example:
                counts:
                - statuses:
                  - accept:UNACCEPTED
                  - pay:FULLY_PAID
                  count: 5
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_read
  /transaction/v1/spaces/{spaceId}/{folder}/documents:count:
    get:
      tags:
      - Documents
      summary: ⚠️Count documents in folder
      description: Get count of documents in the given folder
      operationId: getDocumentCountInFolder
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: path
        description: The folder of document
        required: true
        schema:
          type: string
          enum:
          - purchases
          - sales
          - drafts
          - inbox
          - statements
          - files
      - name: category
        in: query
        description: Document category to filter
        required: true
        schema:
          $ref: '#/components/schemas/DocumentCategory'
        example: PURCHASE_ORDER
      - name: status
        in: query
        required: true
        schema:
          type: string
          description: List of document statuses to filter, comma separated
          example: accept,payment
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllStatusCountResult'
              example:
                counts:
                - statuses:
                  - accept:UNACCEPTED
                  - pay:FULLY_PAID
                  count: 5
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_read
  /transaction/v1/spaces/{spaceId}/documents/{documentId}/files:
    get:
      tags:
      - Documents
      summary: Get files that linked to document
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get files that linked to document by its ID on the given space <br/>
        Scope: space_read'
      operationId: getFilesLinkedToDocument
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: metadata
        in: query
        description: Filter files by metadata key=value pairs.
        schema:
          type: string
        example: metadata=folder=PURCHASES&metadata=documentCategory=INVOICE
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilesResult'
              example:
                files:
                - id: ec6f8949-c34c-4f4e-a642-040711ad3e8e
                  description: the file for document DOC-1
                  metadata:
                    folder: PURCHASES
                    delivery:
                      peppol:
                        inboundDeliveryId: 01K3SVFC3GGPKESGWYY5NEDP5J
                    documentCategory: CREDIT_NOTE
                - id: 6c81cea8-494e-4f61-9161-1aa6799e9242
                  description: the file for document DOC-2
                  metadata:
                    folder: PURCHASES
                    delivery:
                      peppol:
                        inboundDeliveryId: 01K3T63M0ZZ9DY3WED97BH6PV4
                    documentCategory: INVOICE
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
    post:
      tags:
      - Documents
      summary: Link files to document
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Link files to document <br/> Scope: space_write'
      operationId: linkFilesToDocument
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: List of file IDs needs to be linked
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileList'
            example:
              files:
              - 74d06624-9368-45dc-a6ed-79fe6c1ed587
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileList'
              example:
                files:
                - 74d06624-9368-45dc-a6ed-79fe6c1ed587
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/documents/{documentId}:jsonpatch:
    patch:
      tags:
      - Documents
      summary: ⚠️Update document with JSON patch
      description: Update document by its ID on the given space by sending JSON patch
      operationId: jsonpatchDocument
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
      - name: documentId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        description: Document data to update
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: replace
              path: /description
              value: patched description
            - op: remove
              path: /foo
        required: true
      responses:
        '200':
          description: Update document successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResult'
              example:
                id: 0ca2797b-6365-4bf2-a490-247075e3cede
                spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                description: Sample Document
                source: Sample Source
                folder: PURCHASES
                supplier:
                  id: 00000001-0000-0000-0000-000000000001
                customer:
                  id: 00000001-0000-0000-0000-000000000002
                status:
                  pay: FULLY_PAID
                category: INVOICE
                metadata:
                  virus: hidden
                tags:
                - new
                tasks:
                - extensionName: com.unifiedpost.btx.data:approve
                  status: approve
                retentionTime: 2023-10-04 14:20:31.502921+00:00
                createdAt: 2023-10-04 14:20:31.502921+00:00
                updatedAt: 2023-10-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space and/or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/{folder}/documents/{documentId}:jsonpatch:
    patch:
      tags:
      - Documents
      summary: ⚠️Update document in folder via JSON patch
      description: Update document by its ID in the given folder by sending JSON patch
      operationId: jsonpatchDocumentByFolder
      parameters:
      - name: folder
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/Folder'
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
      - name: documentId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        description: Document data to update
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: replace
              path: /description
              value: patched description
            - op: remove
              path: /foo
        required: true
      responses:
        '200':
          description: Update document successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResult'
              example:
                id: 0ca2797b-6365-4bf2-a490-247075e3cede
                spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                description: Sample Document
                source: Sample Source
                folder: PURCHASES
                supplier:
                  id: 00000001-0000-0000-0000-000000000001
                customer:
                  id: 00000001-0000-0000-0000-000000000002
                status:
                  pay: FULLY_PAID
                category: INVOICE
                metadata:
                  virus: hidden
                tags:
                - new
                tasks:
                - extensionName: com.unifiedpost.btx.data:approve
                  status: approve
                retentionTime: 2023-10-04 14:20:31.502921+00:00
                createdAt: 2023-10-04 14:20:31.502921+00:00
                updatedAt: 2023-10-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space UUID, Folder or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/files:
    get:
      tags:
      - Files
      summary: Get all files
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get all files in the space <br/> Scope: space_read'
      operationId: getAllFiles
      parameters:
      - name: filter
        in: query
        schema:
          $ref: '#/components/schemas/FileSingleParams'
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: metadata
        in: query
        description: File metadata key value
        schema:
          type: array
          items:
            type: string
        example: metadata=key=value&metadata=key1=value1
      - name: tags
        in: query
        description: Filter by tags
        schema:
          type: array
          items:
            type: string
        example:
        - first_tag
        - second_tag,third_tag
      - name: ql
        in: query
        description: BTX Query Language filter expression.
        schema:
          type: string
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        schema:
          type: string
          enum:
          - createdAt
          - createdAt.asc
          - createdAt.desc
          - updatedAt
          - updatedAt.asc
          - updatedAt.desc
          - filename
          - filename.asc
          - filename.desc
          - creatorType
          - creatorType.asc
          - creatorType.desc
          - status
          - status.asc
          - status.desc
          - fileType
          - fileType.asc
          - fileType.desc
          - metadata.folder
          - metadata.folder.asc
          - metadata.folder.desc
          - metadata.documentCategory
          - metadata.documentCategory.asc
          - metadata.documentCategory.desc
        example: createdAt.asc
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllFilesResult'
              examples:
                Top-Level Files:
                  description: Top-Level Files
                  value:
                    files:
                    - id: 00000003-0000-0000-0000-000000000000
                      filename: legal_xml.xml
                      description: the file for document DOC-1
                      creatorSubject: 00000001-0001-0001-0001-000000000000
                      creatorType: user
                      retentionTime: 2029-01-14 19:58:47+00:00
                      status: PROCESSING
                      fileSize: 1024
                      fileType: xml
                      contentType: application/xml
                      uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=
                      source: com.unifiedpost.btx.connectors:peppol
                      children: []
                      tags:
                      - tag1
                      - tag2
                      metadata:
                        virus: hidden
                      createdAt: 2024-06-11 10:15:00+00:00
                      updatedAt: 2024-06-11 12:45:00+00:00
                    totalElements: 1
                    currentPage: 0
                    pageSize: 20
                List Files with Children:
                  description: List Files with Children
                  value:
                    files:
                    - id: 00000003-0000-0000-0000-000000000000
                      filename: legal_xml.xml
                      description: the file for document DOC-1
                      creatorSubject: 00000001-0001-0001-0001-000000000000
                      creatorType: user
                      retentionTime: 2029-01-14 19:58:47+00:00
                      status: PROCESSING
                      fileSize: 1024
                      fileType: xml
                      contentType: application/xml
                      uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=
                      source: com.unifiedpost.btx.connectors:peppol
                      parentFileId: 00000001-0004-0000-0000-000000000000
                      children:
                      - id: 00000003-1111-0000-0000-000000000000
                        filename: child file
                        description: the child file
                        creatorSubject: 00000001-0001-0001-0001-000000000000
                        creatorType: user
                        retentionTime: 2029-01-14 19:58:47+00:00
                        status: PROCESSED
                        fileSize: 1024
                        fileType: application/xml
                        contentType: application/xml
                        uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=...
                        source: email
                        parentFileId: 00000003-0000-0000-0000-000000000000
                        children: []
                        tags:
                        - tag1
                        metadata: {}
                        createdAt: 2024-06-12 10:15:00+00:00
                        updatedAt: 2024-06-12 12:45:00+00:00
                      tags:
                      - tag1
                      - tag2
                      metadata:
                        virus: hidden
                      createdAt: 2024-06-11 10:15:00+00:00
                      updatedAt: 2024-06-11 12:45:00+00:00
                    totalElements: 1
                    currentPage: 0
                    pageSize: 20
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
    post:
      tags:
      - Files
      summary: Create file in the space
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Create file in the space <br/> Scope: space_write'
      operationId: createSpaceFile
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: File data to add
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileRequest'
            examples:
              Create File Request:
                description: Create File Request
                value:
                  filename: legal_xml.xml
                  description: the file for document DOC-1
                  creatorSubject: 00000001-0001-0001-0001-000000000000
                  creatorType: user
                  retentionTime: 2129-01-14 19:58:47+00:00
                  fileSize: 1024
                  fileType: xml
                  contentType: application/xml
                  source: com.unifiedpost.btx.connectors:peppol
                  tags:
                  - tag1
                  - tag2
                  metadata:
                    virus: hidden
              Create Child File Request:
                description: Create Child File Request
                value:
                  filename: legal_xml.xml
                  description: the file for document DOC-1
                  creatorSubject: 00000001-0001-0001-0001-000000000000
                  creatorType: user
                  retentionTime: 2129-01-14 19:58:47+00:00
                  fileSize: 1024
                  fileType: xml
                  contentType: application/xml
                  source: com.unifiedpost.btx.connectors:peppol
                  parentFileId: 00000001-0004-0000-0000-000000000000
                  tags:
                  - tag1
                  - tag2
                  metadata:
                    virus: hidden
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileResult'
              examples:
                Top-Level File Result:
                  description: Top-Level File Result
                  value:
                    id: 00000003-0000-0000-0000-000000000000
                    filename: legal_xml.xml
                    description: the file for document DOC-1
                    creatorSubject: 00000001-0001-0001-0001-000000000000
                    creatorType: user
                    retentionTime: 2129-01-14 19:58:47+00:00
                    status: PROCESSING
                    fileSize: 1024
                    fileType: xml
                    contentType: application/xml
                    uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=
                    source: com.unifiedpost.btx.connectors:peppol
                    children: []
                    tags:
                    - tag1
                    - tag2
                    metadata:
                      virus: hidden
                    createdAt: 2024-06-11 10:15:00+00:00
                    updatedAt: 2024-06-11 12:45:00+00:00
                Child File Result:
                  description: Child File Result
                  value:
                    id: 00000003-0000-0000-0000-000000000000
                    filename: legal_xml.xml
                    description: the file for document DOC-1
                    creatorSubject: 00000001-0001-0001-0001-000000000000
                    creatorType: user
                    retentionTime: 2129-01-14 19:58:47+00:00
                    status: PROCESSING
                    fileSize: 1024
                    fileType: xml
                    contentType: application/xml
                    uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=
                    source: com.unifiedpost.btx.connectors:peppol
                    parentFileId: 00000001-0004-0000-0000-000000000000
                    children:
                    - id: 00000003-1111-0000-0000-000000000000
                      filename: child file
                      description: the child file
                      creatorSubject: 00000001-0001-0001-0001-000000000000
                      creatorType: user
                      retentionTime: 2029-01-14 19:58:47+00:00
                      status: PROCESSED
                      fileSize: 1024
                      fileType: application/xml
                      contentType: application/xml
                      uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=...
                      source: email
                      parentFileId: 00000003-0000-0000-0000-000000000000
                      children: []
                      tags:
                      - tag1
                      metadata: {}
                      createdAt: 2024-06-12 10:15:00+00:00
                      updatedAt: 2024-06-12 12:45:00+00:00
                    tags:
                    - tag1
                    - tag2
                    metadata:
                      virus: hidden
                    createdAt: 2024-06-11 10:15:00+00:00
                    updatedAt: 2024-06-11 12:45:00+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/files/{fileId}:
    get:
      tags:
      - Files
      summary: Get file info
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get file information by its ID on the given space <br/> Scope: space_read'
      operationId: getSpaceFile
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: fileId
        in: path
        description: The file identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: include
        in: query
        description: What extra data to include in the response.
        schema:
          type: string
        example: children
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileResult'
              example:
                id: 00000003-0000-0000-0000-000000000000
                filename: legal_xml.xml
                description: the file for document DOC-1
                creatorSubject: 00000001-0001-0001-0001-000000000000
                creatorType: user
                retentionTime: 2129-01-14 19:58:47+00:00
                status: PROCESSING
                fileSize: 1024
                fileType: xml
                contentType: application/xml
                uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=
                source: com.unifiedpost.btx.connectors:peppol
                children: []
                tags:
                - tag1
                - tag2
                metadata:
                  virus: hidden
                createdAt: 2024-06-11 10:15:00+00:00
                updatedAt: 2024-06-11 12:45:00+00:00
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
    delete:
      tags:
      - Files
      summary: Delete file info
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Delete file information by its ID on the given space <br/> Scope: space_write'
      operationId: deleteSpaceFile
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: fileId
        in: path
        description: The file identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      responses:
        '204':
          description: OK
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
    patch:
      tags:
      - Files
      summary: Update file in the space
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update file in the space <br/> Scope: space_write'
      operationId: updateSpaceFile
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: fileId
        in: path
        description: The file identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: File data to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFileRequest'
            example:
              filename: legal_xml.xml
              description: the file for document DOC-1
              creatorSubject: 00000001-0001-0001-0001-000000000000
              creatorType: user
              retentionTime: 2129-01-14 19:58:47+00:00
              status: AWAITING_USER_ACTION
              fileSize: 1024
              fileType: xml
              contentType: application/xml
              source: com.unifiedpost.btx.connectors:peppol
              parentFileId: b8536327-4c29-4280-9da2-aa190e8484b7
              tags:
              - tag1
              - tag2
              metadata:
                virus: hidden
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileResult'
              example:
                id: 00000003-0000-0000-0000-000000000000
                filename: legal_xml.xml
                description: the file for document DOC-1
                creatorSubject: 00000001-0001-0001-0001-000000000000
                creatorType: user
                retentionTime: 2129-01-14 19:58:47+00:00
                status: PROCESSING
                fileSize: 1024
                fileType: xml
                contentType: application/xml
                uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=
                source: com.unifiedpost.btx.connectors:peppol
                children: []
                tags:
                - tag1
                - tag2
                metadata:
                  virus: hidden
                createdAt: 2024-06-11 10:15:00+00:00
                updatedAt: 2024-06-11 12:45:00+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/files/{fileId}/documents:
    get:
      tags:
      - Files
      summary: Get document that linked to file
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get document file information by its ID on the given space <br/> Scope:
        space_read'
      operationId: getDocumentLinkedToFile
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: fileId
        in: path
        description: The file identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListLinkedDocumentsResult'
              example:
                documents:
                - id: d5330d4e-0d3d-4a32-b256-bdf97f9a68cb
                  description: Sample Document
                - id: 40af7dca-5556-4cf2-8aed-20a165e3071f
                  description: Another sample document
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
    post:
      tags:
      - Files
      summary: Link documents to file
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Link documents to file in the space <br/> Scope: space_write'
      operationId: linkDocumentsToFile
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: fileId
        in: path
        description: The file identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: List of document IDs needs to be linked
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentList'
            example:
              documents:
              - 1853a6f9-24f4-4bbc-b743-02453a3949b8
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentList'
              example:
                documents:
                - 1853a6f9-24f4-4bbc-b743-02453a3949b8
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/files/{fileId}/content:
    get:
      tags:
      - Files
      summary: Get file content
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get file content by its ID on the given space <br/> Scope: space_read'
      operationId: getSpaceFileContent
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: fileId
        in: path
        description: The file identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      responses:
        '200':
          description: Ok.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '302':
          description: Found
        '404':
          description: UUID not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        default:
          description: Other error messages
          content:
            application/octet-stream:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
  /transaction/v1/spaces/{spaceId}/files/{fileId}/documents/{documentId}:
    delete:
      tags:
      - Files
      summary: Unlink a document from a file
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Remove the link between a specific document and a file in the space
        <br/> Scope: space_write'
      operationId: unlinkDocumentFromFile
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: fileId
        in: path
        description: The file identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier to unlink from the file
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/{folder}/documents/{documentId}/lines:
    get:
      tags:
      - Documents
      summary: ⚠️Get line items
      description: Retrieve document line items
      operationId: getLineItems
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: path
        description: The folder of document
        required: true
        schema:
          type: string
          enum:
          - purchases
          - sales
          - drafts
          - inbox
          - statements
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllLineItemsResult'
              example:
                lines:
                - id: 7a1cf570-db5c-4e41-992e-9890532212ae
                  sequence: 1
                  identifier: identifier 1
                  description: Line item 1
                  itemId: item1
                  itemCategory: category
                  productIdentifiers:
                    commodityCode: '123456'
                  quantity: 2
                  unit: PCS
                  startDate: 2024-01-23
                  endDate: 2024-06-23
                  discounts:
                    value: '20.0'
                  charges:
                    value: '76.67'
                  unitPrice: '40.278192'
                  netAmount: '80.56'
                  grossAmount: '96.67'
                  vatAmount: '16.11'
                  currency: USD
                  vatRate: '0.2'
                  vatCode: VAT
                totalElements: 42
                currentPage: 1
                pageSize: 1
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_read
    post:
      tags:
      - Documents
      summary: Create line item(s)
      description: Create line item(s) in the document. New line items are added to
        the existing ones
      operationId: createLineItems
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: path
        description: The folder of document
        required: true
        schema:
          type: string
          enum:
          - purchases
          - sales
          - drafts
          - inbox
          - statements
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      requestBody:
        description: Line items to add
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LineItemListRequest'
            example:
              lines:
              - identifier: identifier 1
                description: Line item 1
                itemId: item1
                itemCategory: category
                productIdentifiers:
                  commodityCode: '123456'
                quantity: 2
                unit: PCS
                startDate: 2024-01-23
                endDate: 2024-06-23
                discounts:
                  value: '20.0'
                charges:
                  value: '76.67'
                unitPrice: '40.278192'
                netAmount: '80.56'
                grossAmount: '96.67'
                vatAmount: '16.11'
                currency: USD
                vatRate: '0.2'
                vatCode: VAT
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LineItemListResult'
              example:
                lines:
                - id: 7a1cf570-db5c-4e41-992e-9890532212ae
                  sequence: 1
                  identifier: identifier 1
                  description: Line item 1
                  itemId: item1
                  itemCategory: category
                  productIdentifiers:
                    commodityCode: '123456'
                  quantity: 2
                  unit: PCS
                  startDate: 2024-01-23
                  endDate: 2024-06-23
                  discounts:
                    value: '20.0'
                  charges:
                    value: '76.67'
                  unitPrice: '40.278192'
                  netAmount: '80.56'
                  grossAmount: '96.67'
                  vatAmount: '16.11'
                  currency: USD
                  vatRate: '0.2'
                  vatCode: VAT
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/{folder}/documents/{documentId}/lines/{lineId}:
    get:
      tags:
      - Documents
      summary: ⚠️Get line item
      description: Get line item detail
      operationId: getLineItem
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: path
        description: The folder of document
        required: true
        schema:
          type: string
          enum:
          - purchases
          - sales
          - drafts
          - inbox
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: lineId
        in: path
        description: The line item identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 7e76686f-f021-488d-a8e0-2c66beff4772
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LineItemResult'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_read
    delete:
      tags:
      - Documents
      summary: Delete line item
      description: Delete line item
      operationId: deleteLineItem
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: path
        description: The folder of document
        required: true
        schema:
          type: string
          enum:
          - purchases
          - sales
          - drafts
          - inbox
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: lineId
        in: path
        description: The line item identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 7e76686f-f021-488d-a8e0-2c66beff4772
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_write
    patch:
      tags:
      - Documents
      summary: Update line item
      description: Update line item
      operationId: updateLineItem
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: path
        description: The folder of document
        required: true
        schema:
          type: string
          enum:
          - purchases
          - sales
          - drafts
          - inbox
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: lineId
        in: path
        description: The line item identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 7e76686f-f021-488d-a8e0-2c66beff4772
      requestBody:
        description: Line items to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLineItemRequest'
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LineItemResult'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/documents/{documentId}/tasks:
    get:
      tags:
      - Documents
      summary: ⚠️Get document tasks
      description: Get list of document tasks on the given document in the given space.
        The API supports pagination.
      operationId: getAllTasks
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllTaskResult'
              example:
                tasks:
                - extensionName: com.unifiedpost.com:approve
                  status: approve
                  context:
                    test: ok
                - extensionName: com.unifiedpost.com:reject
                  status: reject
                  context:
                    test: ok
                totalElements: 100
                currentPage: 2
                pageSize: 2
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_read
    post:
      tags:
      - Documents
      summary: Create document task
      description: Create document task on the given document in the given space.
      operationId: createTask
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      requestBody:
        description: Task to add
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskRequest'
            example:
              extensionName: com.unifiedpost.btx.data:validate+approve
              context:
                test: ok
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResult'
              example:
                extensionName: com.unifiedpost.btx.data:approve
                status: approve
                context:
                  test: ok
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_write
  /transaction/v1/spaces/{spaceId}/documents/{documentId}/tasks/{extensionName}:
    get:
      tags:
      - Documents
      summary: ⚠️Get document task info
      description: Get document task information by extension name on the given document
        in the given space.
      operationId: getTaskInfo
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: extensionName
        in: path
        description: The task name
        required: true
        schema:
          type: string
        example: com.unifiedpost.btx.data:approve
      responses:
        '200':
          description: Ok. Task info.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResult'
              example:
                extensionName: com.unifiedpost.btx.data:approve
                status: approve
                context:
                  test: ok
        '404':
          description: Not Found. Document/space uuid must be invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_read
    delete:
      tags:
      - Documents
      summary: Delete document task
      description: Delete a document task by extension name on the given document
        in the given space.
      operationId: deleteTask
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: extensionName
        in: path
        description: The extension name
        required: true
        schema:
          type: string
        example: com.unifiedpost.btx.data:approve
      responses:
        '204':
          description: Ok.
        '404':
          description: UUID not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_write
    patch:
      tags:
      - Documents
      summary: Update document task
      description: Update document task by extension name on the given document in
        the given space.
      operationId: updateTask
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: extensionName
        in: path
        description: The extension name
        required: true
        schema:
          type: string
        example: com.unifiedpost.btx.data:approve
      requestBody:
        description: Task data to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTaskRequest'
            example:
              status: in progress
        required: true
      responses:
        '200':
          description: Update task successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResult'
              example:
                extensionName: com.unifiedpost.btx.data:approve
                status: approve
                context:
                  test: ok
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Document/space UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_write
  /transaction/v2/spaces/{spaceId}/{folder}/directories:
    post:
      tags:
      - Documents
      summary: Create directory
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Create a directory in the given folder and space <br/> Scope: space_write'
      operationId: createDirectory
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: path
        description: Folder which the directory belongs to (case insensitive)
        required: true
        schema:
          $ref: '#/components/schemas/FolderLowercase'
      requestBody:
        description: Directory to add
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DirectoryRequest'
            example:
              name: Fruits
              parentDirectoryId: 44d929f7-952d-4283-9010-8a63a16831b3
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectoryResponse'
              example:
                id: a00f8ca7-cd3b-4a2a-93c5-919a8c126ce5
                spaceId: f654868c-a30c-4286-b3be-41c58ef220a4
                name: Fruits
                folder: FILES
                parentDirectory:
                  id: 44d929f7-952d-4283-9010-8a63a16831b3
                  name: Plant
                timestamps:
                  createdAt: 2025-07-21 16:08:33+00:00
                  updatedAt: 2025-07-21 16:09:33+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v2/spaces/{spaceId}/{folder}/directories/{directoryId}:
    get:
      tags:
      - Documents
      summary: Get directory details
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get details of directory on the given space. <br/> Scope: space_read'
      operationId: getDirectoryDetails
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: path
        description: Folder which the directory belongs to (case insensitive)
        required: true
        schema:
          $ref: '#/components/schemas/FolderLowercase'
      - name: directoryId
        in: path
        description: The directory identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: include
        in: query
        description: What extra data to include in the response.
        explode: false
        schema:
          type: array
          items:
            type: string
            enum:
            - timestamps
        example: timestamps
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectoryResponse'
              example:
                id: a00f8ca7-cd3b-4a2a-93c5-919a8c126ce5
                spaceId: f654868c-a30c-4286-b3be-41c58ef220a4
                name: Fruits
                folder: FILES
                parentDirectory:
                  id: 44d929f7-952d-4283-9010-8a63a16831b3
                  name: Plant
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
    delete:
      tags:
      - Documents
      summary: Delete directory
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Delete directory on the given space. <br/> Scope: space_write'
      operationId: deleteDirectory
      parameters:
      - name: spaceId
        in: path
        description: The space identifier.
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: path
        description: Folder which the directory belongs to (case insensitive)
        required: true
        schema:
          $ref: '#/components/schemas/FolderLowercase'
      - name: directoryId
        in: path
        description: The directory identifier.
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
    patch:
      tags:
      - Documents
      summary: Update directory details
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update directory details on the given space. <br/> Scope: space_write'
      operationId: updateDirectory
      parameters:
      - name: spaceId
        in: path
        description: The space identifier.
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: path
        description: Folder which the directory belongs to (case insensitive)
        required: true
        schema:
          $ref: '#/components/schemas/FolderLowercase'
      - name: directoryId
        in: path
        description: The directory identifier.
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Directory to update
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/UpdateDirectoryRequest'
            examples:
              Directory:
                description: Directory
                value:
                  name: Fruits
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectoryResponse'
              example:
                id: a00f8ca7-cd3b-4a2a-93c5-919a8c126ce5
                spaceId: f654868c-a30c-4286-b3be-41c58ef220a4
                name: Fruits
                folder: FILES
                parentDirectory:
                  id: 44d929f7-952d-4283-9010-8a63a16831b3
                  name: Plant
                timestamps:
                  createdAt: 2025-07-21 16:08:33+00:00
                  updatedAt: 2025-07-21 16:09:33+00:00
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v2/spaces/{spaceId}/{folder}/directories/{directoryId}/content:
    get:
      tags:
      - Documents
      summary: Get directory contents
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get directories and documents in a directory <br/> Scope: space_read'
      operationId: listDirectoryContents
      parameters:
      - name: spaceId
        in: path
        description: The space identifier.
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: path
        description: Folder which the directory belongs to (case insensitive)
        required: true
        schema:
          $ref: '#/components/schemas/FolderLowercase'
      - name: directoryId
        in: path
        description: The directory identifier.
        required: true
        schema:
          type: string
          format: uuid
      - name: include
        in: query
        description: What extra data to include in the response.
        explode: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/FolderItemInclude'
        example: timestamps,metadata
      - name: name[icont]
        in: query
        description: Term used to search by item name (directories) or description
          (documents)
        schema:
          type: string
        example: Sale invoice
      - name: name
        in: query
        description: Exact name match for item name (directories) or description (documents)
        schema:
          type: string
        example: Sale invoice 2
      - name: type
        in: query
        description: 'Filter by item type: either ''DOCUMENT'' or ''DIRECTORY'''
        schema:
          $ref: '#/components/schemas/FolderItemType'
        example: DOCUMENT
      - name: sortBy
        in: query
        description: 'Sort results by field. Supported values: createdAt, createdAt.asc,
          createdAt.desc, updatedAt, updatedAt.asc, updatedAt.desc, name, name.asc,
          name.desc, type, type.asc, type.desc'
        schema:
          type: string
        example: name.asc
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListFolderItemsResponse'
              example:
                items:
                - id: 19510e39-4936-472d-8b20-2ca14bc4edb8
                  name: Sale invoice 2
                  type: document
                  metadata:
                    documentNumber: SALE02
                  timestamps:
                    createdAt: 2025-07-21 16:08:33+00:00
                    updatedAt: 2025-07-21 16:09:33+00:00
                - id: 059c6942-05e6-4844-bb5a-20e110317ba6
                  name: UP Store
                  type: directory
                  timestamps:
                    createdAt: 2025-07-21 15:25:11+00:00
                    updatedAt: 2025-07-21 15:25:11+00:00
                currentPage: 0
                pageSize: 20
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
  /transaction/v2/spaces/{spaceId}/{folder}/content:
    get:
      tags:
      - Documents
      summary: Get root directory contents
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get the top-level (root) directories and documents <br/> Scope: space_read'
      operationId: listRootDirectoryContents
      parameters:
      - name: spaceId
        in: path
        description: The space identifier.
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: path
        description: Folder of the root items (case insensitive)
        required: true
        schema:
          $ref: '#/components/schemas/FolderLowercase'
      - name: include
        in: query
        description: What extra data to include in the response.
        explode: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/FolderItemInclude'
        example: timestamps,metadata
      - name: name[icont]
        in: query
        description: Term used to search by item name (directories) or description
          (documents)
        schema:
          type: string
        example: Sale invoice
      - name: name
        in: query
        description: Exact name match for item name (directories) or description (documents)
        schema:
          type: string
        example: Sale invoice 2
      - name: type
        in: query
        description: 'Filter by item type: either ''DOCUMENT'' or ''DIRECTORY'''
        schema:
          $ref: '#/components/schemas/FolderItemType'
        example: DOCUMENT
      - name: sortBy
        in: query
        description: 'Sort results by field. Supported values: createdAt, createdAt.asc,
          createdAt.desc, updatedAt, updatedAt.asc, updatedAt.desc, name, name.asc,
          name.desc, type, type.asc, type.desc'
        schema:
          type: string
        example: name.asc
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListFolderItemsResponse'
              example:
                items:
                - id: 19510e39-4936-472d-8b20-2ca14bc4edb8
                  name: Sale invoice 2
                  type: document
                  metadata:
                    documentNumber: SALE02
                  timestamps:
                    createdAt: 2025-07-21 16:08:33+00:00
                    updatedAt: 2025-07-21 16:09:33+00:00
                - id: 059c6942-05e6-4844-bb5a-20e110317ba6
                  name: UP Store
                  type: directory
                  timestamps:
                    createdAt: 2025-07-21 15:25:11+00:00
                    updatedAt: 2025-07-21 15:25:11+00:00
                currentPage: 0
                pageSize: 20
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
  /transaction/v2/spaces/{spaceId}/{folder}/directories/{directoryId}:move:
    post:
      tags:
      - Documents
      summary: Move directory
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Move a directory in another parent directory that belongs to the same
        space and the same folder. <br/> Scope: space_write'
      operationId: moveDirectory
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: path
        description: Folder which the directory belongs to (case insensitive)
        required: true
        schema:
          $ref: '#/components/schemas/FolderLowercase'
      - name: directoryId
        in: path
        description: The directory identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Parent directory
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MoveDirectoryRequest'
            example:
              parentDirectoryId: 44d929f7-952d-4283-9010-8a63a16831b3
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectoryResponse'
              example:
                id: a00f8ca7-cd3b-4a2a-93c5-919a8c126ce5
                spaceId: f654868c-a30c-4286-b3be-41c58ef220a4
                name: Fruits
                folder: FILES
                parentDirectory:
                  id: 44d929f7-952d-4283-9010-8a63a16831b3
                  name: Plant
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2:
        - space_write
  /transaction/v2/spaces/{spaceId}/documents/{documentId}/lines:
    get:
      tags:
      - Documents
      summary: Get document lines v2
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Retrieve document lines v2 <br/> Scope: space_read'
      operationId: getLineItemsV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllLineItemsResultV2'
              example:
                lines:
                - id: 7a1cf570-db5c-4e41-992e-9890532212ae
                  sequence: 1
                  data:
                    $schema: https://btx.unifiedpost.com/btx/datastore/document/document_line/v1/document-line-schema.json
                    quantity: '2'
                    unit: H87
                    netAmount: '80.56'
                    currency: USD
                    metadata:
                      externalLineId: A
                      notes:
                      - code: AAA
                        text: Goods item description
                      - code: AAB
                        text: Net 60
                      buyerAccountingReference: CUST-001
                      invoiceReferences:
                      - invoiceReference: ABC002
                        invoiceType: '380'
                        issueDate: 2024-01-14
                        invoiceNumber: ABC002
                      delivery:
                        name: xxxxxx
                        address:
                          department: Service achat
                          streetName: RUE DES FLEURS
                          buildingNumber: 22BIS
                          floor: Zone industrielle de la Ballastrierre Ouest
                          postBox: BP 40122
                          townName: LIBOURNE CEDEX
                          postCode: '33506'
                          country: FR
                        deliveryDate: 2024-01-10
                      startDate: 2024-01-23
                      endDate: 2024-06-23
                      allowances:
                      - netAmount: '20.0'
                        baseAmount: '1000'
                        percentage: '15'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Discount
                        reasonCode: '95'
                      charges:
                      - netAmount: '76.67'
                        baseAmount: '1000'
                        percentage: '20'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Advertising
                        reasonCode: AA
                    pricing:
                      itemNetPrice: '80.56'
                      itemGrossPrice: '96.67'
                      itemPriceQuantity: '40.278192'
                      itemPriceDiscount: '10.0'
                    vatDetails:
                      vatCategory: S
                      vatPercentage: '0.2'
                      vatAmount: '16.11'
                    productIdentifiers:
                      itemId: item1
                      itemCategory: Electronics
                      itemName: Sony WH-1000XM6
                      itemDescription: Noise-cancelling wireless headphones with Bluetooth.
                totalElements: 42
                currentPage: 1
                pageSize: 1
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
    put:
      tags:
      - Documents
      summary: Replace document lines v2
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Replace lines v2 in the document. Overwrite all the lines of a document
        <br/> Scope: space_write'
      operationId: replaceLineItemsV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      requestBody:
        description: Line items to add
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LineItemListRequestV2'
            example:
              lines:
              - $schema: https://btx.unifiedpost.com/btx/datastore/document/document_line/v1/document-line-schema.json
                quantity: '2'
                unit: H87
                netAmount: '80.56'
                currency: USD
                metadata:
                  externalLineId: A
                  notes:
                  - code: AAA
                    text: Goods item description
                  - code: AAB
                    text: Net 60
                  buyerAccountingReference: CUST-001
                  invoiceReferences:
                  - invoiceReference: ABC002
                    invoiceType: '380'
                    issueDate: 2024-01-14
                    invoiceNumber: ABC002
                  delivery:
                    name: xxxxxx
                    address:
                      department: Service achat
                      streetName: RUE DES FLEURS
                      buildingNumber: 22BIS
                      floor: Zone industrielle de la Ballastrierre Ouest
                      postBox: BP 40122
                      townName: LIBOURNE CEDEX
                      postCode: '33506'
                      country: FR
                    deliveryDate: 2024-01-10
                  startDate: 2024-01-23
                  endDate: 2024-06-23
                  allowances:
                  - netAmount: '20.0'
                    baseAmount: '1000'
                    percentage: '15'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Discount
                    reasonCode: '95'
                  charges:
                  - netAmount: '76.67'
                    baseAmount: '1000'
                    percentage: '20'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Advertising
                    reasonCode: AA
                pricing:
                  itemNetPrice: '80.56'
                  itemGrossPrice: '96.67'
                  itemPriceQuantity: '40.278192'
                  itemPriceDiscount: '10.0'
                vatDetails:
                  vatCategory: S
                  vatPercentage: '0.2'
                  vatAmount: '16.11'
                productIdentifiers:
                  itemId: item1
                  itemCategory: Electronics
                  itemName: Sony WH-1000XM6
                  itemDescription: Noise-cancelling wireless headphones with Bluetooth.
        required: true
      responses:
        '200':
          description: Updated document lines successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LineItemListResultV2'
              example:
                lines:
                - id: 7a1cf570-db5c-4e41-992e-9890532212ae
                  sequence: 1
                  data:
                    $schema: https://btx.unifiedpost.com/btx/datastore/document/document_line/v1/document-line-schema.json
                    quantity: '2'
                    unit: H87
                    netAmount: '80.56'
                    currency: USD
                    metadata:
                      externalLineId: A
                      notes:
                      - code: AAA
                        text: Goods item description
                      - code: AAB
                        text: Net 60
                      buyerAccountingReference: CUST-001
                      invoiceReferences:
                      - invoiceReference: ABC002
                        invoiceType: '380'
                        issueDate: 2024-01-14
                        invoiceNumber: ABC002
                      delivery:
                        name: xxxxxx
                        address:
                          department: Service achat
                          streetName: RUE DES FLEURS
                          buildingNumber: 22BIS
                          floor: Zone industrielle de la Ballastrierre Ouest
                          postBox: BP 40122
                          townName: LIBOURNE CEDEX
                          postCode: '33506'
                          country: FR
                        deliveryDate: 2024-01-10
                      startDate: 2024-01-23
                      endDate: 2024-06-23
                      allowances:
                      - netAmount: '20.0'
                        baseAmount: '1000'
                        percentage: '15'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Discount
                        reasonCode: '95'
                      charges:
                      - netAmount: '76.67'
                        baseAmount: '1000'
                        percentage: '20'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Advertising
                        reasonCode: AA
                    pricing:
                      itemNetPrice: '80.56'
                      itemGrossPrice: '96.67'
                      itemPriceQuantity: '40.278192'
                      itemPriceDiscount: '10.0'
                    vatDetails:
                      vatCategory: S
                      vatPercentage: '0.2'
                      vatAmount: '16.11'
                    productIdentifiers:
                      itemId: item1
                      itemCategory: Electronics
                      itemName: Sony WH-1000XM6
                      itemDescription: Noise-cancelling wireless headphones with Bluetooth.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
    post:
      tags:
      - Documents
      summary: Create document lines v2
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Create lines v2 in the document. New lines are added to the existing
        ones <br/> Scope: space_write'
      operationId: createLineItemsV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      requestBody:
        description: Line items to add
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LineItemListRequestV2'
            example:
              lines:
              - $schema: https://btx.unifiedpost.com/btx/datastore/document/document_line/v1/document-line-schema.json
                quantity: '2'
                unit: H87
                netAmount: '80.56'
                currency: USD
                metadata:
                  externalLineId: A
                  notes:
                  - code: AAA
                    text: Goods item description
                  - code: AAB
                    text: Net 60
                  buyerAccountingReference: CUST-001
                  invoiceReferences:
                  - invoiceReference: ABC002
                    invoiceType: '380'
                    issueDate: 2024-01-14
                    invoiceNumber: ABC002
                  delivery:
                    name: xxxxxx
                    address:
                      department: Service achat
                      streetName: RUE DES FLEURS
                      buildingNumber: 22BIS
                      floor: Zone industrielle de la Ballastrierre Ouest
                      postBox: BP 40122
                      townName: LIBOURNE CEDEX
                      postCode: '33506'
                      country: FR
                    deliveryDate: 2024-01-10
                  startDate: 2024-01-23
                  endDate: 2024-06-23
                  allowances:
                  - netAmount: '20.0'
                    baseAmount: '1000'
                    percentage: '15'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Discount
                    reasonCode: '95'
                  charges:
                  - netAmount: '76.67'
                    baseAmount: '1000'
                    percentage: '20'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Advertising
                    reasonCode: AA
                pricing:
                  itemNetPrice: '80.56'
                  itemGrossPrice: '96.67'
                  itemPriceQuantity: '40.278192'
                  itemPriceDiscount: '10.0'
                vatDetails:
                  vatCategory: S
                  vatPercentage: '0.2'
                  vatAmount: '16.11'
                productIdentifiers:
                  itemId: item1
                  itemCategory: Electronics
                  itemName: Sony WH-1000XM6
                  itemDescription: Noise-cancelling wireless headphones with Bluetooth.
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LineItemListResultV2'
              example:
                lines:
                - id: 7a1cf570-db5c-4e41-992e-9890532212ae
                  sequence: 1
                  data:
                    $schema: https://btx.unifiedpost.com/btx/datastore/document/document_line/v1/document-line-schema.json
                    quantity: '2'
                    unit: H87
                    netAmount: '80.56'
                    currency: USD
                    metadata:
                      externalLineId: A
                      notes:
                      - code: AAA
                        text: Goods item description
                      - code: AAB
                        text: Net 60
                      buyerAccountingReference: CUST-001
                      invoiceReferences:
                      - invoiceReference: ABC002
                        invoiceType: '380'
                        issueDate: 2024-01-14
                        invoiceNumber: ABC002
                      delivery:
                        name: xxxxxx
                        address:
                          department: Service achat
                          streetName: RUE DES FLEURS
                          buildingNumber: 22BIS
                          floor: Zone industrielle de la Ballastrierre Ouest
                          postBox: BP 40122
                          townName: LIBOURNE CEDEX
                          postCode: '33506'
                          country: FR
                        deliveryDate: 2024-01-10
                      startDate: 2024-01-23
                      endDate: 2024-06-23
                      allowances:
                      - netAmount: '20.0'
                        baseAmount: '1000'
                        percentage: '15'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Discount
                        reasonCode: '95'
                      charges:
                      - netAmount: '76.67'
                        baseAmount: '1000'
                        percentage: '20'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Advertising
                        reasonCode: AA
                    pricing:
                      itemNetPrice: '80.56'
                      itemGrossPrice: '96.67'
                      itemPriceQuantity: '40.278192'
                      itemPriceDiscount: '10.0'
                    vatDetails:
                      vatCategory: S
                      vatPercentage: '0.2'
                      vatAmount: '16.11'
                    productIdentifiers:
                      itemId: item1
                      itemCategory: Electronics
                      itemName: Sony WH-1000XM6
                      itemDescription: Noise-cancelling wireless headphones with Bluetooth.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v2/spaces/{spaceId}/documents/{documentId}/lines/{lineId}:
    get:
      tags:
      - Documents
      summary: Get document line  v2
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get document line detail v2 <br/> Scope: space_read'
      operationId: getLineItemV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: lineId
        in: path
        description: The line item identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 7e76686f-f021-488d-a8e0-2c66beff4772
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LineItemV2'
              example:
                id: 7a1cf570-db5c-4e41-992e-9890532212ae
                sequence: 1
                data:
                  quantity: '2'
                  unit: H87
                  netAmount: '80.56'
                  currency: USD
                  metadata:
                    externalLineId: A
                    notes:
                    - code: AAA
                      text: Goods item description
                    - code: AAB
                      text: Net 60
                    buyerAccountingReference: CUST-001
                    invoiceReferences:
                    - invoiceReference: ABC002
                      invoiceType: '380'
                      issueDate: 2024-01-14
                      invoiceNumber: ABC002
                    delivery:
                      name: xxxxxx
                      address:
                        department: Service achat
                        streetName: RUE DES FLEURS
                        buildingNumber: 22BIS
                        floor: Zone industrielle de la Ballastrierre Ouest
                        postBox: BP 40122
                        townName: LIBOURNE CEDEX
                        postCode: '33506'
                        country: FR
                      deliveryDate: 2024-01-10
                    startDate: 2024-01-23
                    endDate: 2024-06-23
                    allowances:
                    - netAmount: '20.0'
                      baseAmount: '1000'
                      percentage: '15'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Discount
                      reasonCode: '95'
                    charges:
                    - netAmount: '76.67'
                      baseAmount: '1000'
                      percentage: '20'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Advertising
                      reasonCode: AA
                  pricing:
                    itemNetPrice: '80.56'
                    itemGrossPrice: '96.67'
                    itemPriceQuantity: '40.278192'
                    itemPriceDiscount: '10.0'
                  vatDetails:
                    vatCategory: S
                    vatPercentage: '0.2'
                    vatAmount: '16.11'
                  productIdentifiers:
                    itemId: item1
                    itemCategory: Electronics
                    itemName: Sony WH-1000XM6
                    itemDescription: Noise-cancelling wireless headphones with Bluetooth.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
    delete:
      tags:
      - Documents
      summary: Delete document line v2
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Delete document line v2 <br/> Scope: space_write'
      operationId: deleteLineItemV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: lineId
        in: path
        description: The line item identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 7e76686f-f021-488d-a8e0-2c66beff4772
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
    patch:
      tags:
      - Documents
      summary: Update document line v2
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update document line v2 <br/> Scope: space_write'
      operationId: updateLineItemV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: lineId
        in: path
        description: The line item identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 7e76686f-f021-488d-a8e0-2c66beff4772
      requestBody:
        description: Line item to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLineItemRequestV2'
            example:
              data:
                quantity: '1'
                unit: H87
                netAmount: '40.28'
                currency: EUR
                metadata:
                  startDate: 2024-02-23
                  endDate: 2024-07-23
                pricing:
                  itemNetPrice: '40.278192'
                  itemGrossPrice: '44.31'
                vatDetails:
                  vatCategory: S
                  vatPercentage: '0.2'
                  vatAmount: '16.11'
                productIdentifiers:
                  itemId: itemA
                  itemCategory: Electronics
                  itemName: Sony WH-1000XM6
                  itemDescription: Wireless headphones.
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LineItemV2'
              example:
                id: 7a1cf570-db5c-4e41-992e-9890532212ae
                sequence: 1
                data:
                  quantity: '2'
                  unit: H87
                  netAmount: '80.56'
                  currency: USD
                  metadata:
                    externalLineId: A
                    notes:
                    - code: AAA
                      text: Goods item description
                    - code: AAB
                      text: Net 60
                    buyerAccountingReference: CUST-001
                    invoiceReferences:
                    - invoiceReference: ABC002
                      invoiceType: '380'
                      issueDate: 2024-01-14
                      invoiceNumber: ABC002
                    delivery:
                      name: xxxxxx
                      address:
                        department: Service achat
                        streetName: RUE DES FLEURS
                        buildingNumber: 22BIS
                        floor: Zone industrielle de la Ballastrierre Ouest
                        postBox: BP 40122
                        townName: LIBOURNE CEDEX
                        postCode: '33506'
                        country: FR
                      deliveryDate: 2024-01-10
                    startDate: 2024-01-23
                    endDate: 2024-06-23
                    allowances:
                    - netAmount: '20.0'
                      baseAmount: '1000'
                      percentage: '15'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Discount
                      reasonCode: '95'
                    charges:
                    - netAmount: '76.67'
                      baseAmount: '1000'
                      percentage: '20'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Advertising
                      reasonCode: AA
                  pricing:
                    itemNetPrice: '80.56'
                    itemGrossPrice: '96.67'
                    itemPriceQuantity: '40.278192'
                    itemPriceDiscount: '10.0'
                  vatDetails:
                    vatCategory: S
                    vatPercentage: '0.2'
                    vatAmount: '16.11'
                  productIdentifiers:
                    itemId: item1
                    itemCategory: Electronics
                    itemName: Sony WH-1000XM6
                    itemDescription: Noise-cancelling wireless headphones with Bluetooth.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  ? /transaction/v2/spaces/{spaceId}/documents/{documentId}/processingData/spaceExtensions/{extensionNameSpace}/{extensionName}
  : get:
      tags:
      - Documents
      summary: Get document processing data
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get document’s processing data of a specific extension (connector).'
      operationId: getDocumentProcessingDataOfExtensionV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: extensionNameSpace
        in: path
        description: Extension namespace
        required: true
        schema:
          type: string
      - name: extensionName
        in: path
        description: Extension name
        required: true
        schema:
          type: string
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                sbdhInstanceIdentifiers:
                - 12345_118e3040-51d2-11e3-8f96-0800200c9a66
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '401':
          description: Unauthorized, the access token does not belong to the service
            account of the extension
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Space/Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2: []
    put:
      tags:
      - Documents
      summary: Create/Update document processing data.
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Create/Update processing data of a specific extension (connector).'
      operationId: replaceProcessingDataOfExtensionV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: extensionNameSpace
        in: path
        description: Extension namespace
        required: true
        schema:
          type: string
      - name: extensionName
        in: path
        description: Extension name
        required: true
        schema:
          type: string
      requestBody:
        description: Document processing data specific to the given extension
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonBMap'
            example:
              sbdhInstanceIdentifiers:
              - 12345_118e3040-51d2-11e3-8f96-0800200c9a66
        required: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                sbdhInstanceIdentifiers:
                - 12345_118e3040-51d2-11e3-8f96-0800200c9a66
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '401':
          description: Unauthorized, the access token does not belong to the service
            account of the extension
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Space/Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2: []
    patch:
      tags:
      - Documents
      summary: Update document processing data
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update document’s processing data of a specific extension (connector)
        with json patch operations.'
      operationId: updateDocumentProcessingDataOfExtensionV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: extensionNameSpace
        in: path
        description: Extension namespace
        required: true
        schema:
          type: string
      - name: extensionName
        in: path
        description: Extension name
        required: true
        schema:
          type: string
      requestBody:
        description: Json-patch operations to apply to processing data
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: add
              path: /sbdhInstanceIdentifiers
              value:
              - 12345_118e3040-51d2-11e3-8f96-0800200c9a66
        required: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                sbdhInstanceIdentifiers:
                - 12345_118e3040-51d2-11e3-8f96-0800200c9a66
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '401':
          description: Unauthorized, the access token does not belong to the service
            account of the extension
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Space/Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2: []
  /transaction/v2/spaces/{spaceId}/documents/{documentId}/rawData:
    get:
      tags:
      - Documents
      summary: Get document raw OCR data
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get the raw OCR data of the document. <br/> Scope: space_read'
      operationId: getDocumentRawDataV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      responses:
        '200':
          description: Ok. Raw data object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                invoiceDate:
                  confidence: 0.99
                  value: 2024-01-01
                  coordinates: {}
                vatDetails:
                - vatCode:
                    confidence: 0.99
                    value: ABC
                    coordinates: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space and/or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
    put:
      tags:
      - Documents
      summary: Create/Update document raw OCR data
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Create/Update raw OCR data of the document. <br/> Scope: space_write'
      operationId: replaceDocumentRawDataV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      requestBody:
        description: Raw OCR data of the document
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonBMap'
            example:
              invoiceDate:
                confidence: 0.99
                value: 2024-01-01
                coordinates: {}
              vatDetails:
              - vatCode:
                  confidence: 0.99
                  value: ABC
                  coordinates: {}
        required: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                invoiceDate:
                  confidence: 0.99
                  value: 2024-01-01
                  coordinates: {}
                vatDetails:
                - vatCode:
                    confidence: 0.99
                    value: ABC
                    coordinates: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space/Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
    post:
      tags:
      - Documents
      summary: ⚠️Add document raw OCR data
      description: 'This endpoint is no longer recommended.

        Use the @PUT endpoint instead to create or update raw OCR data.

        This endpoint only adds raw OCR data and does not support updates.

        '
      operationId: createDocumentRawDataV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      requestBody:
        description: Raw OCR data of the document
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonBMap'
            example:
              invoiceDate:
                confidence: 0.99
                value: 2024-01-01
                coordinates: {}
              vatDetails:
              - vatCode:
                  confidence: 0.99
                  value: ABC
                  coordinates: {}
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                invoiceDate:
                  confidence: 0.99
                  value: 2024-01-01
                  coordinates: {}
                vatDetails:
                - vatCode:
                    confidence: 0.99
                    value: ABC
                    coordinates: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space and/or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '409':
          description: Raw data already exists in document processable data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 409
                error: ABORTED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Conflict
                detail: Specific detail about what could not be done.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_write
    delete:
      tags:
      - Documents
      summary: Delete document raw OCR data
      description: Delete the raw OCR data of the document
      operationId: deleteDocumentRawDataV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
    patch:
      tags:
      - Documents
      summary: Update document raw OCR data
      description: Update the raw OCR data of the document using json-patch operations.
      operationId: updateDocumentRawDataV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      requestBody:
        description: Json-patch operations to apply to raw data
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: replace
              path: /invoiceDate/value
              value: 2024-01-15
        required: true
      responses:
        '200':
          description: Ok. Raw data object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                invoiceDate:
                  confidence: 0.99
                  value: 2024-01-01
                  coordinates: {}
                vatDetails:
                - vatCode:
                    confidence: 0.99
                    value: ABC
                    coordinates: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v2/spaces/{spaceId}/documents/{documentId}/rawLines:
    get:
      tags:
      - Documents
      summary: Get document raw OCR lines
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get raw OCR lines of the document <br/> Scope: space_read'
      operationId: getDocumentRawLinesV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      responses:
        '200':
          description: Ok. Raw lines object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                '5':
                  unit:
                    confidence: 0.99
                    value: stuks
                    coordinates: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space and/or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
    put:
      tags:
      - Documents
      summary: Create/Update document raw OCR lines
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Create/Update raw OCR lines to the document <br/> Scope: space_write'
      operationId: replaceDocumentRawLinesV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      requestBody:
        description: Raw OCR lines data of the document
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonBMap'
            example:
              '5':
                unit:
                  confidence: 0.99
                  value: stuks
                  coordinates: {}
        required: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                '5':
                  unit:
                    confidence: 0.99
                    value: stuks
                    coordinates: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space and/or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
    post:
      tags:
      - Documents
      summary: ⚠️Add document raw OCR lines
      description: 'This endpoint is no longer recommended.

        Use the @PUT endpoint instead to create or update raw OCR lines.

        This endpoint only adds raw OCR lines and does not support updates.

        '
      operationId: createDocumentRawLinesV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      requestBody:
        description: Raw OCR lines data to add to document
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonBMap'
            example:
              '5':
                unit:
                  confidence: 0.99
                  value: stuks
                  coordinates: {}
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                '5':
                  unit:
                    confidence: 0.99
                    value: stuks
                    coordinates: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space and/or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '409':
          description: Raw lines already exists for the document
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 409
                error: ABORTED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Conflict
                detail: Specific detail about what could not be done.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - space_write
    delete:
      tags:
      - Documents
      summary: Delete document raw OCR lines
      description: Delete raw OCR lines of the document
      operationId: deleteDocumentRawLinesV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
    patch:
      tags:
      - Documents
      summary: Update document raw OCR lines
      description: Update raw OCR lines of the document using json-patch operations.
      operationId: updateDocumentRawLinesV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      requestBody:
        description: Json-patch operations to apply to raw lines
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: replace
              path: /5/unit/confidence
              value: 0.88
        required: true
      responses:
        '200':
          description: Ok. Raw lines object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                '5':
                  unit:
                    confidence: 0.99
                    value: stuks
                    coordinates: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v2/spaces/{spaceId}/documents/{documentId}:assignConnection:
    post:
      tags:
      - Documents
      summary: Assign connection to document
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Assign connection to document <br/> Scope: space_write'
      operationId: assignDocumentConnection
      parameters:
      - name: spaceId
        in: path
        description: The space unique identifier. (A UUID specified by RFC4122).
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document unique identifier. (A UUID specified by RFC4122).
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Connection to add
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentConnectionRequest'
            example:
              id: 4c32d3fb-0023-470c-ae21-105274a94706
              relationType: CUSTOMER
        required: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentV2'
              example:
                id: 0ca2797b-6365-4bf2-a490-247075e3cede
                spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                description: Sample Document
                source: Sample Source
                folder: PURCHASES
                status:
                  pay: FULLY_PAID
                category: INVOICE
                metadata:
                  $schema: https://btx.unifiedpost.com/btx/datastore/document/document_metadata/v1/document-metadata-schema.json
                  documentNumber: ABC002
                  issueDate: 2024-01-31
                  invoiceType: '380'
                  currencyCode: EUR
                  dueDate: 2024-03-30
                  buyerReference: CUST-001
                  contractReference: CONTRACT001
                  purchaseOrderReference: PO123
                  paymentTerms: Net 60
                  notes:
                  - code: AAA
                    text: Goods item description
                  invoiceReferences:
                  - invoiceReference: ABC002
                    issueDate: 2024-01-14
                    invoiceType: '380'
                  supplier:
                    legalName: Monte Carlo Ltd
                    tradingName: Monte Carlo Ltd
                    address:
                      streetName: Rue des Fleurs
                      buildingNumber: 22BIS
                      floor: Zone industrielle de la Ballastrierre Ouest
                      postBox: BP 40122
                      department: Service achat
                      city: LIBOURNE CEDEX
                      postalCode: '33506'
                      countryCode: FR
                    globalIdentifiers:
                      fr:siren: '349718288'
                      fr:siret: '34971828812345'
                      fr:vat: FR63349718288
                      global:email:
                      - montecarloltd@example.com
                      global:phoneNumber:
                      - '+1234567890'
                  customer:
                    legalName: Unifiedpost Group
                    tradingName: ?????????
                    address:
                      streetName: Bloemendalelaan
                      buildingNumber: 62/3
                      buildingName: Building West
                      floor: '4'
                      room: '47'
                      city: Maldegem
                      postalCode: '9990'
                      countryCode: BE
                    globalIdentifiers:
                      be:vat: BE0412887923
                      global:email:
                      - john@example.com
                      global:phoneNumber:
                      - '+1234567890'
                  delivery:
                    deliveryDate: 2024-01-31
                  prepaid:
                    paymentDate: 2024-08-15
                    code: '55'
                    text: 'Advance payment for order #12345'
                    paymentReference:
                      value: Prepaid invoice ABC002
                      type: UNSTRUCTURED
                  paymentMeans:
                  - code: '42'
                    text: PPayment to bank account, Belgian structured reference
                    paymentReference:
                      value: 001/4037/32870
                      type: STRUCTURED
                      scheme: OGM_VCS
                    paymentAccount:
                      identifier: FR3330002005500000157841Z25
                      scheme: IBAN
                      country: FR
                      currency: EUR
                      bank:
                        identifier: CRLYFRPP
                        scheme: BIC
                    paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-...-166eca6e81a7
                    paymentMandate:
                      identifier: MANDATE-2026-00045
                      payerFinancialAccount:
                        identifier: FR7630006000011234567890189
                  allowances:
                  - netAmount: '150'
                    baseAmount: '1000'
                    percentage: '15'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Discount
                    reasonCode: '95'
                  charges:
                  - netAmount: '200'
                    baseAmount: '1000'
                    percentage: '20'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Advertising
                    reasonCode: AA
                  documentTotals:
                    netAmount: '1000'
                    vatAmount: '100'
                    grossAmount: '1100'
                    prepaidAmount: '500'
                    roundingDifference: '1100'
                    payableAmount: '600'
                    linesNetAmount: '900'
                    allowancesNetAmount: '100'
                    chargesNetAmount: '200'
                  vatDetails:
                  - vatCategory: S
                    vatPercentage: '10'
                    netAmount: '1000'
                    vatAmount: '100'
                    exemptionReason: Medical supplies are exempt from VAT
                    exemptionReasonCode: VATEX-EU-79-C
                  uploadId: '123456789'
                  vatChargeableMethod: payment_date
                  vatAlreadyDeclared: true
                  processControl:
                    businessProcess: goods
                  profileId: urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
                tags:
                - new
                tasks:
                - extensionName: com.unifiedpost.btx.data:approve
                  status: approve
                connections:
                - id: 00000001-0000-0000-0000-000000000001
                  relationType: SUPPLIER
                - id: 00000001-0000-0000-0000-000000000002
                  relationType: CUSTOMER
                  displayName: ABC Company
                retentionTime: 2023-10-04 14:20:31.502921+00:00
                rawLines:
                  '5':
                    unit:
                      confidence: 0.99
                      value: stuks
                      coordinates: {}
                rawData:
                  invoiceDate:
                    confidence: 0.99
                    value: 2024-01-01
                    coordinates: {}
                  vatDetails:
                  - vatCode:
                      confidence: 0.99
                      value: ABC
                      coordinates: {}
                processingData:
                  spaceExtensions:
                    com.unifiedpost.btx.connectors:
                      peppol:
                        sbdhInstanceIdentifiers:
                        - 12345_118e3040-51d2-11e3-8f96-0800200c9a66
                validationData:
                  spaceExtensions:
                    com.unifiedpost.btx.connectors.validator:
                      dataExtraction:
                        status: COMPLETED
                        validationId: 00000001-0000-0000-0000-000000000000
                        results:
                          ocr.confidence:
                            level: ERROR
                            locations:
                            - type: field
                              path: dueDate
                              parameters:
                                confidence: 0.75
                customCategories:
                  purchases:
                  - fuel
                  - restaurant
                timestamps:
                  createdAt: 2025-07-04 14:20:31.502921+00:00
                  updatedAt: 2025-07-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space/Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 409
                error: ABORTED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Conflict
                detail: Specific detail about what could not be done.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v2/spaces/{spaceId}/documents:bulkUpdate:
    patch:
      tags:
      - Documents
      summary: Bulk update documents v2
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Bulk update documents v2 <br/> Scope: space_write'
      operationId: bulkPatchDocumentsV2
      parameters:
      - name: spaceId
        in: path
        description: The space unique identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/BulkPatchDocumentsRequest'
        required: true
      responses:
        '200':
          description: All updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkDocumentsResponse'
              examples:
                Full response:
                  description: Full response
                  value:
                    type: full
                    documents:
                    - id: 51673728-4317-49d4-87b9-6ceb6a5ba115
                      spaceId: c37a2321-fa7c-45d3-a895-2c809d42adeb
                      folder: FILES
                      status:
                        accept: UNACCEPTED
                        document: RECEIVED
                      category: FILE
                      metadata:
                        supplier: Jack Doe
                      retentionTime: 2028-01-13 16:08:33+00:00
                    - id: f4c9a3c5-d20d-4698-bb43-40ba3236bfab
                      spaceId: c37a2321-fa7c-45d3-a895-2c809d42adeb
                      folder: SALES
                      status:
                        delivery: RECEIVED
                        pay: PARTIALLY_PAID
                        document: VALIDATED
                      category: INVOICE
                      metadata:
                        supplier: Jack Doe
                      retentionTime: 2028-01-13 16:08:33+00:00
                Only ids in response:
                  description: Only ids in response
                  value:
                    type: ids
                    documents:
                    - 51673728-4317-49d4-87b9-6ceb6a5ba115
                    - f4c9a3c5-d20d-4698-bb43-40ba3236bfab
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v2/spaces/{spaceId}/documents:
    get:
      tags:
      - Documents
      summary: Get list of documents v2
      description: "<div class='my-preview'><span>Preview: The API is in development\
        \ or testing phases and the interface could still change slightly.</span></div>\
        \ <br/> \tGet list of documents v2 on the given space, with options to filter\
        \ out the result.\n\tBy default, all documents that don't have status wait_for_complete\
        \ are retrieved.\n\tThe API supports pagination and sorting.\n <br/> Scope:\
        \ space_read"
      operationId: listDocumentsV2
      parameters:
      - name: filter
        in: query
        schema:
          $ref: '#/components/schemas/ListDocumentsQueryParamsSingle'
      - name: spaceId
        in: path
        description: The space unique identifier. (A UUID specified by RFC4122).
        required: true
        schema:
          type: string
          format: uuid
      - name: metadata
        in: query
        description: "\tMetadata filter.\n\tExample:\n\tIf document metadata is:\n\
          \t{\n\t\t\"supplier\":\"Jack Doe\",\n\t\t\"filename\": \"123.pdf\",\n\t\t\
          \"other\": {\n\t\t\t\"documentReferences\": [\n\t\t\t\t{\n\t\t\t\t\t\"referencedInvoiceDate\"\
          : \"2024-01-14\",\n\t\t\t\t\t\"referencedInvoiceType\": \"380\",\n\t\t\t\
          \t\t\"numbers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"referencedInvoiceNumber\"\
          : \"ABC002\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t\
          \ }\n\tTo filter by referencedInvoiceNumber=ABC002, the query param should\
          \ be sent as:\n\t\"?metadata=other.documentReferences[].numbers[].referencedInvoiceNumber=ABC002\"\
          \n\tOf course, for simpler structures the query param is more simple.\n"
        deprecated: true
        schema:
          type: array
          items:
            type: string
        example: ?metadata=other.documentReferences[].numbers[].referencedInvoiceNumber=ABC002
      - name: status
        in: query
        deprecated: true
        schema:
          type: array
          items:
            type: string
      - name: include
        in: query
        description: What extra data to include in the response.
        explode: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/DocumentInclude'
        example: lines,connections
      - name: connections[customer].id[in]
        in: query
        description: List of connection IDs with type customer
        deprecated: true
        explode: false
        schema:
          type: array
          items:
            type: string
            format: uuid
        example: ecc46f54-71f8-4951-944e-a87c3fc57c35,da753d31-2068-4584-b91f-ae012f6b7df3
      - name: connections[supplier].id[in]
        in: query
        description: List of connection IDs with type supplier
        deprecated: true
        explode: false
        schema:
          type: array
          items:
            type: string
            format: uuid
        example: ecc46f54-71f8-4951-944e-a87c3fc57c35,da753d31-2068-4584-b91f-ae012f6b7df3
      - name: balanceOffsets.aggregationStatus[in]
        in: query
        description: Any of the given aggregation statuses of associated balanceOffsets
        deprecated: true
        explode: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/AggregationStatus'
        example: USER_CONFIRMED,AUTO_CONFIRMED
      - name: ql
        in: query
        description: BTX Query Language filter expression.
        schema:
          type: string
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        schema:
          type: string
          enum:
          - category
          - category.asc
          - category.desc
          - createdAt
          - createdAt.asc
          - createdAt.desc
          - updatedAt
          - updatedAt.asc
          - updatedAt.desc
          - grossAmount
          - grossAmount.asc
          - grossAmount.desc
          - payableAmount
          - payableAmount.asc
          - payableAmount.desc
          - netAmount
          - netAmount.asc
          - netAmount.desc
          - vatAmount
          - vatAmount.asc
          - vatAmount.desc
          - documentNumber
          - documentNumber.asc
          - documentNumber.desc
          - issueDate
          - issueDate.asc
          - issueDate.desc
          - dueDate
          - dueDate.asc
          - dueDate.desc
          - status.delivery
          - status.delivery.asc
          - status.delivery.desc
          - status.document
          - status.document.asc
          - status.document.desc
          - status.pay
          - status.pay.asc
          - status.pay.desc
          - connections[customer].displayName
          - connections[customer].displayName.asc
          - connections[customer].displayName.desc
          - connections[supplier].displayName
          - connections[supplier].displayName.asc
          - connections[supplier].displayName.desc
          - description
          - description.asc
          - description.desc
          - purchaseOrderReference
          - purchaseOrderReference.asc
          - purchaseOrderReference.desc
          - openBalance
          - openBalance.asc
          - openBalance.desc
        example: createdAt.asc
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListDocumentsResponseV2'
              example:
                documents:
                - id: 0ca2797b-6365-4bf2-a490-247075e3cede
                  spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                  description: Sample Document
                  source: Sample Source
                  status:
                    pay: FULLY_PAID
                  category: INVOICE
                  metadata:
                    documentNumber: ABC002
                    issueDate: 2024-01-31
                    invoiceType: '380'
                    currencyCode: EUR
                    dueDate: 2024-03-30
                    buyerReference: CUST-001
                    contractReference: CONTRACT001
                    purchaseOrderReference: PO123
                    paymentTerms: Net 60
                    notes:
                    - code: AAA
                      text: Goods item description
                    invoiceReferences:
                    - invoiceReference: ABC002
                      issueDate: 2024-01-14
                      invoiceType: '380'
                    supplier:
                      legalName: Monte Carlo Ltd
                      tradeName: Monte Carlo Ltd
                      address:
                        department: Service achat
                        streetName: RUE DES FLEURS
                        buildingNumber: 22BIS
                        floor: Zone industrielle de la Ballastrierre Ouest
                        postBox: BP 40122
                        townName: LIBOURNE CEDEX
                        postCode: '33506'
                        country: FR
                      globalIdentifiers:
                        fr:siren: '349718288'
                        fr:siret: '34971828812345'
                        fr:vat: FR63349718288
                        global:phoneNumber:
                        - '+3221234567'
                        global:email:
                        - contact@supplier.be
                    customer:
                      legalName: Central Argo Trading
                      tradeName: Central Argo Trading
                      address:
                        streetName: Bloemendalelaan
                        buildingNumber: 62/3
                        buildingName: Building West
                        floor: '4'
                        room: '47'
                        townName: Maldegem
                        postCode: '9990'
                        country: BE
                      globalIdentifiers:
                        be:vat: BE0412887923
                        global:phoneNumber:
                        - '+3237890123'
                        global:email:
                        - contact@customer.be
                    delivery:
                      deliveryDate: 2024-01-31
                    prepaid:
                      paymentDate: 2024-08-15
                      code: '55'
                      text: 'Advance payment for order #12345'
                      paymentReference:
                        value: Prepaid invoice ABC002
                        type: UNSTRUCTURED
                    paymentMeans:
                    - code: '42'
                      text: Payment to bank account, Belgian structured reference
                      paymentReference:
                        value: 001/4037/32870
                        type: STRUCTURED
                        scheme: OGM_VCS
                      paymentAccount:
                        identifier: FR3330002005500000157841Z25
                        scheme: IBAN
                        country: FR
                        currency: EUR
                        bank:
                          identifier: CRLYFRPP
                          scheme: BIC
                      paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-...-166eca6e81a7
                    allowances:
                    - netAmount: '150'
                      baseAmount: '1000'
                      percentage: '15'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Discount
                      reasonCode: '95'
                    charges:
                    - netAmount: '200'
                      baseAmount: '1000'
                      percentage: '20'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Advertising
                      reasonCode: AA
                    documentTotals:
                      netAmount: '1000'
                      vatAmount: '100'
                      grossAmount: '1100'
                      prepaidAmount: '500'
                      roundingDifference: '1100'
                      payableAmount: '600'
                      linesNetAmount: '900'
                      allowancesNetAmount: '100'
                      chargesNetAmount: '200'
                    vatDetails:
                    - vatCategory: S
                      vatPercentage: '10'
                      netAmount: '1000'
                      vatAmount: '100'
                      exemptionReason: Medical supplies are exempt from VAT
                      exemptionReasonCode: VATEX-EU-79-C
                    uploadId: '123456789'
                    vatChargeableMethod: payment_date
                    vatAlreadyDeclared: true
                    processControl:
                      businessProcess: goods
                    profileId: urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
                  tags:
                  - new
                  tasks:
                  - extensionName: com.unifiedpost.btx.data:approve
                    status: approve
                  retentionTime: 2023-10-04 14:20:31.502921+00:00
                  customCategories:
                    purchases:
                    - fuel
                    - restaurant
                    labels:
                    - foo
                    - bar
                totalElements: 100
                currentPage: 2
                pageSize: 2
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
    post:
      tags:
      - Documents
      summary: Create document v2
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Create document v2 on the given space <br/> Scope: space_write'
      operationId: createDocumentV2
      parameters:
      - name: spaceId
        in: path
        description: The space unique identifier. (A UUID specified by RFC4122).
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Document to add
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentRequestV2'
            examples:
              Document:
                description: Document
                value:
                  description: Sample invoice for choruspro
                  source: choruspro
                  metadata:
                    documentNumber: ABC002
                    issueDate: 2024-01-31
                    invoiceType: '380'
                    currencyCode: EUR
                    dueDate: 2024-03-30
                    buyerReference: CUST-001
                    contractReference: CONTRACT001
                    purchaseOrderReference: PO123
                    paymentTerms: Net 60
                    notes:
                    - code: AAA
                      text: Goods item description
                    invoiceReferences:
                    - invoiceReference: ABC002
                      issueDate: 2024-01-14
                      invoiceType: '380'
                    supplier:
                      legalName: Monte Carlo Ltd
                      tradeName: Monte Carlo Ltd
                      address:
                        department: Service achat
                        streetName: RUE DES FLEURS
                        buildingNumber: 22BIS
                        floor: Zone industrielle de la Ballastrierre Ouest
                        postBox: BP 40122
                        townName: LIBOURNE CEDEX
                        postCode: '33506'
                        country: FR
                      globalIdentifiers:
                        fr:siren: '349718288'
                        fr:siret: '34971828812345'
                        fr:vat: FR63349718288
                        global:phoneNumber:
                        - '+3221234567'
                        global:email:
                        - contact@supplier.be
                    customer:
                      legalName: Central Argo Trading
                      tradeName: Central Argo Trading
                      address:
                        streetName: Bloemendalelaan
                        buildingNumber: 62/3
                        buildingName: Building West
                        floor: '4'
                        room: '47'
                        townName: Maldegem
                        postCode: '9990'
                        country: BE
                      globalIdentifiers:
                        be:vat: BE0412887923
                        global:phoneNumber:
                        - '+3237890123'
                        global:email:
                        - contact@customer.be
                    delivery:
                      deliveryDate: 2024-01-31
                    prepaid:
                      paymentDate: 2024-08-15
                      code: '55'
                      text: 'Advance payment for order #12345'
                      paymentReference:
                        value: Prepaid invoice ABC002
                        type: UNSTRUCTURED
                    paymentMeans:
                    - code: '42'
                      text: PPayment to bank account, Belgian structured reference
                      paymentReference:
                        value: 001/4037/32870
                        type: STRUCTURED
                        scheme: OGM_VCS
                      paymentAccount:
                        identifier: FR3330002005500000157841Z25
                        scheme: IBAN
                        country: FR
                        currency: EUR
                        bank:
                          identifier: CRLYFRPP
                          scheme: BIC
                      paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-...-166eca6e81a7
                    allowances:
                    - netAmount: '150'
                      baseAmount: '1000'
                      percentage: '15'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Discount
                      reasonCode: '95'
                    charges:
                    - netAmount: '200'
                      baseAmount: '1000'
                      percentage: '20'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Advertising
                      reasonCode: AA
                    documentTotals:
                      netAmount: '1000'
                      vatAmount: '100'
                      grossAmount: '1100'
                      prepaidAmount: '500'
                      roundingDifference: '1100'
                      payableAmount: '600'
                      linesNetAmount: '900'
                      allowancesNetAmount: '100'
                      chargesNetAmount: '200'
                    vatDetails:
                    - vatCategory: S
                      vatPercentage: '10'
                      netAmount: '1000'
                      vatAmount: '100'
                      exemptionReason: Medical supplies are exempt from VAT
                      exemptionReasonCode: VATEX-EU-79-C
                    uploadId: '123456789'
                    vatChargeableMethod: payment_date
                    vatAlreadyDeclared: true
                    processControl:
                      businessProcess: goods
                    profileId: urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
                  retentionTime: 2029-01-14 19:58:47+02:00
                  status:
                    accept: ACCEPTED
                  category: INVOICE
                  folder: INBOX
                  connections:
                  - id: 00000001-0000-0000-0000-000000000001
                    relationType: SUPPLIER
                  - id: 00000001-0000-0000-0000-000000000002
                    relationType: CUSTOMER
                  parentDirectoryId: 44d929f7-952d-4283-9010-8a63a16831b3
                  customCategories:
                    purchases:
                    - fuel
                    - restaurant
              Document containing lines:
                description: Document containing lines
                value:
                  description: Sample invoice for choruspro
                  source: choruspro
                  metadata:
                    documentNumber: ABC002
                    issueDate: 2024-01-31
                    invoiceType: '380'
                    currencyCode: EUR
                    dueDate: 2024-03-30
                    buyerReference: CUST-001
                    contractReference: CONTRACT001
                    purchaseOrderReference: PO123
                    paymentTerms: Net 60
                    notes:
                    - code: AAA
                      text: Goods item description
                    invoiceReferences:
                    - invoiceReference: ABC002
                      issueDate: 2024-01-14
                      invoiceType: '380'
                    supplier:
                      legalName: Monte Carlo Ltd
                      tradeName: Monte Carlo Ltd
                      address:
                        department: Service achat
                        streetName: RUE DES FLEURS
                        buildingNumber: 22BIS
                        floor: Zone industrielle de la Ballastrierre Ouest
                        postBox: BP 40122
                        townName: LIBOURNE CEDEX
                        postCode: '33506'
                        country: FR
                      globalIdentifiers:
                        fr:siren: '349718288'
                        fr:siret: '34971828812345'
                        fr:vat: FR63349718288
                        global:phoneNumber:
                        - '+3221234567'
                        global:email:
                        - contact@supplier.be
                    customer:
                      legalName: Central Argo Trading
                      tradeName: Central Argo Trading
                      address:
                        streetName: Bloemendalelaan
                        buildingNumber: 62/3
                        buildingName: Building West
                        floor: '4'
                        room: '47'
                        townName: Maldegem
                        postCode: '9990'
                        country: BE
                      globalIdentifiers:
                        be:vat: BE0412887923
                        global:phoneNumber:
                        - '+3237890123'
                        global:email:
                        - contact@customer.be
                    delivery:
                      deliveryDate: 2024-01-31
                    prepaid:
                      paymentDate: 2024-08-15
                      code: '55'
                      text: 'Advance payment for order #12345'
                      paymentReference:
                        value: Prepaid invoice ABC002
                        type: UNSTRUCTURED
                    paymentMeans:
                    - code: '42'
                      text: PPayment to bank account, Belgian structured reference
                      paymentReference:
                        value: 001/4037/32870
                        type: STRUCTURED
                        scheme: OGM_VCS
                      paymentAccount:
                        identifier: FR3330002005500000157841Z25
                        scheme: IBAN
                        country: FR
                        currency: EUR
                        bank:
                          identifier: CRLYFRPP
                          scheme: BIC
                      paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-...-166eca6e81a7
                    allowances:
                    - netAmount: '150'
                      baseAmount: '1000'
                      percentage: '15'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Discount
                      reasonCode: '95'
                    charges:
                    - netAmount: '200'
                      baseAmount: '1000'
                      percentage: '20'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Advertising
                      reasonCode: AA
                    documentTotals:
                      netAmount: '1000'
                      vatAmount: '100'
                      grossAmount: '1100'
                      prepaidAmount: '500'
                      roundingDifference: '1100'
                      payableAmount: '600'
                    vatDetails:
                    - vatCategory: S
                      vatPercentage: '10'
                      netAmount: '1000'
                      vatAmount: '100'
                      exemptionReason: Medical supplies are exempt from VAT
                      exemptionReasonCode: VATEX-EU-79-C
                    uploadId: '123456789'
                    vatChargeableMethod: payment_date
                    vatAlreadyDeclared: true
                    processControl:
                      businessProcess: goods
                  retentionTime: 2029-01-14 19:58:47+02:00
                  status:
                    accept: ACCEPTED
                  category: INVOICE
                  folder: INBOX
                  connections:
                  - id: 00000001-0000-0000-0000-000000000001
                    relationType: SUPPLIER
                  - id: 00000001-0000-0000-0000-000000000002
                    relationType: CUSTOMER
                  lines:
                  - $schema: https://btx.unifiedpost.com/btx/datastore/document/document_line/v1/document-line-schema.json
                    quantity: '2'
                    unit: H87
                    netAmount: '80.56'
                    currency: USD
                    metadata:
                      externalLineId: A
                      notes:
                      - code: AAA
                        text: Goods item description
                      - code: AAB
                        text: Net 60
                      buyerAccountingReference: CUST-001
                      invoiceReferences:
                      - invoiceReference: ABC002
                        invoiceType: '380'
                        issueDate: 2024-01-14
                        invoiceNumber: ABC002
                      delivery:
                        name: xxxxxx
                        address:
                          department: Service achat
                          streetName: RUE DES FLEURS
                          buildingNumber: 22BIS
                          floor: Zone industrielle de la Ballastrierre Ouest
                          postBox: BP 40122
                          townName: LIBOURNE CEDEX
                          postCode: '33506'
                          country: FR
                        deliveryDate: 2024-01-10
                      startDate: 2024-01-23
                      endDate: 2024-06-23
                      allowances:
                      - netAmount: '20.0'
                        baseAmount: '1000'
                        percentage: '15'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Discount
                        reasonCode: '95'
                      charges:
                      - netAmount: '76.67'
                        baseAmount: '1000'
                        percentage: '20'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Advertising
                        reasonCode: AA
                    pricing:
                      itemNetPrice: '80.56'
                      itemGrossPrice: '96.67'
                      itemPriceQuantity: '40.278192'
                      itemPriceDiscount: '10.0'
                    vatDetails:
                      vatCategory: S
                      vatPercentage: '0.2'
                      vatAmount: '16.11'
                    productIdentifiers:
                      itemId: item1
                      itemCategory: Electronics
                      itemDescription: Noise-cancelling wireless headphones with Bluetooth.
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentV2'
              examples:
                Document:
                  description: Document
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      $schema: https://btx.unifiedpost.com/btx/datastore/document/document_metadata/v1/document-metadata-schema.json
                      documentNumber: ABC002
                      issueDate: 2024-01-31
                      invoiceType: '380'
                      currencyCode: EUR
                      dueDate: 2024-03-30
                      buyerReference: CUST-001
                      contractReference: CONTRACT001
                      purchaseOrderReference: PO123
                      paymentTerms: Net 60
                      notes:
                      - code: AAA
                        text: Goods item description
                      invoiceReferences:
                      - invoiceReference: ABC002
                        issueDate: 2024-01-14
                        invoiceType: '380'
                      supplier:
                        legalName: Monte Carlo Ltd
                        tradingName: Monte Carlo Ltd
                        address:
                          streetName: Rue des Fleurs
                          buildingNumber: 22BIS
                          floor: Zone industrielle de la Ballastrierre Ouest
                          postBox: BP 40122
                          department: Service achat
                          city: LIBOURNE CEDEX
                          postalCode: '33506'
                          countryCode: FR
                        globalIdentifiers:
                          fr:siren: '349718288'
                          fr:siret: '34971828812345'
                          fr:vat: FR63349718288
                          global:email:
                          - montecarloltd@example.com
                          global:phoneNumber:
                          - '+1234567890'
                      customer:
                        legalName: Unifiedpost Group
                        tradingName: ?????????
                        address:
                          streetName: Bloemendalelaan
                          buildingNumber: 62/3
                          buildingName: Building West
                          floor: '4'
                          room: '47'
                          city: Maldegem
                          postalCode: '9990'
                          countryCode: BE
                        globalIdentifiers:
                          be:vat: BE0412887923
                          global:email:
                          - john@example.com
                          global:phoneNumber:
                          - '+1234567890'
                      delivery:
                        deliveryDate: 2024-01-31
                      prepaid:
                        paymentDate: 2024-08-15
                        code: '55'
                        text: 'Advance payment for order #12345'
                        paymentReference:
                          value: Prepaid invoice ABC002
                          type: UNSTRUCTURED
                      paymentMeans:
                      - code: '42'
                        text: PPayment to bank account, Belgian structured reference
                        paymentReference:
                          value: 001/4037/32870
                          type: STRUCTURED
                          scheme: OGM_VCS
                        paymentAccount:
                          identifier: FR3330002005500000157841Z25
                          scheme: IBAN
                          country: FR
                          currency: EUR
                          bank:
                            identifier: CRLYFRPP
                            scheme: BIC
                        paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-...-166eca6e81a7
                        paymentMandate:
                          identifier: MANDATE-2026-00045
                          payerFinancialAccount:
                            identifier: FR7630006000011234567890189
                      allowances:
                      - netAmount: '150'
                        baseAmount: '1000'
                        percentage: '15'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Discount
                        reasonCode: '95'
                      charges:
                      - netAmount: '200'
                        baseAmount: '1000'
                        percentage: '20'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Advertising
                        reasonCode: AA
                      documentTotals:
                        netAmount: '1000'
                        vatAmount: '100'
                        grossAmount: '1100'
                        prepaidAmount: '500'
                        roundingDifference: '1100'
                        payableAmount: '600'
                        linesNetAmount: '900'
                        allowancesNetAmount: '100'
                        chargesNetAmount: '200'
                      vatDetails:
                      - vatCategory: S
                        vatPercentage: '10'
                        netAmount: '1000'
                        vatAmount: '100'
                        exemptionReason: Medical supplies are exempt from VAT
                        exemptionReasonCode: VATEX-EU-79-C
                      uploadId: '123456789'
                      vatChargeableMethod: payment_date
                      vatAlreadyDeclared: true
                      processControl:
                        businessProcess: goods
                      profileId: urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    connections:
                    - id: 00000001-0000-0000-0000-000000000001
                      relationType: SUPPLIER
                    - id: 00000001-0000-0000-0000-000000000002
                      relationType: CUSTOMER
                      displayName: ABC Company
                    retentionTime: 2023-10-04 14:20:31.502921+00:00
                    rawLines:
                      '5':
                        unit:
                          confidence: 0.99
                          value: stuks
                          coordinates: {}
                    rawData:
                      invoiceDate:
                        confidence: 0.99
                        value: 2024-01-01
                        coordinates: {}
                      vatDetails:
                      - vatCode:
                          confidence: 0.99
                          value: ABC
                          coordinates: {}
                    processingData:
                      spaceExtensions:
                        com.unifiedpost.btx.connectors:
                          peppol:
                            sbdhInstanceIdentifiers:
                            - 12345_118e3040-51d2-11e3-8f96-0800200c9a66
                    validationData:
                      spaceExtensions:
                        com.unifiedpost.btx.connectors.validator:
                          dataExtraction:
                            status: COMPLETED
                            validationId: 00000001-0000-0000-0000-000000000000
                            results:
                              ocr.confidence:
                                level: ERROR
                                locations:
                                - type: field
                                  path: dueDate
                                  parameters:
                                    confidence: 0.75
                    customCategories:
                      purchases:
                      - fuel
                      - restaurant
                    timestamps:
                      createdAt: 2025-07-04 14:20:31.502921+00:00
                      updatedAt: 2025-07-04 14:20:31.502921+00:00
                Document containing lines:
                  description: Document containing lines
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      $schema: https://btx.unifiedpost.com/btx/datastore/document/document_metadata/v1/document-metadata-schema.json
                      documentNumber: ABC002
                      issueDate: 2024-01-31
                      invoiceType: '380'
                      currencyCode: EUR
                      dueDate: 2024-03-30
                      buyerReference: CUST-001
                      contractReference: CONTRACT001
                      purchaseOrderReference: PO123
                      paymentTerms: Net 60
                      notes:
                      - code: AAA
                        text: Goods item description
                      invoiceReferences:
                      - invoiceReference: ABC002
                        issueDate: 2024-01-14
                        invoiceType: '380'
                      supplier:
                        legalName: Monte Carlo Ltd
                        tradingName: Monte Carlo Ltd
                        address:
                          streetName: Rue des Fleurs
                          buildingNumber: 22BIS
                          floor: Zone industrielle de la Ballastrierre Ouest
                          postBox: BP 40122
                          department: Service achat
                          city: LIBOURNE CEDEX
                          postalCode: '33506'
                          countryCode: FR
                        globalIdentifiers:
                          fr:siren: '349718288'
                          fr:siret: '34971828812345'
                          fr:vat: FR63349718288
                          global:email:
                          - montecarloltd@example.com
                          global:phoneNumber:
                          - '+1234567890'
                      customer:
                        legalName: Unifiedpost Group
                        tradingName: ?????????
                        address:
                          streetName: Bloemendalelaan
                          buildingNumber: 62/3
                          buildingName: Building West
                          floor: '4'
                          room: '47'
                          city: Maldegem
                          postalCode: '9990'
                          countryCode: BE
                        globalIdentifiers:
                          be:vat: BE0412887923
                          global:email:
                          - john@example.com
                          global:phoneNumber:
                          - '+1234567890'
                      delivery:
                        deliveryDate: 2024-01-31
                      prepaid:
                        paymentDate: 2024-08-15
                        code: '55'
                        text: 'Advance payment for order #12345'
                        paymentReference:
                          value: Prepaid invoice ABC002
                          type: UNSTRUCTURED
                      paymentMeans:
                      - code: '42'
                        text: PPayment to bank account, Belgian structured reference
                        paymentReference:
                          value: 001/4037/32870
                          type: STRUCTURED
                          scheme: OGM_VCS
                        paymentAccount:
                          identifier: FR3330002005500000157841Z25
                          scheme: IBAN
                          country: FR
                          currency: EUR
                          bank:
                            identifier: CRLYFRPP
                            scheme: BIC
                        paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-...-166eca6e81a7
                        paymentMandate:
                          identifier: MANDATE-2026-00045
                          payerFinancialAccount:
                            identifier: FR7630006000011234567890189
                      allowances:
                      - netAmount: '150'
                        baseAmount: '1000'
                        percentage: '15'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Discount
                        reasonCode: '95'
                      charges:
                      - netAmount: '200'
                        baseAmount: '1000'
                        percentage: '20'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Advertising
                        reasonCode: AA
                      documentTotals:
                        netAmount: '1000'
                        vatAmount: '100'
                        grossAmount: '1100'
                        prepaidAmount: '500'
                        roundingDifference: '1100'
                        payableAmount: '600'
                      vatDetails:
                      - vatCategory: S
                        vatPercentage: '10'
                        netAmount: '1000'
                        vatAmount: '100'
                        exemptionReason: Medical supplies are exempt from VAT
                        exemptionReasonCode: VATEX-EU-79-C
                      uploadId: '123456789'
                      vatChargeableMethod: payment_date
                      vatAlreadyDeclared: true
                      processControl:
                        businessProcess: goods
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    connections:
                    - id: 00000001-0000-0000-0000-000000000001
                      relationType: SUPPLIER
                    - id: 00000001-0000-0000-0000-000000000002
                      relationType: CUSTOMER
                      displayName: ABC Company
                    retentionTime: 2023-10-04 14:20:31.502921+00:00
                    lines:
                    - $schema: https://btx.unifiedpost.com/btx/datastore/document/document_line/v1/document-line-schema.json
                      quantity: '2'
                      unit: H87
                      netAmount: '80.56'
                      currency: USD
                      metadata:
                        externalLineId: A
                        notes:
                        - code: AAA
                          text: Goods item description
                        - code: AAB
                          text: Net 60
                        buyerAccountingReference: CUST-001
                        invoiceReferences:
                        - invoiceReference: ABC002
                          invoiceType: '380'
                          issueDate: 2024-01-14
                          invoiceNumber: ABC002
                        delivery:
                          name: xxxxxx
                          address:
                            department: Service achat
                            streetName: RUE DES FLEURS
                            buildingNumber: 22BIS
                            floor: Zone industrielle de la Ballastrierre Ouest
                            postBox: BP 40122
                            townName: LIBOURNE CEDEX
                            postCode: '33506'
                            country: FR
                          deliveryDate: 2024-01-10
                        startDate: 2024-01-23
                        endDate: 2024-06-23
                        allowances:
                        - netAmount: '20.0'
                          baseAmount: '1000'
                          percentage: '15'
                          vatCategory: S
                          vatPercentage: '10'
                          description: Discount
                          reasonCode: '95'
                        charges:
                        - netAmount: '76.67'
                          baseAmount: '1000'
                          percentage: '20'
                          vatCategory: S
                          vatPercentage: '10'
                          description: Advertising
                          reasonCode: AA
                      pricing:
                        itemNetPrice: '80.56'
                        itemGrossPrice: '96.67'
                        itemPriceQuantity: '40.278192'
                        itemPriceDiscount: '10.0'
                      vatDetails:
                        vatCategory: S
                        vatPercentage: '0.2'
                        vatAmount: '16.11'
                      productIdentifiers:
                        itemId: item1
                        itemCategory: Electronics
                        itemDescription: Noise-cancelling wireless headphones with
                          Bluetooth.
                    timestamps:
                      createdAt: 2025-07-04 14:20:31.502921+00:00
                      updatedAt: 2025-07-04 14:20:31.502921+00:00
                Document with parent directory:
                  description: Document with parent directory
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: FILES
                    category: FILE
                    metadata:
                      $schema: https://btx.unifiedpost.com/btx/datastore/document/document_metadata/v1/document-metadata-schema.json
                      documentNumber: ABC002
                    tags:
                    - new
                    retentionTime: 2023-10-04 14:20:31.502921+00:00
                    parentDirectory:
                      id: 44d929f7-952d-4283-9010-8a63a16831b3
                      name: Plant
                    timestamps:
                      createdAt: 2025-07-04 14:20:31.502921+00:00
                      updatedAt: 2025-07-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v2/spaces/{spaceId}/documents/{documentId}:
    get:
      tags:
      - Documents
      summary: Get document info v2
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get document information v2 by its ID on the given space <br/> Scope:
        space_read'
      operationId: getDocumentV2
      parameters:
      - name: spaceId
        in: path
        description: The space unique identifier. (A UUID specified by RFC4122).
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document unique identifier. (A UUID specified by RFC4122).
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: include
        in: query
        description: What extra data to include in the response.
        explode: false
        schema:
          type: array
          items:
            type: string
            enum:
            - lines
            - tasks
            - connections
            - timestamps
            - rawData
            - rawLines
            - processingData
            - validationData
            - customCategories
            - balanceOffsets
        example: lines,connections
      responses:
        '200':
          description: Ok. Document info.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentV2'
              example:
                id: 0ca2797b-6365-4bf2-a490-247075e3cede
                spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                description: Sample Document
                source: Sample Source
                folder: PURCHASES
                status:
                  pay: FULLY_PAID
                category: INVOICE
                metadata:
                  $schema: https://btx.unifiedpost.com/btx/datastore/document/document_metadata/v1/document-metadata-schema.json
                  documentNumber: ABC002
                  issueDate: 2024-01-31
                  invoiceType: '380'
                  currencyCode: EUR
                  dueDate: 2024-03-30
                  buyerReference: CUST-001
                  contractReference: CONTRACT001
                  purchaseOrderReference: PO123
                  paymentTerms: Net 60
                  notes:
                  - code: AAA
                    text: Goods item description
                  invoiceReferences:
                  - invoiceReference: ABC002
                    issueDate: 2024-01-14
                    invoiceType: '380'
                  supplier:
                    legalName: Monte Carlo Ltd
                    tradingName: Monte Carlo Ltd
                    address:
                      streetName: Rue des Fleurs
                      buildingNumber: 22BIS
                      floor: Zone industrielle de la Ballastrierre Ouest
                      postBox: BP 40122
                      department: Service achat
                      city: LIBOURNE CEDEX
                      postalCode: '33506'
                      countryCode: FR
                    globalIdentifiers:
                      fr:siren: '349718288'
                      fr:siret: '34971828812345'
                      fr:vat: FR63349718288
                      global:email:
                      - montecarloltd@example.com
                      global:phoneNumber:
                      - '+1234567890'
                  customer:
                    legalName: Unifiedpost Group
                    tradingName: ?????????
                    address:
                      streetName: Bloemendalelaan
                      buildingNumber: 62/3
                      buildingName: Building West
                      floor: '4'
                      room: '47'
                      city: Maldegem
                      postalCode: '9990'
                      countryCode: BE
                    globalIdentifiers:
                      be:vat: BE0412887923
                      global:email:
                      - john@example.com
                      global:phoneNumber:
                      - '+1234567890'
                  delivery:
                    deliveryDate: 2024-01-31
                  prepaid:
                    paymentDate: 2024-08-15
                    code: '55'
                    text: 'Advance payment for order #12345'
                    paymentReference:
                      value: Prepaid invoice ABC002
                      type: UNSTRUCTURED
                  paymentMeans:
                  - code: '42'
                    text: PPayment to bank account, Belgian structured reference
                    paymentReference:
                      value: 001/4037/32870
                      type: STRUCTURED
                      scheme: OGM_VCS
                    paymentAccount:
                      identifier: FR3330002005500000157841Z25
                      scheme: IBAN
                      country: FR
                      currency: EUR
                      bank:
                        identifier: CRLYFRPP
                        scheme: BIC
                    paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-...-166eca6e81a7
                    paymentMandate:
                      identifier: MANDATE-2026-00045
                      payerFinancialAccount:
                        identifier: FR7630006000011234567890189
                  allowances:
                  - netAmount: '150'
                    baseAmount: '1000'
                    percentage: '15'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Discount
                    reasonCode: '95'
                  charges:
                  - netAmount: '200'
                    baseAmount: '1000'
                    percentage: '20'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Advertising
                    reasonCode: AA
                  documentTotals:
                    netAmount: '1000'
                    vatAmount: '100'
                    grossAmount: '1100'
                    prepaidAmount: '500'
                    roundingDifference: '1100'
                    payableAmount: '600'
                    linesNetAmount: '900'
                    allowancesNetAmount: '100'
                    chargesNetAmount: '200'
                  vatDetails:
                  - vatCategory: S
                    vatPercentage: '10'
                    netAmount: '1000'
                    vatAmount: '100'
                    exemptionReason: Medical supplies are exempt from VAT
                    exemptionReasonCode: VATEX-EU-79-C
                  uploadId: '123456789'
                  vatChargeableMethod: payment_date
                  vatAlreadyDeclared: true
                  processControl:
                    businessProcess: goods
                  profileId: urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
                tags:
                - new
                tasks:
                - extensionName: com.unifiedpost.btx.data:approve
                  status: approve
                connections:
                - id: 00000001-0000-0000-0000-000000000001
                  relationType: SUPPLIER
                - id: 00000001-0000-0000-0000-000000000002
                  relationType: CUSTOMER
                  displayName: ABC Company
                retentionTime: 2023-10-04 14:20:31.502921+00:00
                rawLines:
                  '5':
                    unit:
                      confidence: 0.99
                      value: stuks
                      coordinates: {}
                rawData:
                  invoiceDate:
                    confidence: 0.99
                    value: 2024-01-01
                    coordinates: {}
                  vatDetails:
                  - vatCode:
                      confidence: 0.99
                      value: ABC
                      coordinates: {}
                processingData:
                  spaceExtensions:
                    com.unifiedpost.btx.connectors:
                      peppol:
                        sbdhInstanceIdentifiers:
                        - 12345_118e3040-51d2-11e3-8f96-0800200c9a66
                validationData:
                  spaceExtensions:
                    com.unifiedpost.btx.connectors.validator:
                      dataExtraction:
                        status: COMPLETED
                        validationId: 00000001-0000-0000-0000-000000000000
                        results:
                          ocr.confidence:
                            level: ERROR
                            locations:
                            - type: field
                              path: dueDate
                              parameters:
                                confidence: 0.75
                customCategories:
                  purchases:
                  - fuel
                  - restaurant
                timestamps:
                  createdAt: 2025-07-04 14:20:31.502921+00:00
                  updatedAt: 2025-07-04 14:20:31.502921+00:00
        '404':
          description: Space and/or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
    delete:
      tags:
      - Documents
      summary: Delete document v2
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Delete document v2 by its ID on the given space. Will cascade delete
        associated balance offsets. <br/> Scope: space_write'
      operationId: deleteDocumentV2
      parameters:
      - name: spaceId
        in: path
        description: The space unique identifier. (A UUID specified by RFC4122).
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document unique identifier. (A UUID specified by RFC4122).
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      responses:
        '204':
          description: Ok.
        '404':
          description: Space and/or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
    patch:
      tags:
      - Documents
      summary: Update document v2
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update document v2 by its ID on the given space by sending json with
        the changes <br/> Scope: space_write'
      operationId: updateDocumentV2
      parameters:
      - name: spaceId
        in: path
        description: The space unique identifier. (A UUID specified by RFC4122).
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document unique identifier. (A UUID specified by RFC4122).
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      requestBody:
        description: Document data to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentPatchRequestV2'
            example:
              metadata:
                supplier:
                  legalName: Jack Doe
                  tradeName: Jack Doe
              tags:
              - seen
              retentionTime: 2029-01-14 19:58:47+02:00
              status:
                accept: UNACCEPTED
              category: INVOICE
              lines:
              - $schema: https://btx.unifiedpost.com/btx/datastore/document/document_line/v1/document-line-schema.json
                quantity: '2'
                unit: H87
                netAmount: '80.56'
                currency: USD
                metadata:
                  externalLineId: A
                  notes:
                  - code: AAA
                    text: Goods item description
                  - code: AAB
                    text: Net 60
                  buyerAccountingReference: CUST-001
                  invoiceReferences:
                  - invoiceReference: ABC002
                    invoiceType: '380'
                    issueDate: 2024-01-14
                    invoiceNumber: ABC002
                  delivery:
                    name: xxxxxx
                    address:
                      department: Service achat
                      streetName: RUE DES FLEURS
                      buildingNumber: 22BIS
                      floor: Zone industrielle de la Ballastrierre Ouest
                      postBox: BP 40122
                      townName: LIBOURNE CEDEX
                      postCode: '33506'
                      country: FR
                    deliveryDate: 2024-01-10
                  startDate: 2024-01-23
                  endDate: 2024-06-23
                  allowances:
                  - netAmount: '20.0'
                    baseAmount: '1000'
                    percentage: '15'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Discount
                    reasonCode: '95'
                  charges:
                  - netAmount: '76.67'
                    baseAmount: '1000'
                    percentage: '20'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Advertising
                    reasonCode: AA
                pricing:
                  itemNetPrice: '80.56'
                  itemGrossPrice: '96.67'
                  itemPriceQuantity: '40.278192'
                  itemPriceDiscount: '10.0'
                vatDetails:
                  vatCategory: S
                  vatPercentage: '0.2'
                  vatAmount: '16.11'
                productIdentifiers:
                  itemId: item1
                  itemCategory: Electronics
                  itemDescription: Noise-cancelling wireless headphones with Bluetooth.
              connections:
              - id: 00000001-0000-0000-0000-000000000001
                relationType: SUPPLIER
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: replace
              path: /description
              value: patched description
            - op: remove
              path: /foo
        required: true
      responses:
        '200':
          description: Update document successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentV2'
              example:
                id: 0ca2797b-6365-4bf2-a490-247075e3cede
                spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                description: Sample Document
                source: Sample Source
                folder: PURCHASES
                status:
                  pay: FULLY_PAID
                category: INVOICE
                metadata:
                  $schema: https://btx.unifiedpost.com/btx/datastore/document/document_metadata/v1/document-metadata-schema.json
                  documentNumber: ABC002
                  issueDate: 2024-01-31
                  invoiceType: '380'
                  currencyCode: EUR
                  dueDate: 2024-03-30
                  buyerReference: CUST-001
                  contractReference: CONTRACT001
                  purchaseOrderReference: PO123
                  paymentTerms: Net 60
                  notes:
                  - code: AAA
                    text: Goods item description
                  invoiceReferences:
                  - invoiceReference: ABC002
                    issueDate: 2024-01-14
                    invoiceType: '380'
                  supplier:
                    legalName: Monte Carlo Ltd
                    tradingName: Monte Carlo Ltd
                    address:
                      streetName: Rue des Fleurs
                      buildingNumber: 22BIS
                      floor: Zone industrielle de la Ballastrierre Ouest
                      postBox: BP 40122
                      department: Service achat
                      city: LIBOURNE CEDEX
                      postalCode: '33506'
                      countryCode: FR
                    globalIdentifiers:
                      fr:siren: '349718288'
                      fr:siret: '34971828812345'
                      fr:vat: FR63349718288
                      global:email:
                      - montecarloltd@example.com
                      global:phoneNumber:
                      - '+1234567890'
                  customer:
                    legalName: Unifiedpost Group
                    tradingName: ?????????
                    address:
                      streetName: Bloemendalelaan
                      buildingNumber: 62/3
                      buildingName: Building West
                      floor: '4'
                      room: '47'
                      city: Maldegem
                      postalCode: '9990'
                      countryCode: BE
                    globalIdentifiers:
                      be:vat: BE0412887923
                      global:email:
                      - john@example.com
                      global:phoneNumber:
                      - '+1234567890'
                  delivery:
                    deliveryDate: 2024-01-31
                  prepaid:
                    paymentDate: 2024-08-15
                    code: '55'
                    text: 'Advance payment for order #12345'
                    paymentReference:
                      value: Prepaid invoice ABC002
                      type: UNSTRUCTURED
                  paymentMeans:
                  - code: '42'
                    text: PPayment to bank account, Belgian structured reference
                    paymentReference:
                      value: 001/4037/32870
                      type: STRUCTURED
                      scheme: OGM_VCS
                    paymentAccount:
                      identifier: FR3330002005500000157841Z25
                      scheme: IBAN
                      country: FR
                      currency: EUR
                      bank:
                        identifier: CRLYFRPP
                        scheme: BIC
                    paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-...-166eca6e81a7
                    paymentMandate:
                      identifier: MANDATE-2026-00045
                      payerFinancialAccount:
                        identifier: FR7630006000011234567890189
                  allowances:
                  - netAmount: '150'
                    baseAmount: '1000'
                    percentage: '15'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Discount
                    reasonCode: '95'
                  charges:
                  - netAmount: '200'
                    baseAmount: '1000'
                    percentage: '20'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Advertising
                    reasonCode: AA
                  documentTotals:
                    netAmount: '1000'
                    vatAmount: '100'
                    grossAmount: '1100'
                    prepaidAmount: '500'
                    roundingDifference: '1100'
                    payableAmount: '600'
                    linesNetAmount: '900'
                    allowancesNetAmount: '100'
                    chargesNetAmount: '200'
                  vatDetails:
                  - vatCategory: S
                    vatPercentage: '10'
                    netAmount: '1000'
                    vatAmount: '100'
                    exemptionReason: Medical supplies are exempt from VAT
                    exemptionReasonCode: VATEX-EU-79-C
                  uploadId: '123456789'
                  vatChargeableMethod: payment_date
                  vatAlreadyDeclared: true
                  processControl:
                    businessProcess: goods
                  profileId: urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
                tags:
                - new
                tasks:
                - extensionName: com.unifiedpost.btx.data:approve
                  status: approve
                connections:
                - id: 00000001-0000-0000-0000-000000000001
                  relationType: SUPPLIER
                - id: 00000001-0000-0000-0000-000000000002
                  relationType: CUSTOMER
                  displayName: ABC Company
                retentionTime: 2023-10-04 14:20:31.502921+00:00
                rawLines:
                  '5':
                    unit:
                      confidence: 0.99
                      value: stuks
                      coordinates: {}
                rawData:
                  invoiceDate:
                    confidence: 0.99
                    value: 2024-01-01
                    coordinates: {}
                  vatDetails:
                  - vatCode:
                      confidence: 0.99
                      value: ABC
                      coordinates: {}
                processingData:
                  spaceExtensions:
                    com.unifiedpost.btx.connectors:
                      peppol:
                        sbdhInstanceIdentifiers:
                        - 12345_118e3040-51d2-11e3-8f96-0800200c9a66
                validationData:
                  spaceExtensions:
                    com.unifiedpost.btx.connectors.validator:
                      dataExtraction:
                        status: COMPLETED
                        validationId: 00000001-0000-0000-0000-000000000000
                        results:
                          ocr.confidence:
                            level: ERROR
                            locations:
                            - type: field
                              path: dueDate
                              parameters:
                                confidence: 0.75
                customCategories:
                  purchases:
                  - fuel
                  - restaurant
                timestamps:
                  createdAt: 2025-07-04 14:20:31.502921+00:00
                  updatedAt: 2025-07-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space and/or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v2/spaces/{spaceId}/documents/{documentId}:jsonpatch:
    patch:
      tags:
      - Documents
      summary: Update document v2
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update document v2 by its ID on the given space by sending JSON patch
        <br/> Scope: space_write'
      operationId: jsonpatchDocumentV2
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Document data to update
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: replace
              path: /description
              value: patched description
            - op: remove
              path: /foo
        required: true
      responses:
        '200':
          description: Update document successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentV2'
              example:
                id: 0ca2797b-6365-4bf2-a490-247075e3cede
                spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                description: Sample Document
                source: Sample Source
                folder: PURCHASES
                status:
                  pay: FULLY_PAID
                category: INVOICE
                metadata:
                  $schema: https://btx.unifiedpost.com/btx/datastore/document/document_metadata/v1/document-metadata-schema.json
                  documentNumber: ABC002
                  issueDate: 2024-01-31
                  invoiceType: '380'
                  currencyCode: EUR
                  dueDate: 2024-03-30
                  buyerReference: CUST-001
                  contractReference: CONTRACT001
                  purchaseOrderReference: PO123
                  paymentTerms: Net 60
                  notes:
                  - code: AAA
                    text: Goods item description
                  invoiceReferences:
                  - invoiceReference: ABC002
                    issueDate: 2024-01-14
                    invoiceType: '380'
                  supplier:
                    legalName: Monte Carlo Ltd
                    tradingName: Monte Carlo Ltd
                    address:
                      streetName: Rue des Fleurs
                      buildingNumber: 22BIS
                      floor: Zone industrielle de la Ballastrierre Ouest
                      postBox: BP 40122
                      department: Service achat
                      city: LIBOURNE CEDEX
                      postalCode: '33506'
                      countryCode: FR
                    globalIdentifiers:
                      fr:siren: '349718288'
                      fr:siret: '34971828812345'
                      fr:vat: FR63349718288
                      global:email:
                      - montecarloltd@example.com
                      global:phoneNumber:
                      - '+1234567890'
                  customer:
                    legalName: Unifiedpost Group
                    tradingName: ?????????
                    address:
                      streetName: Bloemendalelaan
                      buildingNumber: 62/3
                      buildingName: Building West
                      floor: '4'
                      room: '47'
                      city: Maldegem
                      postalCode: '9990'
                      countryCode: BE
                    globalIdentifiers:
                      be:vat: BE0412887923
                      global:email:
                      - john@example.com
                      global:phoneNumber:
                      - '+1234567890'
                  delivery:
                    deliveryDate: 2024-01-31
                  prepaid:
                    paymentDate: 2024-08-15
                    code: '55'
                    text: 'Advance payment for order #12345'
                    paymentReference:
                      value: Prepaid invoice ABC002
                      type: UNSTRUCTURED
                  paymentMeans:
                  - code: '42'
                    text: PPayment to bank account, Belgian structured reference
                    paymentReference:
                      value: 001/4037/32870
                      type: STRUCTURED
                      scheme: OGM_VCS
                    paymentAccount:
                      identifier: FR3330002005500000157841Z25
                      scheme: IBAN
                      country: FR
                      currency: EUR
                      bank:
                        identifier: CRLYFRPP
                        scheme: BIC
                    paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-...-166eca6e81a7
                    paymentMandate:
                      identifier: MANDATE-2026-00045
                      payerFinancialAccount:
                        identifier: FR7630006000011234567890189
                  allowances:
                  - netAmount: '150'
                    baseAmount: '1000'
                    percentage: '15'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Discount
                    reasonCode: '95'
                  charges:
                  - netAmount: '200'
                    baseAmount: '1000'
                    percentage: '20'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Advertising
                    reasonCode: AA
                  documentTotals:
                    netAmount: '1000'
                    vatAmount: '100'
                    grossAmount: '1100'
                    prepaidAmount: '500'
                    roundingDifference: '1100'
                    payableAmount: '600'
                    linesNetAmount: '900'
                    allowancesNetAmount: '100'
                    chargesNetAmount: '200'
                  vatDetails:
                  - vatCategory: S
                    vatPercentage: '10'
                    netAmount: '1000'
                    vatAmount: '100'
                    exemptionReason: Medical supplies are exempt from VAT
                    exemptionReasonCode: VATEX-EU-79-C
                  uploadId: '123456789'
                  vatChargeableMethod: payment_date
                  vatAlreadyDeclared: true
                  processControl:
                    businessProcess: goods
                  profileId: urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
                tags:
                - new
                tasks:
                - extensionName: com.unifiedpost.btx.data:approve
                  status: approve
                connections:
                - id: 00000001-0000-0000-0000-000000000001
                  relationType: SUPPLIER
                - id: 00000001-0000-0000-0000-000000000002
                  relationType: CUSTOMER
                  displayName: ABC Company
                retentionTime: 2023-10-04 14:20:31.502921+00:00
                rawLines:
                  '5':
                    unit:
                      confidence: 0.99
                      value: stuks
                      coordinates: {}
                rawData:
                  invoiceDate:
                    confidence: 0.99
                    value: 2024-01-01
                    coordinates: {}
                  vatDetails:
                  - vatCode:
                      confidence: 0.99
                      value: ABC
                      coordinates: {}
                processingData:
                  spaceExtensions:
                    com.unifiedpost.btx.connectors:
                      peppol:
                        sbdhInstanceIdentifiers:
                        - 12345_118e3040-51d2-11e3-8f96-0800200c9a66
                validationData:
                  spaceExtensions:
                    com.unifiedpost.btx.connectors.validator:
                      dataExtraction:
                        status: COMPLETED
                        validationId: 00000001-0000-0000-0000-000000000000
                        results:
                          ocr.confidence:
                            level: ERROR
                            locations:
                            - type: field
                              path: dueDate
                              parameters:
                                confidence: 0.75
                customCategories:
                  purchases:
                  - fuel
                  - restaurant
                timestamps:
                  createdAt: 2025-07-04 14:20:31.502921+00:00
                  updatedAt: 2025-07-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space and/or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v2/spaces/{spaceId}/documents/{documentId}:move:
    post:
      tags:
      - Documents
      summary: Move document to a directory
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Move document on the given space to a directory <br/> Scope: space_write'
      operationId: moveDocumentToDirectory
      parameters:
      - name: spaceId
        in: path
        description: The space identifier.
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier.
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Move document request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MoveDocumentToDirectoryRequest'
            examples:
              Move to root directory:
                description: Move to root directory
                value:
                  parentDirectoryId: null
              Move to directory:
                description: Move to directory
                value:
                  parentDirectoryId: 44d929f7-952d-4283-9010-8a63a16831b3
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentV2'
              examples:
                Document:
                  description: Document
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      $schema: https://btx.unifiedpost.com/btx/datastore/document/document_metadata/v1/document-metadata-schema.json
                      documentNumber: ABC002
                      issueDate: 2024-01-31
                      invoiceType: '380'
                      currencyCode: EUR
                      dueDate: 2024-03-30
                      buyerReference: CUST-001
                      contractReference: CONTRACT001
                      purchaseOrderReference: PO123
                      paymentTerms: Net 60
                      notes:
                      - code: AAA
                        text: Goods item description
                      invoiceReferences:
                      - invoiceReference: ABC002
                        issueDate: 2024-01-14
                        invoiceType: '380'
                      supplier:
                        legalName: Monte Carlo Ltd
                        tradingName: Monte Carlo Ltd
                        address:
                          streetName: Rue des Fleurs
                          buildingNumber: 22BIS
                          floor: Zone industrielle de la Ballastrierre Ouest
                          postBox: BP 40122
                          department: Service achat
                          city: LIBOURNE CEDEX
                          postalCode: '33506'
                          countryCode: FR
                        globalIdentifiers:
                          fr:siren: '349718288'
                          fr:siret: '34971828812345'
                          fr:vat: FR63349718288
                          global:email:
                          - montecarloltd@example.com
                          global:phoneNumber:
                          - '+1234567890'
                      customer:
                        legalName: Unifiedpost Group
                        tradingName: ?????????
                        address:
                          streetName: Bloemendalelaan
                          buildingNumber: 62/3
                          buildingName: Building West
                          floor: '4'
                          room: '47'
                          city: Maldegem
                          postalCode: '9990'
                          countryCode: BE
                        globalIdentifiers:
                          be:vat: BE0412887923
                          global:email:
                          - john@example.com
                          global:phoneNumber:
                          - '+1234567890'
                      delivery:
                        deliveryDate: 2024-01-31
                      prepaid:
                        paymentDate: 2024-08-15
                        code: '55'
                        text: 'Advance payment for order #12345'
                        paymentReference:
                          value: Prepaid invoice ABC002
                          type: UNSTRUCTURED
                      paymentMeans:
                      - code: '42'
                        text: PPayment to bank account, Belgian structured reference
                        paymentReference:
                          value: 001/4037/32870
                          type: STRUCTURED
                          scheme: OGM_VCS
                        paymentAccount:
                          identifier: FR3330002005500000157841Z25
                          scheme: IBAN
                          country: FR
                          currency: EUR
                          bank:
                            identifier: CRLYFRPP
                            scheme: BIC
                        paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-...-166eca6e81a7
                        paymentMandate:
                          identifier: MANDATE-2026-00045
                          payerFinancialAccount:
                            identifier: FR7630006000011234567890189
                      allowances:
                      - netAmount: '150'
                        baseAmount: '1000'
                        percentage: '15'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Discount
                        reasonCode: '95'
                      charges:
                      - netAmount: '200'
                        baseAmount: '1000'
                        percentage: '20'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Advertising
                        reasonCode: AA
                      documentTotals:
                        netAmount: '1000'
                        vatAmount: '100'
                        grossAmount: '1100'
                        prepaidAmount: '500'
                        roundingDifference: '1100'
                        payableAmount: '600'
                        linesNetAmount: '900'
                        allowancesNetAmount: '100'
                        chargesNetAmount: '200'
                      vatDetails:
                      - vatCategory: S
                        vatPercentage: '10'
                        netAmount: '1000'
                        vatAmount: '100'
                        exemptionReason: Medical supplies are exempt from VAT
                        exemptionReasonCode: VATEX-EU-79-C
                      uploadId: '123456789'
                      vatChargeableMethod: payment_date
                      vatAlreadyDeclared: true
                      processControl:
                        businessProcess: goods
                      profileId: urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    connections:
                    - id: 00000001-0000-0000-0000-000000000001
                      relationType: SUPPLIER
                    - id: 00000001-0000-0000-0000-000000000002
                      relationType: CUSTOMER
                      displayName: ABC Company
                    retentionTime: 2023-10-04 14:20:31.502921+00:00
                    rawLines:
                      '5':
                        unit:
                          confidence: 0.99
                          value: stuks
                          coordinates: {}
                    rawData:
                      invoiceDate:
                        confidence: 0.99
                        value: 2024-01-01
                        coordinates: {}
                      vatDetails:
                      - vatCode:
                          confidence: 0.99
                          value: ABC
                          coordinates: {}
                    processingData:
                      spaceExtensions:
                        com.unifiedpost.btx.connectors:
                          peppol:
                            sbdhInstanceIdentifiers:
                            - 12345_118e3040-51d2-11e3-8f96-0800200c9a66
                    validationData:
                      spaceExtensions:
                        com.unifiedpost.btx.connectors.validator:
                          dataExtraction:
                            status: COMPLETED
                            validationId: 00000001-0000-0000-0000-000000000000
                            results:
                              ocr.confidence:
                                level: ERROR
                                locations:
                                - type: field
                                  path: dueDate
                                  parameters:
                                    confidence: 0.75
                    customCategories:
                      purchases:
                      - fuel
                      - restaurant
                    timestamps:
                      createdAt: 2025-07-04 14:20:31.502921+00:00
                      updatedAt: 2025-07-04 14:20:31.502921+00:00
                Document with parent directory:
                  description: Document with parent directory
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: FILES
                    category: FILE
                    metadata:
                      $schema: https://btx.unifiedpost.com/btx/datastore/document/document_metadata/v1/document-metadata-schema.json
                      documentNumber: ABC002
                    tags:
                    - new
                    retentionTime: 2023-10-04 14:20:31.502921+00:00
                    parentDirectory:
                      id: 44d929f7-952d-4283-9010-8a63a16831b3
                      name: Plant
                    timestamps:
                      createdAt: 2025-07-04 14:20:31.502921+00:00
                      updatedAt: 2025-07-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v2/spaces/{spaceId}/documents/{documentId}:unassignConnection:
    post:
      tags:
      - Documents
      summary: Unassign connection from document
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Unassign connection from document <br/> Scope: space_write'
      operationId: unassignDocumentConnection
      parameters:
      - name: spaceId
        in: path
        description: The space unique identifier. (A UUID specified by RFC4122).
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document unique identifier. (A UUID specified by RFC4122).
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Connection to unassign
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentConnectionRequest'
            example:
              id: 4c32d3fb-0023-470c-ae21-105274a94706
              relationType: CUSTOMER
        required: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentV2'
              example:
                id: 0ca2797b-6365-4bf2-a490-247075e3cede
                spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                description: Sample Document
                source: Sample Source
                folder: PURCHASES
                status:
                  pay: FULLY_PAID
                category: INVOICE
                metadata:
                  $schema: https://btx.unifiedpost.com/btx/datastore/document/document_metadata/v1/document-metadata-schema.json
                  documentNumber: ABC002
                  issueDate: 2024-01-31
                  invoiceType: '380'
                  currencyCode: EUR
                  dueDate: 2024-03-30
                  buyerReference: CUST-001
                  contractReference: CONTRACT001
                  purchaseOrderReference: PO123
                  paymentTerms: Net 60
                  notes:
                  - code: AAA
                    text: Goods item description
                  invoiceReferences:
                  - invoiceReference: ABC002
                    issueDate: 2024-01-14
                    invoiceType: '380'
                  supplier:
                    legalName: Monte Carlo Ltd
                    tradingName: Monte Carlo Ltd
                    address:
                      streetName: Rue des Fleurs
                      buildingNumber: 22BIS
                      floor: Zone industrielle de la Ballastrierre Ouest
                      postBox: BP 40122
                      department: Service achat
                      city: LIBOURNE CEDEX
                      postalCode: '33506'
                      countryCode: FR
                    globalIdentifiers:
                      fr:siren: '349718288'
                      fr:siret: '34971828812345'
                      fr:vat: FR63349718288
                      global:email:
                      - montecarloltd@example.com
                      global:phoneNumber:
                      - '+1234567890'
                  customer:
                    legalName: Unifiedpost Group
                    tradingName: ?????????
                    address:
                      streetName: Bloemendalelaan
                      buildingNumber: 62/3
                      buildingName: Building West
                      floor: '4'
                      room: '47'
                      city: Maldegem
                      postalCode: '9990'
                      countryCode: BE
                    globalIdentifiers:
                      be:vat: BE0412887923
                      global:email:
                      - john@example.com
                      global:phoneNumber:
                      - '+1234567890'
                  delivery:
                    deliveryDate: 2024-01-31
                  prepaid:
                    paymentDate: 2024-08-15
                    code: '55'
                    text: 'Advance payment for order #12345'
                    paymentReference:
                      value: Prepaid invoice ABC002
                      type: UNSTRUCTURED
                  paymentMeans:
                  - code: '42'
                    text: PPayment to bank account, Belgian structured reference
                    paymentReference:
                      value: 001/4037/32870
                      type: STRUCTURED
                      scheme: OGM_VCS
                    paymentAccount:
                      identifier: FR3330002005500000157841Z25
                      scheme: IBAN
                      country: FR
                      currency: EUR
                      bank:
                        identifier: CRLYFRPP
                        scheme: BIC
                    paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-...-166eca6e81a7
                    paymentMandate:
                      identifier: MANDATE-2026-00045
                      payerFinancialAccount:
                        identifier: FR7630006000011234567890189
                  allowances:
                  - netAmount: '150'
                    baseAmount: '1000'
                    percentage: '15'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Discount
                    reasonCode: '95'
                  charges:
                  - netAmount: '200'
                    baseAmount: '1000'
                    percentage: '20'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Advertising
                    reasonCode: AA
                  documentTotals:
                    netAmount: '1000'
                    vatAmount: '100'
                    grossAmount: '1100'
                    prepaidAmount: '500'
                    roundingDifference: '1100'
                    payableAmount: '600'
                    linesNetAmount: '900'
                    allowancesNetAmount: '100'
                    chargesNetAmount: '200'
                  vatDetails:
                  - vatCategory: S
                    vatPercentage: '10'
                    netAmount: '1000'
                    vatAmount: '100'
                    exemptionReason: Medical supplies are exempt from VAT
                    exemptionReasonCode: VATEX-EU-79-C
                  uploadId: '123456789'
                  vatChargeableMethod: payment_date
                  vatAlreadyDeclared: true
                  processControl:
                    businessProcess: goods
                  profileId: urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
                tags:
                - new
                tasks:
                - extensionName: com.unifiedpost.btx.data:approve
                  status: approve
                connections:
                - id: 00000001-0000-0000-0000-000000000001
                  relationType: SUPPLIER
                - id: 00000001-0000-0000-0000-000000000002
                  relationType: CUSTOMER
                  displayName: ABC Company
                retentionTime: 2023-10-04 14:20:31.502921+00:00
                rawLines:
                  '5':
                    unit:
                      confidence: 0.99
                      value: stuks
                      coordinates: {}
                rawData:
                  invoiceDate:
                    confidence: 0.99
                    value: 2024-01-01
                    coordinates: {}
                  vatDetails:
                  - vatCode:
                      confidence: 0.99
                      value: ABC
                      coordinates: {}
                processingData:
                  spaceExtensions:
                    com.unifiedpost.btx.connectors:
                      peppol:
                        sbdhInstanceIdentifiers:
                        - 12345_118e3040-51d2-11e3-8f96-0800200c9a66
                validationData:
                  spaceExtensions:
                    com.unifiedpost.btx.connectors.validator:
                      dataExtraction:
                        status: COMPLETED
                        validationId: 00000001-0000-0000-0000-000000000000
                        results:
                          ocr.confidence:
                            level: ERROR
                            locations:
                            - type: field
                              path: dueDate
                              parameters:
                                confidence: 0.75
                customCategories:
                  purchases:
                  - fuel
                  - restaurant
                timestamps:
                  createdAt: 2025-07-04 14:20:31.502921+00:00
                  updatedAt: 2025-07-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space/Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /transaction/v2/spaces/{spaceId}/documents/{documentId}/status/spaceExtensions/{extensionNameSpace}/{extensionName}:
    get:
      tags:
      - Documents
      summary: Get document status
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get document status of a specific extension (connector).'
      operationId: getDocumentStatusOfExtensionV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: extensionNameSpace
        in: path
        description: Extension namespace
        required: true
        schema:
          type: string
      - name: extensionName
        in: path
        description: Extension name
        required: true
        schema:
          type: string
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                status: sent
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '401':
          description: Unauthorized, the access token does not belong to the service
            account of the extension
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Space/Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2: []
    put:
      tags:
      - Documents
      summary: Create/Update document status of extension
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Create/Update document status of a specific extension (connector).'
      operationId: replaceDocumentStatusOfExtensionV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: extensionNameSpace
        in: path
        description: Extension namespace
        required: true
        schema:
          type: string
      - name: extensionName
        in: path
        description: Extension name
        required: true
        schema:
          type: string
      requestBody:
        description: Document status specific to the given extension
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/JsonBMap'
            example:
              status: sent
        required: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                status: sent
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '401':
          description: Unauthorized, the access token does not belong to the service
            account of the extension
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Space/Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2: []
    patch:
      tags:
      - Documents
      summary: Update document status of extension
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update document status of a specific extension (connector) with json
        patch operations.'
      operationId: updateDocumentStatusOfExtensionV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: extensionNameSpace
        in: path
        description: Extension namespace
        required: true
        schema:
          type: string
      - name: extensionName
        in: path
        description: Extension name
        required: true
        schema:
          type: string
      requestBody:
        description: Json-patch operations to apply to document status
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: add
              path: /sbdhInstanceIdentifiers
              value:
              - 12345_118e3040-51d2-11e3-8f96-0800200c9a66
        required: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                status: sent
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '401':
          description: Unauthorized, the access token does not belong to the service
            account of the extension
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Space/Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2: []
  ? /transaction/v2/spaces/{spaceId}/documents/{documentId}/validationData/spaceExtensions/{extensionNameSpace}/{extensionName}
  : get:
      tags:
      - Documents
      summary: Get document validation data
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get document’s validation data of a specific extension (connector).'
      operationId: getDocumentValidationDataOfExtensionV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: extensionNameSpace
        in: path
        description: Extension namespace
        required: true
        schema:
          type: string
      - name: extensionName
        in: path
        description: Extension name
        required: true
        schema:
          type: string
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                status: COMPLETED
                validationId: 00000001-0000-0000-0000-000000000000
                results:
                  ocr.confidence:
                    level: ERROR
                    locations:
                    - type: field
                      path: dueDate
                      parameters:
                        confidence: 0.75
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '401':
          description: Unauthorized, the access token does not belong to the service
            account of the extension
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Space/Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2: []
    put:
      tags:
      - Documents
      summary: Create/update document validation data.
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Create/Update document’s validation data of a specific extension (connector).'
      operationId: replaceDocumentValidationDataOfExtensionV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: extensionNameSpace
        in: path
        description: Extension namespace
        required: true
        schema:
          type: string
      - name: extensionName
        in: path
        description: Extension name
        required: true
        schema:
          type: string
      requestBody:
        description: New value for the document validation data specific to the given
          extension
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/JsonBMap'
            example:
              status: COMPLETED
              validationId: 00000001-0000-0000-0000-000000000000
              results:
                ocr.confidence:
                  level: ERROR
                  locations:
                  - type: field
                    path: dueDate
                    parameters:
                      confidence: 0.75
        required: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                status: COMPLETED
                validationId: 00000001-0000-0000-0000-000000000000
                results:
                  ocr.confidence:
                    level: ERROR
                    locations:
                    - type: field
                      path: dueDate
                      parameters:
                        confidence: 0.75
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '401':
          description: Unauthorized, the access token does not belong to the service
            account of the extension
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Space/Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2: []
    patch:
      tags:
      - Documents
      summary: Update document validation data
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update document’s validation data of a specific extension (connector)
        with json patch operations.'
      operationId: updateDocumentValidationDataOfExtensionV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: extensionNameSpace
        in: path
        description: Extension namespace
        required: true
        schema:
          type: string
      - name: extensionName
        in: path
        description: Extension name
        required: true
        schema:
          type: string
      requestBody:
        description: Json-patch operations to apply to validation data
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: replace
              path: /validationId
              value: 00000001-0000-0000-0000-000000000000
        required: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                status: COMPLETED
                validationId: 00000001-0000-0000-0000-000000000000
                results:
                  ocr.confidence:
                    level: ERROR
                    locations:
                    - type: field
                      path: dueDate
                      parameters:
                        confidence: 0.75
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '401':
          description: Unauthorized, the access token does not belong to the service
            account of the extension
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Space/Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2: []
components:
  schemas:
    AllowanceCharge:
      type: object
      properties:
        baseAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        netAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        percentage:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
      required:
      - netAmount
    AllowanceChargeInput:
      type: object
      properties:
        baseAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        netAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        percentage:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
    DocumentAllowanceCharge:
      type: object
      properties:
        baseAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        netAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        percentage:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        vatCategory:
          type: string
          enum:
          - S
          - L
          - M
          - Z
          - AE
          - K
          - G
          - O
          - E
        vatPercentage:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
      required:
      - netAmount
      - vatCategory
      - vatPercentage
    DocumentAllowanceChargeInput:
      type: object
      properties:
        baseAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        netAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        percentage:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        vatCategory:
          type: string
          enum:
          - S
          - L
          - M
          - Z
          - AE
          - K
          - G
          - O
          - E
        vatPercentage:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
    DocumentCalculationRequest:
      type: object
      properties:
        lines:
          type: array
          items:
            $ref: '#/components/schemas/LineInput'
        metadata:
          $ref: '#/components/schemas/DocumentMetadataInput'
        options:
          $ref: '#/components/schemas/Options'
      required:
      - lines
      - metadata
    DocumentCalculationResponse:
      type: object
      properties:
        lines:
          type: array
          items:
            $ref: '#/components/schemas/Line'
        metadata:
          $ref: '#/components/schemas/DocumentMetadata'
      required:
      - lines
      - metadata
    DocumentMetadata:
      type: object
      properties:
        allowances:
          type: array
          items:
            $ref: '#/components/schemas/DocumentAllowanceCharge'
        charges:
          type: array
          items:
            $ref: '#/components/schemas/DocumentAllowanceCharge'
        documentTotals:
          $ref: '#/components/schemas/DocumentTotals'
        vatDetails:
          type: array
          items:
            $ref: '#/components/schemas/DocumentVatDetails'
      required:
      - allowances
      - charges
      - documentTotals
      - vatDetails
    DocumentMetadataInput:
      type: object
      properties:
        allowances:
          type: array
          items:
            $ref: '#/components/schemas/DocumentAllowanceChargeInput'
        charges:
          type: array
          items:
            $ref: '#/components/schemas/DocumentAllowanceChargeInput'
        documentTotals:
          $ref: '#/components/schemas/DocumentTotalsInput'
        vatDetails:
          type: array
          items:
            $ref: '#/components/schemas/DocumentVatDetailsInput'
    DocumentNumberResult:
      type: object
      properties:
        documentNumber:
          type: string
          minLength: 1
      required:
      - documentNumber
    DocumentTotals:
      type: object
      properties:
        allowancesNetAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        chargesNetAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        grossAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        linesNetAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        netAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        payableAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        prepaidAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        roundingAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        vatAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        roundingDifference:
          type: string
      required:
      - grossAmount
      - linesNetAmount
      - netAmount
      - payableAmount
      - vatAmount
    DocumentTotalsInput:
      type: object
      properties:
        allowancesNetAmount:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        chargesNetAmount:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        grossAmount:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        linesNetAmount:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        netAmount:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        payableAmount:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        prepaidAmount:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        roundingAmount:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        vatAmount:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
    DocumentValidationActionPayload:
      type: object
      properties:
        documentId:
          type: string
          format: uuid
        spaceId:
          type: string
          format: uuid
        validationId:
          type: string
          format: uuid
      required:
      - documentId
      - spaceId
      - validationId
    DocumentVatDetails:
      type: object
      properties:
        netAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        vatAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        vatCategory:
          type: string
          enum:
          - S
          - L
          - M
          - Z
          - AE
          - K
          - G
          - O
          - E
        vatPercentage:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
      required:
      - netAmount
      - vatAmount
      - vatCategory
      - vatPercentage
    DocumentVatDetailsInput:
      type: object
      properties:
        netAmount:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        vatAmount:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        vatCategory:
          type: string
          enum:
          - S
          - L
          - M
          - Z
          - AE
          - K
          - G
          - O
          - E
        vatPercentage:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
    GenerateDocumentNumberRequest:
      type: object
      properties:
        prefix:
          type: string
    Line:
      type: object
      properties:
        metadata:
          $ref: '#/components/schemas/LineMetadata'
        netAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        pricing:
          $ref: '#/components/schemas/Pricing'
        productIdentifiers:
          $ref: '#/components/schemas/ProductIdentifiers'
        quantity:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        vatDetails:
          $ref: '#/components/schemas/VatDetail'
        unit:
          type: string
        currency:
          type: string
      required:
      - metadata
      - netAmount
      - pricing
      - productIdentifiers
      - quantity
      - vatDetails
    LineInput:
      type: object
      properties:
        metadata:
          $ref: '#/components/schemas/LineMetadataInput'
        netAmount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        pricing:
          $ref: '#/components/schemas/LinePricingInput'
        productIdentifiers:
          $ref: '#/components/schemas/ProductIdentifiers'
        quantity:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        vatDetails:
          $ref: '#/components/schemas/LineVatDetailsInput'
    LineMetadata:
      type: object
      properties:
        allowances:
          type: array
          items:
            $ref: '#/components/schemas/Allowance'
        charges:
          type: array
          items:
            $ref: '#/components/schemas/Charge'
        externalLineId:
          type: string
        buyerAccountingReference:
          type: string
        notes:
          type: array
          items:
            $ref: '#/components/schemas/Note'
        invoiceReferences:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceReference'
      required:
      - allowances
      - charges
    LineMetadataInput:
      type: object
      properties:
        allowances:
          type: array
          items:
            $ref: '#/components/schemas/AllowanceChargeInput'
        charges:
          type: array
          items:
            $ref: '#/components/schemas/AllowanceChargeInput'
    LinePricing:
      type: object
      properties:
        itemGrossPrice:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        itemNetPrice:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        itemPriceDiscount:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
        itemPriceQuantity:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
      required:
      - itemNetPrice
      - itemPriceQuantity
    LinePricingInput:
      type: object
      properties:
        itemGrossPrice:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        itemNetPrice:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        itemPriceDiscount:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        itemPriceQuantity:
          type: string
          example: '123.45'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
    LineVatDetails:
      type: object
      properties:
        vatCategory:
          type: string
          enum:
          - S
          - L
          - M
          - Z
          - AE
          - K
          - G
          - O
          - E
        vatPercentage:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
      required:
      - vatCategory
      - vatPercentage
    LineVatDetailsInput:
      type: object
      properties:
        vatCategory:
          type: string
          enum:
          - S
          - L
          - M
          - Z
          - AE
          - K
          - G
          - O
          - E
        vatPercentage:
          type: string
          example: '123.45'
          pattern: ^[0-9]+(\.[0-9]+)?$
    Options:
      type: object
      properties:
        allowCorrections:
          type: boolean
        baseLineDescription:
          type: string
        recreateInvoiceLines:
          type: boolean
    ProblemDetail:
      type: object
      properties:
        detail:
          type: string
        instance:
          type: string
          format: uri
        properties:
          type: object
          additionalProperties:
            type: object
        status:
          type: integer
          format: int32
        title:
          type: string
        type:
          type: string
          format: uri
    ProductIdentifiers:
      type: object
      properties:
        itemCategory:
          type: string
        itemDescription:
          type: string
        itemId:
          type: string
        itemName:
          type: string
    AccountIdentifier:
      type: object
      properties:
        bank:
          $ref: '#/components/schemas/BankIdentifier'
        country:
          type: string
          example: BE
          pattern: ^[a-zA-Z]{2}
        currency:
          type: string
          description: International code ISO 4217 of the currency used
          example: EUR
          pattern: '[A-Z]{3}'
        identifier:
          type: string
          description: Account Identifier
          example: BE83504010119715
          minLength: 1
        parent:
          $ref: '#/components/schemas/AccountIdentifier'
        scheme:
          type: string
          description: Account Scheme
          example: IBAN
      required:
      - currency
      - identifier
      - scheme
    ActionExecuteRequest:
      type: object
      properties:
        data:
          type: object
          additionalProperties:
            type: object
        documents:
          type: array
          items:
            type: string
            format: uuid
          minItems: 1
        spaceId:
          type: string
          format: uuid
        subject:
          type: string
          format: uuid
      required:
      - documents
      - spaceId
    ActionExecuteRequestBody:
      type: object
      properties:
        data:
          type: object
          additionalProperties:
            type: object
        documents:
          type: array
          items:
            type: string
            format: uuid
          minItems: 1
        spaceId:
          type: string
          format: uuid
      required:
      - documents
      - spaceId
    ActionExecuteResponse:
      type: object
      properties:
        action:
          type: array
          description: Side-effect(s) to perform after the action.
          items:
            $ref: '#/components/schemas/ActionSideEffect'
        documents:
          type: array
          items:
            $ref: '#/components/schemas/DocumentStatus'
          minItems: 1
      required:
      - documents
    ActionSideEffect:
      type: object
      description: Side-effect(s) to perform after the action.
      properties:
        actionType:
          type: string
          enum:
          - NONE
          - REDIRECT
          - OPEN_DOCUMENT
          - CLOSE_DOCUMENT
          - DETAILED_TOAST
        documentId:
          type: string
          format: uuid
        spaceId:
          type: string
          format: uuid
        url:
          type: string
    BankIdentifier:
      type: object
      description: Information about the issuer of the account
      properties:
        identifier:
          type: string
          description: Bank Identifier
          example: PANXBEB1XXX
          minLength: 1
        scheme:
          type: string
          description: Bank Identifier Scheme
          enum:
          - BIC
          - CODE
          - ABA
          - CLABE
          - THIRD_PARTY
          example: BIC
      required:
      - identifier
      - scheme
    CancelDocumentActionData:
      type: object
      properties:
        comment:
          type: string
    CloneDocumentActionData:
      type: object
      properties:
        copyAttachments:
          type: boolean
    ConfigureDocumentProcessorRequest:
      type: object
      properties:
        extensionId:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
        namespace:
          type: string
          minLength: 1
        settings:
          $ref: '#/components/schemas/DocumentProcessorSettings'
        spaceId:
          type: string
          format: uuid
      required:
      - extensionId
      - name
      - namespace
      - settings
      - spaceId
    ConvertDocumentRequest:
      type: object
      properties:
        additionalRepresentations:
          type: array
          items:
            type: string
        fileId:
          type: string
          format: uuid
        spaceId:
          type: string
          format: uuid
      required:
      - fileId
      - spaceId
    CreateDocumentNumberRequest:
      type: object
      properties:
        seriesId:
          type: string
          format: uuid
    CreateDocumentNumberSeriesRequest:
      type: object
      properties:
        name:
          type: string
          maxLength: 2147483647
          minLength: 1
        pattern:
          type: string
    CreateDocumentNumberSeriesResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
        pattern:
          type: string
      required:
      - id
      - name
    CreateDocumentRepresentationLinkRequest:
      type: object
      properties:
        validUntil:
          type: string
          format: date-time
      required:
      - validUntil
    CustomizableFlipDocumentActionData:
      type: object
      properties:
        copyAttachments:
          type: boolean
        targetCategory:
          type: string
          enum:
          - PURCHASE_ORDER
          - ORDER_CONFIRMATION
          - DELIVERY_NOTE
          - GOODS_RECEIVED_NOTE
          - INVOICE
          - INVOICE_REMINDER
          - CREDIT_NOTE
          - RECEIPT
          - STATEMENT
          - QUOTE
          - CREDIT_CARD_STATEMENT
          - THIRD_PARTY_STATEMENT
          - FILE
          - SELF_BILLED_INVOICE
          - SELF_BILLED_CREDIT_NOTE
          - PROFORMA_INVOICE
          - OTHER
    Data:
      type: object
      properties:
        dryRun:
          type: boolean
      required:
      - dryRun
    DataExtractionMetadata:
      type: object
      properties:
        fileId:
          type: string
          format: uuid
      required:
      - fileId
    DataExtractionResult:
      type: object
      properties:
        extractedDocumentLines:
          type: array
          items:
            type: object
            additionalProperties:
              type: object
        extractedDocumentMetadata:
          type: object
          additionalProperties:
            type: object
        extractionId:
          type: string
          minLength: 1
        metadata:
          $ref: '#/components/schemas/DataExtractionMetadata'
        status:
          type: string
          enum:
          - SUCCESS
          - FAILED
      required:
      - extractedDocumentLines
      - extractedDocumentMetadata
      - extractionId
      - metadata
      - status
    DocumentActionRequestCloneDocumentActionData:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/CloneDocumentActionData'
        documents:
          type: array
          items:
            type: string
            format: uuid
          minItems: 1
        spaceId:
          type: string
          format: uuid
      required:
      - data
      - documents
      - spaceId
    DocumentActionRequestCustomizableFlipDocumentActionData:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/CustomizableFlipDocumentActionData'
        documents:
          type: array
          items:
            type: string
            format: uuid
          minItems: 1
        spaceId:
          type: string
          format: uuid
      required:
      - data
      - documents
      - spaceId
    DocumentActionRequestFlipDocumentActionData:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/FlipDocumentActionData'
        documents:
          type: array
          items:
            type: string
            format: uuid
          minItems: 1
        spaceId:
          type: string
          format: uuid
      required:
      - data
      - documents
      - spaceId
    DocumentActionRequestRefuseDocumentActionData:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/RefuseDocumentActionData'
        documents:
          type: array
          items:
            type: string
            format: uuid
          minItems: 1
        spaceId:
          type: string
          format: uuid
      required:
      - data
      - documents
      - spaceId
    DocumentActionRequestWithoutData:
      type: object
      properties:
        documents:
          type: array
          items:
            type: string
            format: uuid
          minItems: 1
        spaceId:
          type: string
          format: uuid
      required:
      - documents
      - spaceId
    DocumentActionResponse:
      type: object
      properties:
        failure:
          type: array
          items:
            type: string
            format: uuid
        success:
          type: array
          items:
            type: string
            format: uuid
      required:
      - success
    DocumentCategoryNumberSeriesInfo:
      type: object
      properties:
        defaultSeriesId:
          type: string
          minLength: 1
        series:
          type: array
          items:
            $ref: '#/components/schemas/DocumentNumberSeriesInfo'
      required:
      - defaultSeriesId
      - series
    DocumentCategorySettings:
      type: object
    DocumentData:
      type: object
      properties:
        data:
          type: object
          additionalProperties:
            type: object
        documentId:
          type: string
          format: uuid
    DocumentFailureValidationInitiationResult:
      type: object
      properties:
        documentId:
          type: string
          format: uuid
        message:
          type: string
    DocumentNumberSeriesInfo:
      type: object
      properties:
        id:
          type: string
          format: uuid
        lastUsedAt:
          type: string
          format: date
        lastUsedDocumentNumber:
          type: string
        name:
          type: string
          minLength: 1
        nextSequenceNumber:
          type: integer
          format: int64
        pattern:
          type: string
      required:
      - id
      - name
    DocumentNumbersResponse:
      type: object
      properties:
        categories:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DocumentCategoryNumberSeriesInfo'
      required:
      - categories
    DocumentProcessorSettings:
      type: object
      properties:
        autoSetDocumentDate:
          type: boolean
        availableBankAccounts:
          type: array
          items:
            $ref: '#/components/schemas/AccountIdentifier'
        defaultBankAccount:
          $ref: '#/components/schemas/AccountIdentifier'
        defaultCurrency:
          type: object
          properties:
            currencyCode:
              type: string
            defaultFractionDigits:
              type: integer
              format: int32
            displayName:
              type: string
            numericCode:
              type: integer
              format: int32
            numericCodeAsString:
              type: string
            symbol:
              type: string
        document:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DocumentCategorySettings'
        externalApprovalPurchase:
          type: boolean
        ocr:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/OcrFolderSettings'
      required:
      - defaultCurrency
      - document
      - ocr
    DocumentRepresentation:
      type: object
      properties:
        contentType:
          type: string
          minLength: 1
        createdAt:
          type: string
          format: date-time
        documentId:
          type: string
          format: uuid
        filename:
          type: string
          minLength: 1
        id:
          type: string
          format: uuid
        main:
          type: boolean
        md5Hash:
          type: string
          minLength: 1
        metadata:
          type: object
          additionalProperties:
            type: object
        original:
          type: boolean
        size:
          type: string
          minLength: 1
        status:
          type: string
          minLength: 1
        type:
          type: string
          minLength: 1
          x-extensible-enum:
          - com.unifiedpost.btx.datastore.json
          - com.unifiedpost.btx.datastore.json:invoice
          - com.unifiedpost.btx.datastore.json:invoice:2.0
          - com.unifiedpost.btx.datastore.json:creditnote
          - com.unifiedpost.btx.datastore.json:creditnote:2.0
          - com.unifiedpost.btx.aggregation.json
          - com.unifiedpost.btx.aggregation.json:base
          - com.unifiedpost.btx.aggregation.json:base:1.0
          - com.unifiedpost.btx.aggregation.json:emr
          - com.unifiedpost.btx.aggregation.json:emr:1.0
          - com.unifiedpost.btx.aggregation.pdf:emr
          - com.unifiedpost.btx.aggregation.pdf:emr:1.0
          - com.unifiedpost.btx.pdf
          - com.unifiedpost.btx.pdf:invoice
          - com.unifiedpost.btx.pdf:invoice:1.0
          - com.unifiedpost.btx.pdf:creditnote
          - com.unifiedpost.btx.pdf:creditnote:1.0
          - com.unifiedpost.btx.pdf:receipt
          - com.unifiedpost.btx.pdf:receipt:1.0
          - com.unifiedpost.btx.pdf:quote
          - com.unifiedpost.btx.pdf:quote:1.0
          - eu.cen.en16931
          - eu.cen.en16931:cii
          - eu.cen.en16931:cii:1.3.12
          - eu.cen.en16931:cii:1.3.13
          - eu.cen.en16931:ubl-creditnote
          - eu.cen.en16931:ubl-creditnote:1.3.12
          - eu.cen.en16931:ubl
          - eu.cen.en16931:ubl:1.3.12
          - eu.peppol.bis3
          - eu.peppol.bis3:creditnote
          - eu.peppol.bis3:creditnote:2024.5
          - eu.peppol.bis3:creditnote:2024.11
          - eu.peppol.bis3:invoice
          - eu.peppol.bis3:invoice:2024.5
          - eu.peppol.bis3:invoice:2024.11
          - fr.factur-x
          - fr.factur-x:en16931
          - fr.factur-x:en16931:1.0.6
          - fr.factur-x:en16931:1.0.7-2
          - fr.factur-x:basic
          - fr.factur-x:basic:1.0.6
          - fr.factur-x:basic:1.0.7-2
          - fr.factur-x:minimum
          - fr.factur-x:minimum:1.0.6
          - fr.factur-x:minimum:1.0.7-2
          - fr.factur-x:basicwl
          - fr.factur-x:basicwl:1.0.6
          - fr.factur-x:basicwl:1.0.7-2
          - fr.factur-x:extended
          - fr.factur-x:extended:1.0.6
          - fr.factur-x:extended:1.0.7-2
          - fr.einvoicingextract:base:1.0.7-2
          - fr.ctc:ubl-invoice
          - fr.ctc:ubl-invoice:1.3
          - fr.ctc:ubl-creditnote
          - fr.ctc:ubl-creditnote:1.3
          - fr.ctc:extended-ubl-invoice
          - fr.ctc:extended-ubl-invoice:1.3
          - fr.ctc:extended-ubl-creditnote
          - fr.ctc:extended-ubl-creditnote:1.3
          - fr.ctc:factur-x-en16931
          - fr.ctc:factur-x-en16931:1.3
          - fr.ctc:factur-x-extended
          - fr.ctc:factur-x-extended:1.3
          - fr.ctc:cii
          - fr.ctc:cii:1.3
          - fr.ctc:extended-cii
          - fr.ctc:extended-cii:1.3
          - fr.ctc:cdar
          - fr.ctc:cdar:1.3
          - org.iso20022
          - org.iso20022:camt
          - org.iso20022:camt:053.001.02
          - be.efff
          - be.efff:creditnote
          - be.efff:creditnote:3.0.0
          - be.efff:invoice
          - be.efff:invoice:3.0.0
          - org.cfonb
          - org.cfonb:cfonb
          - be.febelfin:coda:2.6
          - es.aebanca
          - es.aebanca:norma
          - es.aebanca:norma:43
        updatedAt:
          type: string
          format: date-time
        uploadUrl:
          type: string
          minLength: 1
      required:
      - contentType
      - createdAt
      - documentId
      - filename
      - id
      - main
      - md5Hash
      - metadata
      - original
      - size
      - status
      - type
      - updatedAt
      - uploadUrl
    DocumentRepresentationContentLinkResponse:
      type: object
      properties:
        link:
          type: string
          minLength: 1
      required:
      - link
    DocumentStatus:
      type: object
      properties:
        documentId:
          type: string
          format: uuid
        errorCode:
          type: string
        message:
          type: string
        status:
          type: string
    DocumentValidationInitiationResult:
      type: object
      properties:
        documentId:
          type: string
          format: uuid
    DocumentValidationRequest:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Data'
        documentIds:
          type: array
          items:
            type: string
            format: uuid
          minItems: 1
        spaceId:
          type: string
          format: uuid
        subjectId:
          type: string
          format: uuid
      required:
      - data
      - documentIds
      - spaceId
    DocumentValidationResponse:
      type: object
      properties:
        failure:
          type: array
          items:
            $ref: '#/components/schemas/DocumentFailureValidationInitiationResult'
        success:
          type: array
          items:
            $ref: '#/components/schemas/DocumentValidationInitiationResult'
      required:
      - failure
      - success
    DocumentVersioningResponse:
      type: object
      properties:
        category:
          type: string
        folder:
          type: string
        id:
          type: string
          format: uuid
        metadata:
          type: object
          additionalProperties:
            type: object
        retentionTime:
          type: string
          format: date-time
        source:
          type: string
        spaceId:
          type: string
          format: uuid
        status:
          type: object
          additionalProperties:
            type: object
        tags:
          type: array
          items:
            type: string
      required:
      - category
      - folder
      - id
      - source
      - spaceId
      - status
    ExtensionAddRequest:
      type: object
      properties:
        entityId:
          type: string
          format: uuid
        extensionId:
          type: string
          format: uuid
        spaceId:
          type: string
          format: uuid
      required:
      - entityId
      - extensionId
      - spaceId
    ExtensionUpgradeRequest:
      type: object
      properties:
        entityId:
          type: string
          format: uuid
        extensionId:
          type: string
          format: uuid
        spaceId:
          type: string
          format: uuid
      required:
      - entityId
      - extensionId
      - spaceId
    ExternalApprovalSettingsRequest:
      type: object
      properties:
        purchases:
          type: boolean
      required:
      - purchases
    FileRequest:
      type: object
      properties:
        attachments:
          type: array
          items:
            type: string
            format: uuid
        category:
          type: string
          enum:
          - PURCHASE_ORDER
          - ORDER_CONFIRMATION
          - DELIVERY_NOTE
          - GOODS_RECEIVED_NOTE
          - INVOICE
          - INVOICE_REMINDER
          - CREDIT_NOTE
          - RECEIPT
          - STATEMENT
          - QUOTE
          - CREDIT_CARD_STATEMENT
          - THIRD_PARTY_STATEMENT
          - FILE
          - SELF_BILLED_INVOICE
          - SELF_BILLED_CREDIT_NOTE
          - PROFORMA_INVOICE
          - OTHER
        fileId:
          type: string
          format: uuid
        filename:
          type: string
          description: file name
          example: legal_xml.xml
        description:
          type: string
          description: description
          example: The file for document DOC-1
        creatorSubject:
          type: string
          description: creator subject. It is required if creator type is provided
          example: 00000001-0001-0001-0001-000000000000
        creatorType:
          type: string
          description: creator type. It is required if creator subject is provided
          example: user
        retentionTime:
          type: string
          description: retention time
          format: date-time
          example: 2129-01-14 19:58:47+00:00
        fileSize:
          type: integer
          description: file size
          format: int32
          example: 1024
        fileType:
          type: string
          description: file type
          example: xml
        contentType:
          type: string
          description: content type
          example: application/xml
        source:
          type: string
          description: source
          example: com.unifiedpost.btx.connectors:peppol
        parentFileId:
          type: string
          description: parent file id
          format: uuid
          example: b8536327-4c29-4280-9da2-aa190e8484b7
        tags:
          type: array
          description: tags
          example:
          - tag1
          - tag2
          items:
            type: string
            description: tags
            example: '["tag1","tag2"]'
        metadata:
          $ref: '#/components/schemas/JsonBMap'
      required:
      - attachments
      - fileId
      - contentType
      - fileType
      - filename
    FlipDocumentActionData:
      type: object
      properties:
        copyAttachments:
          type: boolean
    GetOrCreateRepresentationRequest:
      type: object
      properties:
        documentType:
          type: string
          x-extensible-enum:
          - com.unifiedpost.btx.datastore.json
          - com.unifiedpost.btx.datastore.json:invoice
          - com.unifiedpost.btx.datastore.json:invoice:2.0
          - com.unifiedpost.btx.datastore.json:creditnote
          - com.unifiedpost.btx.datastore.json:creditnote:2.0
          - com.unifiedpost.btx.aggregation.json
          - com.unifiedpost.btx.aggregation.json:base
          - com.unifiedpost.btx.aggregation.json:base:1.0
          - com.unifiedpost.btx.aggregation.json:emr
          - com.unifiedpost.btx.aggregation.json:emr:1.0
          - com.unifiedpost.btx.aggregation.pdf:emr
          - com.unifiedpost.btx.aggregation.pdf:emr:1.0
          - com.unifiedpost.btx.pdf
          - com.unifiedpost.btx.pdf:invoice
          - com.unifiedpost.btx.pdf:invoice:1.0
          - com.unifiedpost.btx.pdf:creditnote
          - com.unifiedpost.btx.pdf:creditnote:1.0
          - com.unifiedpost.btx.pdf:receipt
          - com.unifiedpost.btx.pdf:receipt:1.0
          - com.unifiedpost.btx.pdf:quote
          - com.unifiedpost.btx.pdf:quote:1.0
          - eu.cen.en16931
          - eu.cen.en16931:cii
          - eu.cen.en16931:cii:1.3.12
          - eu.cen.en16931:cii:1.3.13
          - eu.cen.en16931:ubl-creditnote
          - eu.cen.en16931:ubl-creditnote:1.3.12
          - eu.cen.en16931:ubl
          - eu.cen.en16931:ubl:1.3.12
          - eu.peppol.bis3
          - eu.peppol.bis3:creditnote
          - eu.peppol.bis3:creditnote:2024.5
          - eu.peppol.bis3:creditnote:2024.11
          - eu.peppol.bis3:invoice
          - eu.peppol.bis3:invoice:2024.5
          - eu.peppol.bis3:invoice:2024.11
          - fr.factur-x
          - fr.factur-x:en16931
          - fr.factur-x:en16931:1.0.6
          - fr.factur-x:en16931:1.0.7-2
          - fr.factur-x:basic
          - fr.factur-x:basic:1.0.6
          - fr.factur-x:basic:1.0.7-2
          - fr.factur-x:minimum
          - fr.factur-x:minimum:1.0.6
          - fr.factur-x:minimum:1.0.7-2
          - fr.factur-x:basicwl
          - fr.factur-x:basicwl:1.0.6
          - fr.factur-x:basicwl:1.0.7-2
          - fr.factur-x:extended
          - fr.factur-x:extended:1.0.6
          - fr.factur-x:extended:1.0.7-2
          - fr.einvoicingextract:base:1.0.7-2
          - fr.ctc:ubl-invoice
          - fr.ctc:ubl-invoice:1.3
          - fr.ctc:ubl-creditnote
          - fr.ctc:ubl-creditnote:1.3
          - fr.ctc:extended-ubl-invoice
          - fr.ctc:extended-ubl-invoice:1.3
          - fr.ctc:extended-ubl-creditnote
          - fr.ctc:extended-ubl-creditnote:1.3
          - fr.ctc:factur-x-en16931
          - fr.ctc:factur-x-en16931:1.3
          - fr.ctc:factur-x-extended
          - fr.ctc:factur-x-extended:1.3
          - fr.ctc:cii
          - fr.ctc:cii:1.3
          - fr.ctc:extended-cii
          - fr.ctc:extended-cii:1.3
          - fr.ctc:cdar
          - fr.ctc:cdar:1.3
          - org.iso20022
          - org.iso20022:camt
          - org.iso20022:camt:053.001.02
          - be.efff
          - be.efff:creditnote
          - be.efff:creditnote:3.0.0
          - be.efff:invoice
          - be.efff:invoice:3.0.0
          - org.cfonb
          - org.cfonb:cfonb
          - be.febelfin:coda:2.6
          - es.aebanca
          - es.aebanca:norma
          - es.aebanca:norma:43
        excludeAttachments:
          type: boolean
      required:
      - documentType
    HitlFeedbackPayload:
      type: object
      properties:
        error:
          type: array
          items:
            type: string
        id:
          type: string
          minLength: 1
        status:
          type: string
          minLength: 1
      required:
      - error
      - id
      - status
    InitializationResponse:
      type: object
      properties:
        documents:
          type: array
          items:
            $ref: '#/components/schemas/DocumentData'
    JsonNode:
      type: object
    ListActionsResponse:
      type: object
      properties:
        actions:
          type: array
          items:
            type: object
            additionalProperties:
              type: object
      required:
      - actions
    OcrFolderSettings:
      type: object
    PluginAuthorizationRequest:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/JsonNode'
        name:
          type: string
          maxLength: 256
          minLength: 1
        namespace:
          type: string
          maxLength: 256
          minLength: 1
        operation:
          type: string
          maxLength: 256
          minLength: 1
        pluginId:
          type: string
        subject:
          type: string
          maxLength: 256
          minLength: 1
        version:
          type: string
          pattern: \d+(\.\d+){0,2}
      required:
      - name
      - namespace
      - operation
      - subject
      - version
    ProcessDocumentRequest:
      type: object
      properties:
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileRequest'
        parentId:
          type: string
          format: uuid
        spaceId:
          type: string
          format: uuid
      required:
      - files
      - spaceId
    ProcessDocumentResponse:
      type: object
      properties:
        errorMessage:
          type: string
        fileId:
          type: string
          format: uuid
        status:
          type: string
      required:
      - fileId
      - status
    RefuseDocumentActionData:
      type: object
      properties:
        reason:
          type: string
          enum:
          - INCORRECT_VAT_RATE
          - NON_COMPLIANT
          - INCORRECT_RECIPIENT
          - UNKNOWN_TRANSACTION
          - UNKNOWN_ISSUER
          - CONTRACT_TERMINATED
          - DUPLICATE_INVOICE
          - INVALID_ORDER_NUMBER
          - MISSING_REFERENCE
    TaskInitializationRequest:
      type: object
      properties:
        documents:
          type: array
          items:
            type: string
            format: uuid
          minItems: 1
        spaceId:
          type: string
          format: uuid
        subject:
          type: string
          format: uuid
      required:
      - documents
      - spaceId
    UpdateDocumentNumberSeriesRequest:
      type: object
      properties:
        name:
          type: string
          maxLength: 2147483647
          minLength: 1
        nextSequenceNumber:
          type: integer
          format: int64
        pattern:
          type: string
    UpdateDocumentNumberSeriesResponse:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        nextSequenceNumber:
          type: integer
          format: int64
        pattern:
          type: string
      required:
      - name
    ValidatorDocumentValidationRequest:
      type: object
      properties:
        documentId:
          type: string
          format: uuid
        dryRun:
          type: boolean
        spaceId:
          type: string
          format: uuid
        validationId:
          type: string
          format: uuid
      required:
      - documentId
      - spaceId
      - validationId
    DataExtractionOriginalCallback:
      type: object
      properties:
        endpoint:
          type: string
          minLength: 1
        headers:
          type: object
          additionalProperties:
            type: string
      required:
      - endpoint
    DocAiFeedback:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
    DocAiProcessFeedback:
      type: object
      properties:
        docai_values:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DocAiValue'
        error:
          type: string
        external_uuid:
          type: string
        feedback:
          $ref: '#/components/schemas/DocAiFeedback'
        id:
          type: string
        ocr_type:
          type: string
        original_docai_uri:
          type: string
        partner_uuid:
          type: string
        status:
          type: string
        transformed_docai_uri:
          type: string
      required:
      - id
      - partner_uuid
      - status
    DocAiValue:
      type: object
      properties:
        boolValue:
          type: boolean
        confidence:
          type: number
          format: double
        listValue:
          type: array
          items:
            $ref: '#/components/schemas/DocAiValue'
        mapValue:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DocAiValue'
        numberValue:
          type: number
          format: double
        stringValue:
          type: string
    ExtractFileDataRequest:
      type: object
      properties:
        callback:
          $ref: '#/components/schemas/DataExtractionOriginalCallback'
        context:
          type: object
          additionalProperties:
            type: object
        fileContentUri:
          type: string
          minLength: 1
        metadata:
          $ref: '#/components/schemas/DataExtractionMetadata'
      required:
      - callback
      - fileContentUri
      - metadata
    ExtractFileDataResponse:
      type: object
      properties:
        extractionId:
          type: string
          minLength: 1
      required:
      - extractionId
    DocumentValidateRequest:
      required:
      - inputUrl
      type: object
      properties:
        inputUrl:
          minLength: 1
          type: string
          description: The validation profile that should be applied to validate the
            input document
        validationProfile:
          type: string
          description: The validation profile that should be applied to validate the
            input document
    DocumentValidateResponse:
      required:
      - documentType
      type: object
      properties:
        errors:
          type: array
          items:
            type: string
        warnings:
          type: array
          items:
            type: string
        status:
          type: string
        documentType:
          minLength: 1
          type: string
        namespace:
          type: string
        profile:
          type: string
    ApiErrorProblemDetail:
      required:
      - error
      - requestId
      - timestamp
      type: object
      properties:
        status:
          type: integer
          format: int32
        error:
          type: string
        requestId:
          type: string
        timestamp:
          type: string
          format: date-time
        type:
          type: string
          format: uri
        title:
          type: string
        detail:
          type: string
        instance:
          type: string
          format: uri
        problems:
          type: array
          items:
            $ref: '#/components/schemas/NestedProblem'
        properties:
          type: object
          additionalProperties:
            type: object
    NestedProblem:
      required:
      - detail
      - error
      - title
      type: object
      properties:
        error:
          type: string
        title:
          type: string
        detail:
          type: string
        type:
          type: string
          format: uri
    Address:
      type: object
      properties:
        streetName:
          type: string
          description: The street name
        house:
          type: string
          description: The house number
        buildingNumber:
          type: string
          description: The build number
        level:
          type: string
          description: The level of the building
        postCode:
          type: string
          description: The postal code
        city:
          type: string
          description: The city name
        state:
          type: string
          description: The state name
        room:
          type: string
        postBox:
          type: string
        townName:
          type: string
        country:
          type: string
          description: The country name
        countryCode:
          pattern: ^[a-zA-Z]{2}$
          type: string
          description: The country code
        department:
          type: string
        floor:
          type: string
      description: Address JSON schema
    Albania:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          al:vat:
            type: string
    Allowance:
      type: object
      properties:
        netAmount:
          type: string
        baseAmount:
          type: string
        percentage:
          type: string
        vatCategory:
          type: string
        vatPercentage:
          type: string
        description:
          type: string
        reasonCode:
          type: string
    Andorra:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          ad:vat:
            type: string
    Attachment:
      type: object
      properties:
        contentType:
          type: string
          description: The mimeType of the document
        url:
          type: string
          description: The URL where the document can be downloaded
        filename:
          type: string
          description: The URL where the document can be downloaded
        description:
          type: string
          description: The URL where the document can be downloaded
      description: Attachments to be embedded in the output document
    Australia:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          au:abn:
            type: string
    Austria:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          at:vat:
            type: string
          at:gov:
            type: string
          at:kur:
            type: string
    Bank:
      type: object
      properties:
        identifier:
          type: string
        scheme:
          type: string
    Belgium:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          be:vat:
            type: string
          be:en:
            type: string
    BosniaAndHerzegovina:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          ba:vat:
            type: string
    Bulgaria:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          bg:vat:
            type: string
    Charge:
      type: object
      properties:
        netAmount:
          type: string
        baseAmount:
          type: string
        percentage:
          type: string
        vatCategory:
          type: string
        vatPercentage:
          type: string
        description:
          type: string
        reasonCode:
          type: string
    Croatia:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          hr:vat:
            type: string
    CustomCategories:
      type: object
      properties:
        purchases:
          type: array
          items:
            type: string
    Customer:
      type: object
      properties:
        legalName:
          type: string
        tradeName:
          type: string
        address:
          $ref: '#/components/schemas/Address'
        globalIdentifiers:
          $ref: '#/components/schemas/GlobalIdentifiers'
    Cyprus:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          cy:vat:
            type: string
    CzechRepublic:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          cz:vat:
            type: string
          cz:ico:
            type: string
    Delivery:
      type: object
      properties:
        name:
          type: string
        address:
          $ref: '#/components/schemas/Address'
        deliveryDate:
          type: string
    Denmark:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          dk:p:
            type: string
          dk:digst:
            type: string
          dk:erst:
            type: string
          dk:vat:
            type: string
    Document:
      type: object
      properties:
        additionalProperties:
          type: object
          additionalProperties:
            type: object
        customCategories:
          $ref: '#/components/schemas/CustomCategories'
        metadata:
          $ref: '#/components/schemas/Metadata'
        lines:
          type: array
          items:
            $ref: '#/components/schemas/Line'
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
      description: Inline BTX Json for Document. This will be omitted if inputUrl
        is present in request.
    DocumentConvertOptions:
      type: object
      properties:
        extractAttachments:
          type: boolean
          description: Extract attachments from inbound FacturX and upload to GCS.
            Only applicable for FacturX to BTX JSON conversions.
          default: false
      description: Options for controlling conversion behavior
    DocumentConvertRequest:
      required:
      - inputType
      - outputType
      - outputUrl
      type: object
      properties:
        inputType:
          type: string
          description: Type (format) of the input document
          enum:
          - com.unifiedpost.btx.datastore.json
          - com.unifiedpost.btx.datastore.json:invoice
          - eu.peppol.bis3:creditnote
          - eu.peppol.bis3:creditnote:2024.5
          - eu.peppol.bis3:invoice
          - eu.peppol.bis3:invoice:2024.5
          - fr.factur-x:en16931:1.0.6
          - fr.factur-x:basic:1.0.6
          - fr.factur-x:minimum:1.0.6
          - fr.factur-x:basicwl:1.0.6
          - fr.factur-x:extended:1.0.6
          - fr.factur-x:en16931:1.0.7-2
          - fr.factur-x:basic:1.0.7-2
          - fr.factur-x:basicwl:1.0.7-2
          - fr.factur-x:extended:1.0.7-2
          - fr.factur-x:minimum:1.0.7-2
          - fr.factur-x
          - fr.factur-x:en16931
          - fr.factur-x:basic
          - fr.factur-x:minimum
          - fr.factur-x:basicwl
          - fr.factur-x:extended
          - fr.ctc:ubl-invoice
          - fr.ctc:ubl-creditnote
          - fr.ctc:extended-ubl-invoice
          - fr.ctc:extended-ubl-creditnote
          - fr.ctc:factur-x-extended
          - fr.ctc:factur-x-extended:1.3
          - fr.ctc:factur-x-en16931
          - fr.ctc:factur-x-en16931:1.3
          - fr.ctc:cii
          - fr.ctc:extended-cii
          - fr.ctc:ubl-invoice:1.3
          - fr.ctc:ubl-creditnote:1.3
          - fr.ctc:extended-ubl-invoice:1.3
          - fr.ctc:extended-ubl-creditnote:1.3
          - fr.ctc:cii:1.3
          - fr.ctc:extended-cii:1.3
          - eu.peppol.bis3.sg.ubl
          - eu.peppol.bis3.sg.ubl:creditnote
          - eu.peppol.bis3.sg.ubl:creditnote:2023.12
          - eu.peppol.bis3.sg.ubl:invoice
          - eu.peppol.bis3.sg.ubl:invoice:2023.12
        outputType:
          minLength: 1
          type: string
          description: Target format for the conversion output
          enum:
          - eu.peppol.bis3:creditnote
          - eu.peppol.bis3:creditnote:2024.5
          - eu.peppol.bis3:invoice
          - eu.peppol.bis3:invoice:2024.5
          - be.efff:creditnote
          - be.efff:creditnote:1.0
          - be.efff:creditnote:3.0.0
          - be.efff:invoice
          - be.efff:invoice:1.0
          - be.efff:invoice:3.0.0
          - com.unifiedpost.btx.datastore.json
          - com.unifiedpost.btx.datastore.json:thirdpartystatement:2.0
          - eu.cen.en16931:cii
          - com.unifiedpost.btx.pdf
          - be.febelfin:coda:2.6
          - org.cfonb:cfonb
          - org.cfonb:cfonb:1.0
          - es.aebanca:norma:43
          - org.iso20022:camt:053.001.02
          - com.unifiedpost.btx.aggregation.json:base:1.0
          - com.unifiedpost.btx.aggregation.json:multi:1.0
          - com.unifiedpost.btx.aggregation.pdf:emr:1.0
          - com.unifiedpost.btx.pdf
          - fr.factur-x
          - fr.factur-x:en16931
          - fr.factur-x:en16931:1.0.7-2
          - fr.factur-x:basic
          - fr.factur-x:basic:1.0.7-2
          - fr.factur-x:basicwl
          - fr.factur-x:basicwl:1.0.7-2
          - fr.factur-x:extended
          - fr.factur-x:extended:1.0.7-2
          - fr.factur-x:minimum
          - fr.factur-x:minimum:1.0.7-2
          - fr.ctc:ubl-invoice
          - fr.ctc:ubl-creditnote
          - fr.ctc:extended-ubl-invoice
          - fr.ctc:extended-ubl-creditnote
          - fr.ctc:factur-x-extended
          - fr.ctc:factur-x-extended:1.3
          - fr.ctc:factur-x-en16931
          - fr.ctc:factur-x-en16931:1.3
          - fr.ctc:cii
          - fr.ctc:extended-cii
          - fr.ctc:ubl-invoice:1.3
          - fr.ctc:ubl-creditnote:1.3
          - fr.ctc:extended-ubl-invoice:1.3
          - fr.ctc:extended-ubl-creditnote:1.3
          - fr.ctc:cii:1.3
          - fr.ctc:extended-cii:1.3
          - de.zugferd:en16931
          - de.zugferd:en16931:2.3.2
          - de.zugferd:basic
          - de.zugferd:basic:2.3.2
          - de.zugferd:basicwl
          - de.zugferd:basicwl:2.3.2
          - de.zugferd:minimum
          - de.zugferd:minimum:2.3.2
          - eu.peppol.bis3.sg.ubl
          - eu.peppol.bis3.sg.ubl:creditnote
          - eu.peppol.bis3.sg.ubl:creditnote:2023.12
          - eu.peppol.bis3.sg.ubl:invoice
          - eu.peppol.bis3.sg.ubl:invoice:2023.12
          - fr.einvoicingextract:base:1.0.7-2
        inputUrl:
          pattern: ^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$
          type: string
          description: 'The URL where the original document can be downloaded. '
        input:
          $ref: '#/components/schemas/Document'
        outputUrl:
          minLength: 1
          pattern: ^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$
          type: string
          description: The URL where the converted document should be uploaded to
        attachments:
          type: array
          description: Attachments to be embedded in the output document
          items:
            $ref: '#/components/schemas/Attachment'
        options:
          $ref: '#/components/schemas/DocumentConvertOptions'
    Estonia:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          ee:vat:
            type: string
          ee:rg:
            type: string
          ee:cc:
            type: string
    Eu16:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          eu:reid:
            type: string
    Eu27:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          eu:nal:
            type: string
    Finland:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          fi:ovt2:
            type: string
          fi:vat:
            type: string
    France:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          fr:siren:
            type: string
          fr:siret:
            type: string
          fr:vat:
            type: string
    Germany:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          de:lwid:
            type: string
          de:hrn:
            type: string
          de:ste:
            type: string
          de:vat:
            type: string
          de:widnr:
            type: string
    GlobalIdentifiers:
      type: object
      properties:
        gln:
          type: string
          writeOnly: true
        global:phoneNumber:
          type: array
          items:
            type: string
        global:email:
          type: array
          items:
            type: string
        global:participantId:
          type: string
        global:gln:
          type: array
          items:
            type: string
        global:tax_number:
          type: string
        additionalProperties:
          type: object
          additionalProperties:
            type: object
      oneOf:
      - $ref: '#/components/schemas/Andorra'
      - $ref: '#/components/schemas/Albania'
      - $ref: '#/components/schemas/Austria'
      - $ref: '#/components/schemas/Australia'
      - $ref: '#/components/schemas/BosniaAndHerzegovina'
      - $ref: '#/components/schemas/Belgium'
      - $ref: '#/components/schemas/Bulgaria'
      - $ref: '#/components/schemas/Switzerland'
      - $ref: '#/components/schemas/Cyprus'
      - $ref: '#/components/schemas/CzechRepublic'
      - $ref: '#/components/schemas/Germany'
      - $ref: '#/components/schemas/Denmark'
      - $ref: '#/components/schemas/Estonia'
      - $ref: '#/components/schemas/Spain'
      - $ref: '#/components/schemas/Eu16'
      - $ref: '#/components/schemas/Eu27'
      - $ref: '#/components/schemas/Finland'
      - $ref: '#/components/schemas/France'
      - $ref: '#/components/schemas/UnitedKingdom'
      - $ref: '#/components/schemas/Greece'
      - $ref: '#/components/schemas/Croatia'
      - $ref: '#/components/schemas/Hungary'
      - $ref: '#/components/schemas/Ireland'
      - $ref: '#/components/schemas/Iceland'
      - $ref: '#/components/schemas/Italy'
      - $ref: '#/components/schemas/Japan'
      - $ref: '#/components/schemas/Liechtenstein'
      - $ref: '#/components/schemas/Lithuania'
      - $ref: '#/components/schemas/Luxembourg'
      - $ref: '#/components/schemas/Latvia'
      - $ref: '#/components/schemas/Morocco'
      - $ref: '#/components/schemas/Monaco'
      - $ref: '#/components/schemas/Montenegro'
      - $ref: '#/components/schemas/Macedonia'
      - $ref: '#/components/schemas/Malta'
      - $ref: '#/components/schemas/Malaysia'
      - $ref: '#/components/schemas/Netherlands'
      - $ref: '#/components/schemas/Norway'
      - $ref: '#/components/schemas/Poland'
      - $ref: '#/components/schemas/Portugal'
      - $ref: '#/components/schemas/Romania'
      - $ref: '#/components/schemas/Serbia'
      - $ref: '#/components/schemas/Sweden'
      - $ref: '#/components/schemas/Singapore'
      - $ref: '#/components/schemas/Slovenia'
      - $ref: '#/components/schemas/Slovakia'
      - $ref: '#/components/schemas/SanMarino'
      - $ref: '#/components/schemas/Tunisia'
      - $ref: '#/components/schemas/Turkey'
      - $ref: '#/components/schemas/UnitedStatesAmerica'
      - $ref: '#/components/schemas/HolySee'
      - $ref: '#/components/schemas/VietNam'
    Greece:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          gr:vat:
            type: string
          gr:gemi:
            type: string
    HolySee:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          va:vat:
            type: string
    Hungary:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          hu:ltn:
            type: string
          hu:vat:
            type: string
          hu:ceg:
            type: string
    Iceland:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          is:ktnr:
            type: string
    InvoiceReference:
      type: object
      properties:
        invoiceReference:
          type: string
        issueDate:
          type: string
        invoiceType:
          type: string
        invoiceNumber:
          type: string
    Ireland:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          ie:vat:
            type: string
    Italy:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          it:fti:
            type: string
          it:sia:
            type: string
          it:seceti:
            type: string
          it:cuuo:
            type: string
          it:cod:
            type: string
          it:cfi:
            type: string
          it:iva:
            type: string
    Japan:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          jp:sst:
            type: string
          jp:iin:
            type: string
    Latvia:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          lv:vat:
            type: string
          lv:urn:
            type: string
    Liechtenstein:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          li:vat:
            type: string
    Lithuania:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          lt:vat:
            type: string
          lt:lec:
            type: string
    Luxembourg:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          lu:vat:
            type: string
          lu:rcs:
            type: string
    Macedonia:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          mk:vat:
            type: string
    Malaysia:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          my:eif:
            type: string
    Malta:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          mt:vat:
            type: string
    Metadata:
      type: object
      properties:
        startDate:
          type: string
        endDate:
          type: string
        buyerAccountingReference:
          type: string
        documentNumber:
          type: string
        issueDate:
          type: string
        invoiceType:
          type: string
        currencyCode:
          type: string
        dueDate:
          type: string
        buyerReference:
          type: string
        contractReference:
          type: string
        purchaseOrderReference:
          type: string
        paymentTerms:
          type: string
        notes:
          type: array
          items:
            $ref: '#/components/schemas/Note'
        invoiceReferences:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceReference'
        supplier:
          $ref: '#/components/schemas/Supplier'
        customer:
          $ref: '#/components/schemas/Customer'
        delivery:
          $ref: '#/components/schemas/Delivery'
        prepaid:
          $ref: '#/components/schemas/Prepaid'
        paymentMeans:
          type: array
          items:
            $ref: '#/components/schemas/PaymentMean'
        allowances:
          type: array
          items:
            $ref: '#/components/schemas/Allowance'
        charges:
          type: array
          items:
            $ref: '#/components/schemas/Charge'
        documentTotals:
          $ref: '#/components/schemas/DocumentTotals'
        vatDetails:
          type: array
          items:
            $ref: '#/components/schemas/VatDetail'
        uploadId:
          type: string
        vatChargeableMethod:
          type: string
        vatAlreadyDeclared:
          type: boolean
        processControl:
          $ref: '#/components/schemas/ProcessControl'
        externalLineId:
          type: string
        supplierCategory:
          $ref: '#/components/schemas/SupplierCategory'
        profileID:
          type: string
    Monaco:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          mc:vat:
            type: string
    Montenegro:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          me:vat:
            type: string
    Morocco:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          ma:ice:
            type: string
          ma:vat:
            type: string
    Netherlands:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          nl:vat:
            type: string
          nl:kvk:
            type: string
          nl:oino:
            type: string
    Norway:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          no:org:
            type: string
          no:vat:
            type: string
    Note:
      type: object
      properties:
        code:
          type: string
        text:
          type: string
    PaymentAccount:
      type: object
      properties:
        identifier:
          type: string
        scheme:
          type: string
        country:
          type: string
        currency:
          type: string
        bank:
          $ref: '#/components/schemas/Bank'
    PaymentMandate:
      type: object
      properties:
        identifier:
          type: string
        payerFinancialAccount:
          $ref: '#/components/schemas/PaymentAccount'
    PaymentMean:
      type: object
      properties:
        code:
          type: string
        text:
          type: string
        paymentReference:
          $ref: '#/components/schemas/PaymentReference'
        paymentAccount:
          $ref: '#/components/schemas/PaymentAccount'
        paymentLink:
          type: string
        paymentMandate:
          $ref: '#/components/schemas/PaymentMandate'
    PaymentReference:
      type: object
      properties:
        value:
          type: string
        type:
          type: string
        scheme:
          type: string
    Poland:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          pl:vat:
            type: string
          pl:nip:
            type: string
          pl:regon:
            type: string
          pl:krs:
            type: string
    Portugal:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          pt:vat:
            type: string
          pt:nif:
            type: string
    Prepaid:
      type: object
      properties:
        paymentDate:
          type: string
        code:
          type: string
        text:
          type: string
        paymentReference:
          $ref: '#/components/schemas/PaymentReference'
    Pricing:
      type: object
      properties:
        itemNetPrice:
          type: string
        itemGrossPrice:
          type: string
        itemPriceQuantity:
          type: string
        itemPriceDiscount:
          type: string
    ProcessControl:
      type: object
      properties:
        businessProcess:
          type: string
    Romania:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          ro:vat:
            type: string
          ro:onr:
            type: string
    SanMarino:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          sm:vat:
            type: string
    Serbia:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          rs:vat:
            type: string
          rs:mb:
            type: string
    Singapore:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          sg:uen:
            type: string
    Slovakia:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          sk:vat:
            type: string
          sk:ico:
            type: string
    Slovenia:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          si:vat:
            type: string
    Spain:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          es:vat:
            type: string
          es:cif:
            type: string
    Supplier:
      type: object
      properties:
        legalName:
          type: string
        tradeName:
          type: string
        address:
          $ref: '#/components/schemas/Address'
        globalIdentifiers:
          $ref: '#/components/schemas/GlobalIdentifiers'
    SupplierCategory:
      type: object
      properties:
        code:
          type: string
        reason:
          type: string
    Sweden:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          se:orgnr:
            type: string
          se:vat:
            type: string
    Switzerland:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          ch:vat:
            type: string
          ch:uidb:
            type: string
    Tunisia:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          tn:uci:
            type: string
          tn:vat:
            type: string
    Turkey:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          tr:vat:
            type: string
    UnitedKingdom:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          gb:vat:
            type: string
          gb:crn:
            type: string
    UnitedStatesAmerica:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          us:ein:
            type: string
    VatDetail:
      type: object
      properties:
        vatCategory:
          type: string
        vatPercentage:
          type: string
        netAmount:
          type: string
        vatAmount:
          type: string
        exemptionReason:
          type: string
        exemptionReasonCode:
          type: string
    VietNam:
      type: object
      allOf:
      - $ref: '#/components/schemas/GlobalIdentifiers'
      - type: object
        properties:
          vn:mst:
            type: string
          vn:vat:
            type: string
    DocumentConvertResponse:
      type: object
      properties:
        inputType:
          type: string
        outputType:
          type: string
    JsonBMap:
      type: object
      additionalProperties: true
    JsonBMapNullable:
      type: object
      additionalProperties: true
      nullable: true
    PatchRequest:
      type: array
      items:
        $ref: '#/components/schemas/PatchDocument'
    PatchDocument:
      required:
      - op
      - path
      type: object
      properties:
        op:
          type: string
          description: The operation to be performed
          enum:
          - add
          - remove
          - replace
          - move
          - copy
          - test
        path:
          type: string
          description: A JSON-Pointer
        value:
          type: object
          description: The value to be used within the operations.
        from:
          type: string
          description: A string containing a JSON Pointer value.
      description: A JSONPatch document as defined by RFC 6902
    DocumentAttachmentResult:
      required:
      - contentType
      - documentId
      - fileSize
      - fileType
      - filename
      - id
      - status
      type: object
      properties:
        id:
          type: string
          description: Attachment id
          format: uuid
        documentId:
          type: string
          description: Document id
          format: uuid
        filename:
          type: string
          description: filename of the document attachment
          example: legal_xml.xml
        description:
          type: string
          description: description
          example: The attachment for document XYZ
        retentionTime:
          type: string
          description: Duration until expiration of attachment
          format: date-time
        fileSize:
          type: integer
          description: size of attachment in bytes
          format: int32
        fileType:
          type: string
          description: file type
          example: xml
        contentType:
          type: string
          description: content type
          example: application/xml
        uploadUrl:
          type: string
          description: short lived url where upload can be performed to
          example: http://path/to/file.xml
        tags:
          type: array
          description: tags
          example:
          - tag1
          - tag2
          items:
            type: string
            description: tags
            example: '["tag1","tag2"]'
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        status:
          type: string
          description: status of attachment
          example: AWAITING_UPLOAD
        createdAt:
          type: string
          description: creation datetime
          format: date-time
        updatedAt:
          type: string
          description: updated datetime
          format: date-time
    DocumentAttachmentRequest:
      required:
      - contentType
      - fileType
      - filename
      type: object
      properties:
        filename:
          type: string
          description: filename of the document attachment
          example: legal_xml.xml
        description:
          type: string
          description: description
          example: The attachment for document XYZ
        retentionTime:
          type: string
          description: Duration until expiration of attachment
          format: date-time
        fileSize:
          type: integer
          description: size of attachment in bytes
          format: int32
        fileType:
          type: string
          description: file type
          example: xml
        contentType:
          type: string
          description: content type
          example: application/xml
        tags:
          type: array
          description: tags
          example:
          - tag1
          - tag2
          items:
            type: string
            description: tags
            example: '["tag1","tag2"]'
        metadata:
          $ref: '#/components/schemas/JsonBMap'
    AllDocumentAttachmentResult:
      type: object
      properties:
        documentAttachments:
          type: array
          description: List of document attachments
          items:
            $ref: '#/components/schemas/DocumentAttachmentResult'
        totalElements:
          type: integer
          description: Total number of items in the database that correspond to this
            search criteria
          format: int64
        currentPage:
          type: integer
          description: Current page
          format: int32
        pageSize:
          type: integer
          description: Response page size
          format: int32
    DocumentAttachmentStatus:
      type: string
      description: Document attachment status
      example: AWAITING_UPLOAD
      enum:
      - AWAITING_UPLOAD
      - VIRUS_SCANNING
      - VIRUS_SCANNED
      - VIRUS_ERROR
      - PROCESSING
      - PROCESSED
      - ERROR
    UpdateDocumentAttachmentRequest:
      type: object
      properties:
        filename:
          type: string
          description: filename of the document attachment
          example: legal_xml.xml
        description:
          type: string
          description: description
          example: The attachment for document XYZ
        retentionTime:
          type: string
          description: Duration until expiration of attachment
          format: date-time
        status:
          $ref: '#/components/schemas/DocumentAttachmentStatus'
        fileSize:
          type: integer
          description: size of attachment in bytes
          format: int32
        fileType:
          type: string
          description: file type
          example: xml
        contentType:
          type: string
          description: content type
          example: application/xml
        tags:
          type: array
          description: tags
          example:
          - tag1
          - tag2
          items:
            type: string
            description: tags
            example: '["tag1","tag2"]'
        metadata:
          $ref: '#/components/schemas/JsonBMap'
    DocumentRepresentationResult:
      required:
      - main
      type: object
      properties:
        id:
          type: string
          description: id of document representation
          format: uuid
        documentId:
          type: string
          description: id of document
          format: uuid
        retentionTime:
          type: string
          description: retention time of content
          format: date-time
        type:
          type: string
          description: type of the document representation
          example: legal_xml
        filename:
          type: string
          description: filename of the document representation
          example: legal_xml.xml
        contentType:
          type: string
          description: content_type of the document representation
          example: application/xml
        size:
          type: number
          description: size of the document representation content
          example: 20
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        status:
          $ref: '#/components/schemas/RepresentationStatus'
        main:
          type: boolean
          description: whether this is the main representation of a document
        uploadUrl:
          type: string
          description: short lived url where upload can be performed to
          example: http://path/to/file.xml
        md5Hash:
          type: string
          description: md5 hashing
          example: 938c2cc0dcc05f2b68c4287040cfcf71
        createdAt:
          type: string
          description: creation datetime
          format: date-time
        updatedAt:
          type: string
          description: updated datetime
          format: date-time
        original:
          type: boolean
          description: 'True: The representation was originally uploaded by the client
            or received from a connector;False: The representation was generated based
            on the JSON representation of the document'
    RepresentationStatus:
      type: string
      description: status of representation
      example: AWAITING_UPLOAD
      enum:
      - AWAITING_UPLOAD
      - VIRUS_SCANNING
      - VIRUS_SCANNED
      - VIRUS_ERROR
      - PROCESSING
      - AWAITING_USER_ACTION
      - PROCESSED
      - REJECTED
      - ERROR
    DocumentRepresentationRequest:
      required:
      - contentType
      - filename
      - type
      type: object
      properties:
        fileSize:
          type: integer
          description: size of file in bytes
          format: int32
        retentionTime:
          type: string
          description: retention time of content
          format: date-time
        type:
          type: string
          description: type of the document representation
          example: legal_xml
        filename:
          type: string
          description: filename of the document representation
          example: legal_xml.xml
        contentType:
          type: string
          description: content_type of the document representation
          example: application/xml
        main:
          type: boolean
          description: whether this is the main representation of a document
        md5Hash:
          type: string
          description: md5 hash of a document
        original:
          type: boolean
          description: 'True: The representation was originally uploaded by the client
            or received from a connector;False: The representation was generated based
            on the JSON representation of the document'
        metadata:
          $ref: '#/components/schemas/JsonBMap'
    AllDocumentRepresentationResult:
      type: object
      properties:
        document_representations:
          type: array
          description: List of document_representations
          items:
            $ref: '#/components/schemas/DocumentRepresentationResult'
        totalElements:
          type: integer
          description: Total number of items in the database that correspond to this
            search criteria
          format: int64
        currentPage:
          type: integer
          description: Current page
          format: int32
        pageSize:
          type: integer
          description: Response page size
          format: int32
    UpdateDocumentRepresentationRequest:
      required:
      - contentType
      - fileSize
      - filename
      - type
      type: object
      properties:
        retentionTime:
          type: string
          description: retention time of content
          format: date-time
        main:
          type: boolean
          description: whether this is the main representation of a document
        type:
          type: string
          description: type of the document representation
          example: legal_xml
        fileSize:
          type: integer
          description: size of file in bytes
          format: int32
        filename:
          type: string
          description: filename of the document representation
          example: legal_xml.xml
        contentType:
          type: string
          description: content_type of the document representation
          example: application/xml
        md5Hash:
          type: string
          description: md5 hash of content
          example: 938c2cc0dcc05f2b68c4287040cfcf71
        original:
          type: boolean
          description: 'True: The representation was originally uploaded by the client
            or received from a connector;False: The representation was generated based
            on the JSON representation of the document'
        metadata:
          $ref: '#/components/schemas/JsonBMap'
    ConnectionData:
      type: object
      properties:
        displayName:
          type: string
          description: display name of supplier/customer
        id:
          type: string
          description: id of supplier/customer
          format: uuid
    DocumentResult:
      required:
      - category
      - status
      type: object
      properties:
        id:
          type: string
          description: id of document
          format: uuid
        spaceId:
          type: string
          description: Space id
          format: uuid
        description:
          type: string
          description: description of document
        source:
          type: string
          description: source of document
        folder:
          $ref: '#/components/schemas/Folder'
        supplier:
          $ref: '#/components/schemas/ConnectionData'
        customer:
          $ref: '#/components/schemas/ConnectionData'
        status:
          $ref: '#/components/schemas/JsonBMap'
        category:
          type: string
          description: 'Document category, current known values are :  PURCHASE_ORDER,
            ORDER_CONFIRMATION, DELIVERY_NOTE, GOODS_RECEIVED_NOTE, PROFORMA_INVOICE,
            INVOICE, INVOICE_REMINDER, CREDIT_NOTE, RECEIPT, STATEMENT, FILE, QUOTE,
            CREDIT_CARD_STATEMENT, THIRD_PARTY_STATEMENT, SELF_BILLED_INVOICE, SELF_BILLED_CREDIT_NOTE,
            OTHER. Future releases might contain additional new values.'
          example: INVOICE
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        tags:
          type: array
          description: tags
          items:
            type: string
            description: tags
        tasks:
          type: array
          description: tasks
          items:
            $ref: '#/components/schemas/TaskResult'
        retentionTime:
          type: string
          description: datetime of document expiry
          format: date-time
        lines:
          type: array
          description: List of line items
          items:
            $ref: '#/components/schemas/LineItemResult'
        createdAt:
          type: string
          description: creation datetime
          format: date-time
        updatedAt:
          type: string
          description: updated datetime
          format: date-time
    Folder:
      type: string
      description: Document folder
      example: PURCHASES
      enum:
      - AP
      - AR
      - PURCHASES
      - SALES
      - DRAFTS
      - INBOX
      - STATEMENTS
      - FILES
    LineItemResult:
      type: object
      properties:
        id:
          type: string
          description: Line item id
          format: uuid
        sequence:
          type: integer
          description: Sequence
          format: int32
          example: 1
        identifier:
          type: string
          description: Identifier
          example: identifier 1
        description:
          type: string
          description: Description
          example: line item 1
        itemId:
          type: string
          description: Company’s local product code
          example: item1
        itemCategory:
          type: string
          description: Item category
          example: category
        productIdentifiers:
          $ref: '#/components/schemas/JsonBMap'
        quantity:
          type: integer
          description: Quantity
          format: int32
          example: 2
        unit:
          type: string
          description: Unit
          example: PCS
        startDate:
          type: string
          description: Start date
          format: date
          example: 2024-01-23
        endDate:
          type: string
          description: End date
          format: date
          example: 2024-06-23
        discounts:
          $ref: '#/components/schemas/JsonBMap'
        charges:
          $ref: '#/components/schemas/JsonBMap'
        unitPrice:
          type: string
          description: Unit price
          example: '40.278192'
        netAmount:
          type: string
          description: Net amount
          example: '80.56'
        grossAmount:
          type: string
          description: Gross amount
          example: '96.67'
        vatAmount:
          type: string
          description: VAT amount
          example: '16.11'
        currency:
          pattern: '[A-Z]{3}'
          type: string
          description: International code ISO 4217 of the currency used
          example: EUR
        vatRate:
          type: string
          description: VAT rate
          example: '0.2'
        vatCode:
          type: string
          description: VAT code
          example: VAT
    TaskResult:
      type: object
      properties:
        extensionName:
          type: string
          description: extension name
          example: com.unifiedpost.btx.data:approve
        status:
          type: string
          description: extension status
          example: approve
        context:
          $ref: '#/components/schemas/JsonBMap'
    DocumentCategory:
      type: string
      description: Document category
      example: PURCHASE_ORDER
      enum:
      - PURCHASE_ORDER
      - ORDER_CONFIRMATION
      - DELIVERY_NOTE
      - GOODS_RECEIVED_NOTE
      - PROFORMA_INVOICE
      - INVOICE
      - INVOICE_REMINDER
      - CREDIT_NOTE
      - RECEIPT
      - STATEMENT
      - FILE
      - QUOTE
      - CREDIT_CARD_STATEMENT
      - THIRD_PARTY_STATEMENT
      - SELF_BILLED_INVOICE
      - SELF_BILLED_CREDIT_NOTE
      - OTHER
    DocumentRequest:
      required:
      - category
      - status
      type: object
      properties:
        waitForComplete:
          type: boolean
          description: Whether the document needs to wait for call to /complete endpoint,
            after representations have been uploaded
          example: true
        description:
          type: string
          description: Description of the document.
          example: This is the invoice for your new phone
        source:
          type: string
          description: Source of the document.
          example: choruspro
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        tags:
          type: array
          description: Document tags
          example:
          - expensive
          items:
            type: string
            description: Document tags
            example: '["expensive"]'
        retentionTime:
          type: string
          description: Expiry datetime for the document
        supplier:
          type: string
          description: Supplier of the document to be saved as document connection.
            Must exist and should have type supplier.
          format: uuid
          example: 4c32d3fb-0023-470c-ae21-105274a94706
        customer:
          type: string
          description: Customer of the document to be saved as document connection.
            Must exist and should have type customer.
          format: uuid
          example: 53bb63a9-9525-4f07-b29c-cdfb0c2905fd
        status:
          $ref: '#/components/schemas/JsonBMap'
        category:
          $ref: '#/components/schemas/DocumentCategory'
        lines:
          type: array
          description: List of line items
          nullable: true
          items:
            $ref: '#/components/schemas/LineItemRequest'
    LineItemRequest:
      type: object
      properties:
        identifier:
          type: string
          description: Identifier
          example: identifier 1
        description:
          type: string
          description: Description
          example: line item 1
        itemId:
          type: string
          description: Company’s local product code
          example: item1
        itemCategory:
          type: string
          description: Item category
          example: category
        productIdentifiers:
          $ref: '#/components/schemas/JsonBMap'
        quantity:
          type: integer
          description: Quantity
          format: int32
          example: 2
        unit:
          type: string
          description: Unit
          example: PCS
        startDate:
          type: string
          description: Start Date
          format: date
          example: 2024-01-23
        endDate:
          type: string
          description: End date
          format: date
          example: 2024-06-23
        discounts:
          $ref: '#/components/schemas/JsonBMap'
        charges:
          $ref: '#/components/schemas/JsonBMap'
        unitPrice:
          type: string
          description: Unit price
          example: '40.278192'
        netAmount:
          type: string
          description: Net amount
          example: '80.56'
        grossAmount:
          type: string
          description: Gross amount
          example: '96.67'
        vatAmount:
          type: string
          description: VAT amount
          example: '16.11'
        currency:
          pattern: '[A-Z]{3}'
          type: string
          description: International code ISO 4217 of the currency used
          example: EUR
        vatRate:
          type: string
          description: VAT rate
          example: '0.2'
        vatCode:
          type: string
          description: VAT code
          example: VAT
    AllDocumentResult:
      type: object
      properties:
        documents:
          type: array
          description: List of response entities
          items:
            $ref: '#/components/schemas/DocumentResult'
        totalElements:
          type: integer
          description: Total number of items in the database that correspond to this
            search criteria
          format: int64
        currentPage:
          type: integer
          description: Current page
          format: int32
        pageSize:
          type: integer
          description: Response page size
          format: int32
    AllStatusCountResult:
      required:
      - counts
      type: object
      properties:
        counts:
          type: array
          description: result of all status counts
          items:
            $ref: '#/components/schemas/StatusCountResult'
    StatusCountResult:
      required:
      - count
      - statuses
      type: object
      properties:
        statuses:
          type: array
          description: list of document statuses
          example:
          - accept:UNACCEPTED
          - pay:FULLY_PAID
          items:
            type: string
            description: list of document statuses
            example: '["accept:UNACCEPTED","pay:FULLY_PAID"]'
        count:
          type: integer
          description: count of documents having those statuses
          format: int64
          example: 5
      description: result of all status counts
    FileResult:
      type: object
      properties:
        id:
          type: string
          description: file identifier
          example: 00000003-0000-0000-0000-000000000000
        filename:
          type: string
          description: file name
          example: legal_xml.xml
        description:
          type: string
          description: description
          example: The file for document DOC-1
        creatorSubject:
          type: string
          description: creator subject
          example: 00000001-0001-0001-0001-000000000000
        creatorType:
          type: string
          description: creator type
          example: user
        retentionTime:
          type: string
          description: retention time
          format: date-time
          example: 2129-01-14 19:58:47+00:00
        status:
          $ref: '#/components/schemas/FileStatus'
        fileSize:
          type: integer
          description: file size
          format: int32
          example: 1024
        fileType:
          type: string
          description: file type
          example: xml
        contentType:
          type: string
          description: content type
          example: application/xml
        uploadUrl:
          type: string
          description: upload URL
          example: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=
        source:
          type: string
          description: source
          example: com.unifiedpost.btx.connectors:peppol
        parentFileId:
          type: string
          description: parent file id
          format: uuid
          example: b8536327-4c29-4280-9da2-aa190e8484b7
        children:
          type: array
          description: List of child files
          items:
            $ref: '#/components/schemas/FileResult'
        tags:
          type: array
          description: tags
          example:
          - tag1
          - tag2
          items:
            type: string
            description: tags
            example: '["tag1","tag2"]'
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        createdAt:
          type: string
          description: creation datetime
          format: date-time
        updatedAt:
          type: string
          description: updated datetime
          format: date-time
    FilesResult:
      type: object
      properties:
        files:
          type: array
          description: List of response files
          items:
            $ref: '#/components/schemas/FileResult'
    JsonPatch:
      type: object
    FileList:
      type: object
      properties:
        files:
          type: array
          description: List of file ids
          items:
            type: string
            description: List of file ids
    UpdateDocumentRequest:
      type: object
      properties:
        description:
          type: string
          description: Description of the document.
          example: This is the invoice for your new phone
        source:
          type: string
          description: Source of the document.
          example: choruspro
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        tags:
          type: array
          description: Document tags
          example:
          - expensive
          items:
            type: string
            description: Document tags
            example: '["expensive"]'
        retentionTime:
          type: string
          description: Expiry datetime for the document
        supplier:
          type: string
          description: Supplier of the document
          format: uuid
        customer:
          type: string
          description: Customer of the document
          format: uuid
        status:
          $ref: '#/components/schemas/JsonBMap'
        category:
          $ref: '#/components/schemas/DocumentCategory'
    FileStatus:
      type: string
      description: File status
      example: PROCESSING
      enum:
      - AWAITING_UPLOAD
      - AWAITING_USER_ACTION
      - VIRUS_SCANNING
      - VIRUS_SCANNED
      - VIRUS_ERROR
      - PROCESSING
      - PROCESSED
      - REJECTED
      - ERROR
      - REPROCESSED
    AllFilesResult:
      type: object
      properties:
        files:
          type: array
          description: List of files
          items:
            $ref: '#/components/schemas/FileResult'
        totalElements:
          type: integer
          description: Total number of items in the database that correspond to this
            search criteria
          format: int64
        currentPage:
          type: integer
          description: Current page
          format: int32
        pageSize:
          type: integer
          description: Response page size
          format: int32
    FileSingleParams:
      type: object
      properties:
        hasDocuments:
          type: boolean
          description: Filter files which linked to document or not
          example: true
        creatorSubject:
          type: string
          description: Filter by subject who created the files
          example: 00000001-0001-0001-0001-000000000000
        creatorType:
          type: string
          description: Return the files that have creator type
          example: user
        status:
          $ref: '#/components/schemas/FileStatus'
        fileType:
          type: string
          description: Return the files that have file type
          example: pdf
        filename:
          type: string
          description: Return files having the name partially matching the given filename
          example: Doc-file-1
        source:
          type: string
          description: Return files having the source field equal to the given search
            term
          example: com.unifiedpost.btx.connectors:peppol
        createdAt[eq]:
          type: string
          description: Created at equals, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        createdAt[ne]:
          type: string
          description: Created at not equals, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        createdAt[gt]:
          type: string
          description: Created at greater than, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        createdAt[gte]:
          type: string
          description: Created at greater than or equal, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        createdAt[lt]:
          type: string
          description: Created at less than, in the format yyyy-MM-dd
          format: date
          example: 2024-04-15
        createdAt[lte]:
          type: string
          description: Created at less than or equal, in the format yyyy-MM-dd
          format: date
          example: 2024-04-15
        parentFileId:
          type: string
          description: Filter by parent file ID. If null, top-level files are returned.
          format: uuid
          example: b8536327-4c29-4280-9da2-aa190e8484b7
        include:
          type: string
          description: What extra data to include in the response.
          example: children
    ANTLRErrorListener:
      type: object
    ATN:
      type: object
      properties:
        states:
          type: array
          items:
            $ref: '#/components/schemas/ATNState'
        decisionToState:
          type: array
          items:
            $ref: '#/components/schemas/DecisionState'
        ruleToStartState:
          type: array
          items:
            $ref: '#/components/schemas/RuleStartState'
        ruleToStopState:
          type: array
          items:
            $ref: '#/components/schemas/RuleStopState'
        modeNameToStartState:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/TokensStartState'
        grammarType:
          type: string
          enum:
          - LEXER
          - PARSER
        maxTokenType:
          type: integer
          format: int32
        ruleToTokenType:
          type: array
          items:
            type: integer
            format: int32
        lexerActions:
          type: array
          items:
            $ref: '#/components/schemas/LexerAction'
        modeToStartState:
          type: array
          items:
            $ref: '#/components/schemas/TokensStartState'
        numberOfDecisions:
          type: integer
          format: int32
    ATNConfig:
      type: object
      properties:
        state:
          $ref: '#/components/schemas/ATNState'
        alt:
          type: integer
          format: int32
        context:
          $ref: '#/components/schemas/PredictionContext'
        reachesIntoOuterContext:
          type: integer
          format: int32
        semanticContext:
          $ref: '#/components/schemas/SemanticContext'
        outerContextDepth:
          type: integer
          format: int32
        precedenceFilterSuppressed:
          type: boolean
    ATNConfigSet:
      uniqueItems: true
      type: array
      properties:
        readonly:
          type: boolean
        configLookup:
          type: array
          properties:
            empty:
              type: boolean
          items:
            $ref: '#/components/schemas/ATNConfig'
        configs:
          type: array
          items:
            $ref: '#/components/schemas/ATNConfig'
        uniqueAlt:
          type: integer
          format: int32
        hasSemanticContext:
          type: boolean
        dipsIntoOuterContext:
          type: boolean
        fullCtx:
          type: boolean
        empty:
          type: boolean
        states:
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/ATNState'
        alts:
          type: object
          properties:
            empty:
              type: boolean
        predicates:
          type: array
          items:
            $ref: '#/components/schemas/SemanticContext'
      items:
        $ref: '#/components/schemas/ATNConfig'
    ATNState:
      type: object
      properties:
        atn:
          $ref: '#/components/schemas/ATN'
        stateNumber:
          type: integer
          format: int32
        ruleIndex:
          type: integer
          format: int32
        epsilonOnlyTransitions:
          type: boolean
        transitions:
          type: array
          items:
            $ref: '#/components/schemas/Transition'
        nextTokenWithinRule:
          $ref: '#/components/schemas/IntervalSet'
        nonGreedyExitState:
          type: boolean
        numberOfTransitions:
          type: integer
          format: int32
        stateType:
          type: integer
          format: int32
    AbstractConfigHashSet:
      type: array
      properties:
        empty:
          type: boolean
      items:
        $ref: '#/components/schemas/ATNConfig'
    AmbiguityInfo:
      type: object
      properties:
        decision:
          type: integer
          format: int32
        configs:
          uniqueItems: true
          type: array
          properties:
            readonly:
              type: boolean
            configLookup:
              type: array
              properties:
                empty:
                  type: boolean
              items:
                $ref: '#/components/schemas/ATNConfig'
            configs:
              type: array
              items:
                $ref: '#/components/schemas/ATNConfig'
            uniqueAlt:
              type: integer
              format: int32
            hasSemanticContext:
              type: boolean
            dipsIntoOuterContext:
              type: boolean
            fullCtx:
              type: boolean
            empty:
              type: boolean
            states:
              uniqueItems: true
              type: array
              items:
                $ref: '#/components/schemas/ATNState'
            alts:
              type: object
              properties:
                empty:
                  type: boolean
            predicates:
              type: array
              items:
                $ref: '#/components/schemas/SemanticContext'
          items:
            $ref: '#/components/schemas/ATNConfig'
        input:
          $ref: '#/components/schemas/TokenStream'
        startIndex:
          type: integer
          format: int32
        stopIndex:
          type: integer
          format: int32
        fullCtx:
          type: boolean
        ambigAlts:
          type: object
          properties:
            empty:
              type: boolean
    CharStream:
      type: object
      properties:
        sourceName:
          type: string
    ContextSensitivityInfo:
      type: object
      properties:
        decision:
          type: integer
          format: int32
        configs:
          uniqueItems: true
          type: array
          properties:
            readonly:
              type: boolean
            configLookup:
              type: array
              properties:
                empty:
                  type: boolean
              items:
                $ref: '#/components/schemas/ATNConfig'
            configs:
              type: array
              items:
                $ref: '#/components/schemas/ATNConfig'
            uniqueAlt:
              type: integer
              format: int32
            hasSemanticContext:
              type: boolean
            dipsIntoOuterContext:
              type: boolean
            fullCtx:
              type: boolean
            empty:
              type: boolean
            states:
              uniqueItems: true
              type: array
              items:
                $ref: '#/components/schemas/ATNState'
            alts:
              type: object
              properties:
                empty:
                  type: boolean
            predicates:
              type: array
              items:
                $ref: '#/components/schemas/SemanticContext'
          items:
            $ref: '#/components/schemas/ATNConfig'
        input:
          $ref: '#/components/schemas/TokenStream'
        startIndex:
          type: integer
          format: int32
        stopIndex:
          type: integer
          format: int32
        fullCtx:
          type: boolean
    DecisionInfo:
      type: object
      properties:
        decision:
          type: integer
          format: int32
        invocations:
          type: integer
          format: int64
        timeInPrediction:
          type: integer
          format: int64
        SLL_TotalLook:
          type: integer
          format: int64
        SLL_MinLook:
          type: integer
          format: int64
        SLL_MaxLook:
          type: integer
          format: int64
        SLL_MaxLookEvent:
          $ref: '#/components/schemas/LookaheadEventInfo'
        LL_TotalLook:
          type: integer
          format: int64
        LL_MinLook:
          type: integer
          format: int64
        LL_MaxLook:
          type: integer
          format: int64
        LL_MaxLookEvent:
          $ref: '#/components/schemas/LookaheadEventInfo'
        contextSensitivities:
          type: array
          items:
            $ref: '#/components/schemas/ContextSensitivityInfo'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorInfo'
        ambiguities:
          type: array
          items:
            $ref: '#/components/schemas/AmbiguityInfo'
        predicateEvals:
          type: array
          items:
            $ref: '#/components/schemas/PredicateEvalInfo'
        SLL_ATNTransitions:
          type: integer
          format: int64
        SLL_DFATransitions:
          type: integer
          format: int64
        LL_Fallback:
          type: integer
          format: int64
        LL_ATNTransitions:
          type: integer
          format: int64
        LL_DFATransitions:
          type: integer
          format: int64
    DecisionState:
      type: object
      properties:
        atn:
          $ref: '#/components/schemas/ATN'
        stateNumber:
          type: integer
          format: int32
        ruleIndex:
          type: integer
          format: int32
        epsilonOnlyTransitions:
          type: boolean
        transitions:
          type: array
          items:
            $ref: '#/components/schemas/Transition'
        nextTokenWithinRule:
          $ref: '#/components/schemas/IntervalSet'
        decision:
          type: integer
          format: int32
        nonGreedy:
          type: boolean
        nonGreedyExitState:
          type: boolean
        numberOfTransitions:
          type: integer
          format: int32
        stateType:
          type: integer
          format: int32
    ErrorInfo:
      type: object
      properties:
        decision:
          type: integer
          format: int32
        configs:
          uniqueItems: true
          type: array
          properties:
            readonly:
              type: boolean
            configLookup:
              type: array
              properties:
                empty:
                  type: boolean
              items:
                $ref: '#/components/schemas/ATNConfig'
            configs:
              type: array
              items:
                $ref: '#/components/schemas/ATNConfig'
            uniqueAlt:
              type: integer
              format: int32
            hasSemanticContext:
              type: boolean
            dipsIntoOuterContext:
              type: boolean
            fullCtx:
              type: boolean
            empty:
              type: boolean
            states:
              uniqueItems: true
              type: array
              items:
                $ref: '#/components/schemas/ATNState'
            alts:
              type: object
              properties:
                empty:
                  type: boolean
            predicates:
              type: array
              items:
                $ref: '#/components/schemas/SemanticContext'
          items:
            $ref: '#/components/schemas/ATNConfig'
        input:
          $ref: '#/components/schemas/TokenStream'
        startIndex:
          type: integer
          format: int32
        stopIndex:
          type: integer
          format: int32
        fullCtx:
          type: boolean
    IntStream:
      type: object
      properties:
        sourceName:
          type: string
    Interval:
      type: object
      properties:
        a:
          type: integer
          format: int32
        b:
          type: integer
          format: int32
    IntervalSet:
      type: object
      properties:
        intervals:
          type: array
          items:
            $ref: '#/components/schemas/Interval'
        readonly:
          type: boolean
        nil:
          type: boolean
        maxElement:
          type: integer
          format: int32
        minElement:
          type: integer
          format: int32
    LexerAction:
      type: object
      properties:
        positionDependent:
          type: boolean
        actionType:
          type: string
          enum:
          - CHANNEL
          - CUSTOM
          - MODE
          - MORE
          - POP_MODE
          - PUSH_MODE
          - SKIP
          - TYPE
    LookaheadEventInfo:
      type: object
      properties:
        decision:
          type: integer
          format: int32
        configs:
          uniqueItems: true
          type: array
          properties:
            readonly:
              type: boolean
            configLookup:
              type: array
              properties:
                empty:
                  type: boolean
              items:
                $ref: '#/components/schemas/ATNConfig'
            configs:
              type: array
              items:
                $ref: '#/components/schemas/ATNConfig'
            uniqueAlt:
              type: integer
              format: int32
            hasSemanticContext:
              type: boolean
            dipsIntoOuterContext:
              type: boolean
            fullCtx:
              type: boolean
            empty:
              type: boolean
            states:
              uniqueItems: true
              type: array
              items:
                $ref: '#/components/schemas/ATNState'
            alts:
              type: object
              properties:
                empty:
                  type: boolean
            predicates:
              type: array
              items:
                $ref: '#/components/schemas/SemanticContext'
          items:
            $ref: '#/components/schemas/ATNConfig'
        input:
          $ref: '#/components/schemas/TokenStream'
        startIndex:
          type: integer
          format: int32
        stopIndex:
          type: integer
          format: int32
        fullCtx:
          type: boolean
        predictedAlt:
          type: integer
          format: int32
    ParseInfo:
      type: object
      properties:
        totalTimeInPrediction:
          type: integer
          format: int64
        totalSLLLookaheadOps:
          type: integer
          format: int64
        totalLLLookaheadOps:
          type: integer
          format: int64
        totalSLLATNLookaheadOps:
          type: integer
          format: int64
        totalLLATNLookaheadOps:
          type: integer
          format: int64
        totalATNLookaheadOps:
          type: integer
          format: int64
        dfasize:
          type: integer
          format: int32
        decisionInfo:
          type: array
          items:
            $ref: '#/components/schemas/DecisionInfo'
        lldecisions:
          type: array
          items:
            type: integer
            format: int32
    ParseTree:
      type: object
      properties:
        parent:
          $ref: '#/components/schemas/ParseTree'
        text:
          type: string
        sourceInterval:
          $ref: '#/components/schemas/Interval'
        payload:
          type: object
        childCount:
          type: integer
          format: int32
    ParserRuleContext:
      type: object
      properties:
        parent:
          $ref: '#/components/schemas/ParserRuleContext'
        invokingState:
          type: integer
          format: int32
        children:
          type: array
          items:
            $ref: '#/components/schemas/ParseTree'
        start:
          $ref: '#/components/schemas/Token'
        stop:
          $ref: '#/components/schemas/Token'
        exception:
          $ref: '#/components/schemas/RecognitionException'
        childCount:
          type: integer
          format: int32
        sourceInterval:
          $ref: '#/components/schemas/Interval'
        empty:
          type: boolean
        payload:
          $ref: '#/components/schemas/RuleContext'
        text:
          type: string
        ruleContext:
          $ref: '#/components/schemas/RuleContext'
        ruleIndex:
          type: integer
          format: int32
        altNumber:
          type: integer
          format: int32
    PredicateEvalInfo:
      type: object
      properties:
        decision:
          type: integer
          format: int32
        configs:
          uniqueItems: true
          type: array
          properties:
            readonly:
              type: boolean
            configLookup:
              type: array
              properties:
                empty:
                  type: boolean
              items:
                $ref: '#/components/schemas/ATNConfig'
            configs:
              type: array
              items:
                $ref: '#/components/schemas/ATNConfig'
            uniqueAlt:
              type: integer
              format: int32
            hasSemanticContext:
              type: boolean
            dipsIntoOuterContext:
              type: boolean
            fullCtx:
              type: boolean
            empty:
              type: boolean
            states:
              uniqueItems: true
              type: array
              items:
                $ref: '#/components/schemas/ATNState'
            alts:
              type: object
              properties:
                empty:
                  type: boolean
            predicates:
              type: array
              items:
                $ref: '#/components/schemas/SemanticContext'
          items:
            $ref: '#/components/schemas/ATNConfig'
        input:
          $ref: '#/components/schemas/TokenStream'
        startIndex:
          type: integer
          format: int32
        stopIndex:
          type: integer
          format: int32
        fullCtx:
          type: boolean
        semctx:
          $ref: '#/components/schemas/SemanticContext'
        predictedAlt:
          type: integer
          format: int32
        evalResult:
          type: boolean
    PredictionContext:
      type: object
      properties:
        id:
          type: integer
          format: int32
        cachedHashCode:
          type: integer
          format: int32
        empty:
          type: boolean
    QueryContext:
      type: object
      properties:
        parent:
          $ref: '#/components/schemas/ParserRuleContext'
        invokingState:
          type: integer
          format: int32
        children:
          type: array
          items:
            $ref: '#/components/schemas/ParseTree'
        start:
          $ref: '#/components/schemas/Token'
        stop:
          $ref: '#/components/schemas/Token'
        exception:
          $ref: '#/components/schemas/RecognitionException'
        ruleIndex:
          type: integer
          format: int32
        childCount:
          type: integer
          format: int32
        sourceInterval:
          $ref: '#/components/schemas/Interval'
        empty:
          type: boolean
        payload:
          $ref: '#/components/schemas/RuleContext'
        text:
          type: string
        ruleContext:
          $ref: '#/components/schemas/RuleContext'
        altNumber:
          type: integer
          format: int32
    RecognitionException:
      type: object
      properties:
        cause:
          type: object
          properties:
            stackTrace:
              type: array
              items:
                type: object
                properties:
                  classLoaderName:
                    type: string
                  moduleName:
                    type: string
                  moduleVersion:
                    type: string
                  methodName:
                    type: string
                  fileName:
                    type: string
                  lineNumber:
                    type: integer
                    format: int32
                  className:
                    type: string
                  nativeMethod:
                    type: boolean
            message:
              type: string
            suppressed:
              type: array
              items:
                type: object
                properties:
                  stackTrace:
                    type: array
                    items:
                      type: object
                      properties:
                        classLoaderName:
                          type: string
                        moduleName:
                          type: string
                        moduleVersion:
                          type: string
                        methodName:
                          type: string
                        fileName:
                          type: string
                        lineNumber:
                          type: integer
                          format: int32
                        className:
                          type: string
                        nativeMethod:
                          type: boolean
                  message:
                    type: string
                  localizedMessage:
                    type: string
            localizedMessage:
              type: string
        stackTrace:
          type: array
          items:
            type: object
            properties:
              classLoaderName:
                type: string
              moduleName:
                type: string
              moduleVersion:
                type: string
              methodName:
                type: string
              fileName:
                type: string
              lineNumber:
                type: integer
                format: int32
              className:
                type: string
              nativeMethod:
                type: boolean
        recognizer:
          $ref: '#/components/schemas/RecognizerObjectObject'
        ctx:
          $ref: '#/components/schemas/RuleContext'
        offendingToken:
          $ref: '#/components/schemas/Token'
        offendingState:
          type: integer
          format: int32
        inputStream:
          $ref: '#/components/schemas/IntStream'
        expectedTokens:
          $ref: '#/components/schemas/IntervalSet'
        message:
          type: string
        suppressed:
          type: array
          items:
            type: object
            properties:
              stackTrace:
                type: array
                items:
                  type: object
                  properties:
                    classLoaderName:
                      type: string
                    moduleName:
                      type: string
                    moduleVersion:
                      type: string
                    methodName:
                      type: string
                    fileName:
                      type: string
                    lineNumber:
                      type: integer
                      format: int32
                    className:
                      type: string
                    nativeMethod:
                      type: boolean
              message:
                type: string
              localizedMessage:
                type: string
        localizedMessage:
          type: string
    RecognizerObjectObject:
      type: object
      properties:
        state:
          type: integer
          format: int32
        inputStream:
          $ref: '#/components/schemas/IntStream'
        interpreter:
          type: object
        ruleNames:
          type: array
          items:
            type: string
        errorListenerDispatch:
          $ref: '#/components/schemas/ANTLRErrorListener'
        tokenNames:
          type: array
          items:
            type: string
        vocabulary:
          $ref: '#/components/schemas/Vocabulary'
        grammarFileName:
          type: string
        serializedATN:
          type: string
        atn:
          $ref: '#/components/schemas/ATN'
        tokenFactory:
          $ref: '#/components/schemas/TokenFactoryObject'
        parseInfo:
          $ref: '#/components/schemas/ParseInfo'
        ruleIndexMap:
          type: object
          additionalProperties:
            type: integer
            format: int32
        tokenTypeMap:
          type: object
          additionalProperties:
            type: integer
            format: int32
        errorListeners:
          type: array
          items:
            $ref: '#/components/schemas/ANTLRErrorListener'
    RuleContext:
      type: object
      properties:
        parent:
          $ref: '#/components/schemas/RuleContext'
        invokingState:
          type: integer
          format: int32
        empty:
          type: boolean
        payload:
          $ref: '#/components/schemas/RuleContext'
        text:
          type: string
        childCount:
          type: integer
          format: int32
        ruleContext:
          $ref: '#/components/schemas/RuleContext'
        ruleIndex:
          type: integer
          format: int32
        sourceInterval:
          $ref: '#/components/schemas/Interval'
        altNumber:
          type: integer
          format: int32
    RuleStartState:
      type: object
      properties:
        atn:
          $ref: '#/components/schemas/ATN'
        stateNumber:
          type: integer
          format: int32
        ruleIndex:
          type: integer
          format: int32
        epsilonOnlyTransitions:
          type: boolean
        transitions:
          type: array
          items:
            $ref: '#/components/schemas/Transition'
        nextTokenWithinRule:
          $ref: '#/components/schemas/IntervalSet'
        stopState:
          $ref: '#/components/schemas/RuleStopState'
        isLeftRecursiveRule:
          type: boolean
        stateType:
          type: integer
          format: int32
        nonGreedyExitState:
          type: boolean
        numberOfTransitions:
          type: integer
          format: int32
    RuleStopState:
      type: object
      properties:
        atn:
          $ref: '#/components/schemas/ATN'
        stateNumber:
          type: integer
          format: int32
        ruleIndex:
          type: integer
          format: int32
        epsilonOnlyTransitions:
          type: boolean
        transitions:
          type: array
          items:
            $ref: '#/components/schemas/Transition'
        nextTokenWithinRule:
          $ref: '#/components/schemas/IntervalSet'
        stateType:
          type: integer
          format: int32
        nonGreedyExitState:
          type: boolean
        numberOfTransitions:
          type: integer
          format: int32
    SemanticContext:
      type: object
    Token:
      type: object
      properties:
        type:
          type: integer
          format: int32
        inputStream:
          $ref: '#/components/schemas/CharStream'
        channel:
          type: integer
          format: int32
        text:
          type: string
        tokenIndex:
          type: integer
          format: int32
        charPositionInLine:
          type: integer
          format: int32
        tokenSource:
          $ref: '#/components/schemas/TokenSource'
        startIndex:
          type: integer
          format: int32
        stopIndex:
          type: integer
          format: int32
        line:
          type: integer
          format: int32
    TokenFactoryObject:
      type: object
    TokenSource:
      type: object
      properties:
        inputStream:
          $ref: '#/components/schemas/CharStream'
        charPositionInLine:
          type: integer
          format: int32
        tokenFactory:
          $ref: '#/components/schemas/TokenFactoryObject'
        sourceName:
          type: string
        line:
          type: integer
          format: int32
    TokenStream:
      type: object
      properties:
        text:
          type: string
        tokenSource:
          $ref: '#/components/schemas/TokenSource'
        sourceName:
          type: string
    TokensStartState:
      type: object
      properties:
        atn:
          $ref: '#/components/schemas/ATN'
        stateNumber:
          type: integer
          format: int32
        ruleIndex:
          type: integer
          format: int32
        epsilonOnlyTransitions:
          type: boolean
        transitions:
          type: array
          items:
            $ref: '#/components/schemas/Transition'
        nextTokenWithinRule:
          $ref: '#/components/schemas/IntervalSet'
        decision:
          type: integer
          format: int32
        nonGreedy:
          type: boolean
        stateType:
          type: integer
          format: int32
        nonGreedyExitState:
          type: boolean
        numberOfTransitions:
          type: integer
          format: int32
    Transition:
      type: object
      properties:
        target:
          $ref: '#/components/schemas/ATNState'
        serializationType:
          type: integer
          format: int32
        epsilon:
          type: boolean
    Vocabulary:
      type: object
      properties:
        maxTokenType:
          type: integer
          format: int32
    LinkedDocumentResult:
      type: object
      properties:
        id:
          type: string
          description: Id of document
          format: uuid
        description:
          type: string
          description: Description of document
    ListLinkedDocumentsResult:
      type: object
      properties:
        documents:
          type: array
          description: List of documents
          items:
            $ref: '#/components/schemas/LinkedDocumentResult'
    DocumentList:
      type: object
      properties:
        documents:
          type: array
          description: List of document ids
          items:
            type: string
            description: List of document ids
    UpdateFileRequest:
      type: object
      properties:
        filename:
          type: string
          description: file name
          example: legal_xml.xml
        description:
          type: string
          description: description
          example: The file for document DOC-1
        creatorSubject:
          type: string
          description: creator subject
          example: 00000001-0001-0001-0001-000000000000
        creatorType:
          type: string
          description: creator type
          example: user
        retentionTime:
          type: string
          description: retention time
          format: date-time
          example: 2129-01-14 19:58:47+00:00
        status:
          $ref: '#/components/schemas/FileStatus'
        fileSize:
          type: integer
          description: file size
          format: int32
          example: 1024
        fileType:
          type: string
          description: file type
          example: xml
        contentType:
          type: string
          description: content type
          example: application/xml
        source:
          type: string
          description: source
          example: com.unifiedpost.btx.connectors:peppol
        tags:
          type: array
          description: tags
          example:
          - tag1
          - tag2
          items:
            type: string
            description: tags
            example: '["tag1","tag2"]'
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        parentFileId:
          type: string
          description: parent file id
          format: uuid
          example: b8536327-4c29-4280-9da2-aa190e8484b7
    LineItemListResult:
      type: object
      properties:
        lines:
          type: array
          description: List of line items
          items:
            $ref: '#/components/schemas/LineItemResult'
    LineItemListRequest:
      type: object
      properties:
        lines:
          type: array
          description: List of line items
          items:
            $ref: '#/components/schemas/LineItemResult'
    AllLineItemsResult:
      type: object
      properties:
        lines:
          type: array
          description: List of line items
          items:
            $ref: '#/components/schemas/LineItemResult'
        totalElements:
          type: integer
          description: Total number of items in the database that correspond to this
            search criteria
          format: int64
        currentPage:
          type: integer
          description: Current page
          format: int32
        pageSize:
          type: integer
          description: Response page size
          format: int32
    UpdateLineItemRequest:
      type: object
      properties:
        identifier:
          type: string
          description: Identifier
          example: identifier 1
        description:
          type: string
          description: Description
          example: line item 1
        itemId:
          type: string
          description: Company’s local product code
          example: item1
        itemCategory:
          type: string
          description: Item category
          example: category
        productIdentifiers:
          $ref: '#/components/schemas/JsonBMap'
        quantity:
          type: integer
          description: Quantity
          format: int32
          example: 2
        unit:
          type: string
          description: Unit
          example: PCS
        startDate:
          type: string
          description: Start date
          format: date
        endDate:
          type: string
          description: End date
          format: date
          example: 2024-06-23
        discounts:
          $ref: '#/components/schemas/JsonBMap'
        charges:
          $ref: '#/components/schemas/JsonBMap'
        unitPrice:
          type: string
          description: Unit price
          example: '40.278192'
        netAmount:
          type: string
          description: Net amount
          example: '80.56'
        grossAmount:
          type: string
          description: Gross amount
          example: '96.67'
        vatAmount:
          type: string
          description: VAT amount
          example: '16.11'
        currency:
          pattern: '[A-Z]{3}'
          type: string
          description: International code ISO 4217 of the currency used
          example: EUR
        vatRate:
          type: string
          description: VAT rate
          example: '0.2'
        vatCode:
          type: string
          description: VAT code
          example: VAT
    TaskRequest:
      type: object
      properties:
        extensionName:
          type: string
          description: Extension name,max 255 characters
          example: com.unifiedpost.btx.data:approve
        context:
          $ref: '#/components/schemas/JsonBMap'
    AllTaskResult:
      type: object
      properties:
        tasks:
          type: array
          description: List of tasks
          items:
            $ref: '#/components/schemas/TaskResult'
        totalElements:
          type: integer
          description: Total number of items in the database that correspond to this
            search criteria
          format: int64
        currentPage:
          type: integer
          description: Current page
          format: int32
        pageSize:
          type: integer
          description: Response page size
          format: int32
    UpdateTaskRequest:
      type: object
      properties:
        status:
          type: string
          description: Extension status
          example: in progress
    DirectoryIdentifierDto:
      required:
      - id
      - name
      type: object
      properties:
        id:
          type: string
          description: Directory id
          format: uuid
        name:
          type: string
          description: Name of the directory
      description: Document's parent directory
      example:
        id: 44d929f7-952d-4283-9010-8a63a16831b3
        name: Plant
    DirectoryResponse:
      required:
      - folder
      - id
      - name
      - spaceId
      type: object
      properties:
        id:
          type: string
          description: Directory id
          format: uuid
        spaceId:
          type: string
          description: Space id
          format: uuid
        name:
          type: string
          description: Name of the directory
        folder:
          $ref: '#/components/schemas/FolderV2'
        parentDirectory:
          $ref: '#/components/schemas/DirectoryIdentifierDto'
        timestamps:
          $ref: '#/components/schemas/Timestamps'
    FolderV2:
      type: string
      description: Document folder v2
      example: INBOX
      enum:
      - PURCHASES
      - SALES
      - DRAFTS
      - INBOX
      - STATEMENTS
      - FILES
    Timestamps:
      type: object
      properties:
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      description: Timestamp fields, updated at and created at
    FolderLowercase:
      type: string
      description: Document folder lowercase
      example: inbox
      enum:
      - purchases
      - sales
      - drafts
      - inbox
      - statements
      - files
    DirectoryRequest:
      required:
      - name
      type: object
      properties:
        name:
          type: string
          description: Name of the directory.
          example: Fruits
        parentDirectoryId:
          type: string
          description: Optional parent directory. Must exist if not null. Null means
            top-level (root) directory in that folder.
          format: uuid
          example: 44d929f7-952d-4283-9010-8a63a16831b3
    FolderItemResponse:
      required:
      - id
      - name
      type: object
      properties:
        id:
          type: string
          description: Item identifier
          format: uuid
        name:
          type: string
          description: Item name
        type:
          $ref: '#/components/schemas/FolderItemType'
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        timestamps:
          $ref: '#/components/schemas/Timestamps'
    FolderItemType:
      type: string
      description: Folder item type
      example: DIRECTORY
      enum:
      - DIRECTORY
      - DOCUMENT
    ListFolderItemsResponse:
      type: object
      properties:
        items:
          type: array
          description: List of folder items
          items:
            $ref: '#/components/schemas/FolderItemResponse'
        totalElements:
          type: integer
          description: Total number of items in the database that correspond to this
            search criteria
          format: int64
        currentPage:
          type: integer
          description: Current page
          format: int32
        pageSize:
          type: integer
          description: Response page size
          format: int32
    FolderItemInclude:
      type: string
      description: The possible linked resources to include
      example: metadata
      enum:
      - timestamps
      - metadata
    MoveDirectoryRequest:
      type: object
      properties:
        parentDirectoryId:
          type: string
          description: Optional parent directory. Must exist if not null. Null means
            top-level (root) directory in that folder.
          format: uuid
          example: 44d929f7-952d-4283-9010-8a63a16831b3
    UpdateDirectoryRequest:
      required:
      - name
      type: object
      properties:
        name:
          type: string
          description: Name of the directory.
    LineItemData:
      $ref: '#/components/schemas/JsonBMap'
    LineItemListResultV2:
      type: object
      properties:
        lines:
          type: array
          description: List of line items
          items:
            $ref: '#/components/schemas/LineItemV2'
    LineItemV2:
      type: object
      properties:
        id:
          type: string
          description: Line item id
          format: uuid
        sequence:
          type: integer
          description: Sequence
          format: int32
          example: 1
        data:
          $ref: '#/components/schemas/JsonBMap'
    LineItemListRequestV2:
      type: object
      properties:
        lines:
          type: array
          items:
            $ref: '#/components/schemas/JsonBMap'
    AllLineItemsResultV2:
      type: object
      properties:
        lines:
          type: array
          description: List of lines items
          items:
            $ref: '#/components/schemas/LineItemV2'
        totalElements:
          type: integer
          description: Total number of items in the database that correspond to this
            search criteria
          format: int64
        currentPage:
          type: integer
          description: Current page
          format: int32
        pageSize:
          type: integer
          description: Response page size
          format: int32
    UpdateLineItemRequestV2:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/JsonBMap'
    ExtensionProcessableData:
      type: object
      properties:
        empty:
          type: boolean
      additionalProperties:
        type: object
    DocumentRawData:
      $ref: '#/components/schemas/JsonBMap'
    AggregationStatus:
      type: string
      description: Status determined by aggregation
      example: AUTO_CONFIRMED
      enum:
      - PROPOSED
      - AUTO_CONFIRMED
      - USER_CONFIRMED
      - REJECTED
    AmountDto:
      type: object
      properties:
        value:
          type: string
          description: Amount value with a maximum of 14 integer digits and 2 fractional
            digits
          example: '10.05'
        currency:
          pattern: '[A-Z]{3}'
          type: string
          description: International code of the currency used
          example: EUR
    BalanceOffsetPayableType:
      type: string
      description: Discriminator to determine the payable type.
      example: document
      enum:
      - document
      - note
      - payment
    BalanceOffsetResult:
      required:
      - aggregationStatus
      - offsetType
      - paymentId
      type: object
      properties:
        payableType:
          $ref: '#/components/schemas/BalanceOffsetPayableType'
        id:
          type: string
          description: id of balance offset
          format: uuid
        spaceId:
          type: string
          description: Space id
          format: uuid
        paymentId:
          type: string
          description: Payment id
          format: uuid
        amount:
          $ref: '#/components/schemas/AmountDto'
        offsetType:
          $ref: '#/components/schemas/BalanceOffsetType'
        aggregationStatus:
          $ref: '#/components/schemas/AggregationStatus'
        createdAt:
          type: string
          description: creation datetime
          format: date-time
        updatedAt:
          type: string
          description: updated datetime
          format: date-time
        metadata:
          $ref: '#/components/schemas/JsonBMap'
      discriminator:
        propertyName: payableType
        mapping:
          document: '#/components/schemas/DocumentBalanceOffsetResult'
          note: '#/components/schemas/NoteBalanceOffsetResult'
          payment: '#/components/schemas/PaymentBalanceOffsetResult'
    BalanceOffsetType:
      type: string
      description: Type of balance offset
      example: PARTIAL
      enum:
      - FULL
      - PARTIAL
      - DISCOUNT
      - REFUND
      - TIP
      - UNDERPAYMENT
      - OVERPAYMENT
      - FEE
    ConnectionRelationType:
      type: string
      description: Connection relation type
      example: CUSTOMER
      enum:
      - CUSTOMER
      - SUPPLIER
      - ACCOUNTANT
      - PARTNER
      - GROUP
    DocumentBalanceOffsetResult:
      required:
      - aggregationStatus
      - documentId
      - offsetType
      - paymentId
      type: object
      allOf:
      - $ref: '#/components/schemas/BalanceOffsetResult'
      - type: object
        properties:
          documentId:
            type: string
            description: Document id
            format: uuid
    DocumentConnectionData:
      type: object
      properties:
        displayName:
          type: string
          description: display name of supplier/customer
        relationType:
          $ref: '#/components/schemas/ConnectionRelationType'
        id:
          type: string
          description: id of supplier/customer
          format: uuid
    DocumentProcessingData:
      $ref: '#/components/schemas/JsonBMap'
    DocumentV2:
      required:
      - category
      - folder
      - id
      - metadata
      - retentionTime
      - spaceId
      - status
      type: object
      properties:
        timestamps:
          $ref: '#/components/schemas/Timestamps'
        lines:
          type: array
          description: List of line items
          nullable: true
          items:
            $ref: '#/components/schemas/LineItemV2'
        tasks:
          type: array
          description: List of document tasks
          nullable: true
          items:
            $ref: '#/components/schemas/TaskV2'
        parentDirectory:
          $ref: '#/components/schemas/DirectoryIdentifierDto'
        customCategories:
          type: object
          additionalProperties:
            uniqueItems: true
            type: array
            description: Document's custom categories
            example:
              purchases:
              - fuel
              - restaurant
            items:
              type: string
              description: Document's custom categories
              example: '{"purchases":["fuel","restaurant"]}'
          description: Document's custom categories
          example:
            purchases:
            - fuel
            - restaurant
        connections:
          type: array
          description: Connections of document
          nullable: true
          items:
            $ref: '#/components/schemas/DocumentConnectionData'
        id:
          type: string
          description: id of document
          format: uuid
        spaceId:
          type: string
          description: Space id
          format: uuid
        description:
          type: string
          description: description of document
        source:
          type: string
          description: source of document
        folder:
          $ref: '#/components/schemas/FolderV2'
        status:
          $ref: '#/components/schemas/JsonBMap'
        category:
          type: string
          description: 'Document category, current known values are :  PURCHASE_ORDER,
            ORDER_CONFIRMATION, DELIVERY_NOTE, GOODS_RECEIVED_NOTE, PROFORMA_INVOICE,
            INVOICE, INVOICE_REMINDER, CREDIT_NOTE, RECEIPT, STATEMENT, FILE, QUOTE,
            CREDIT_CARD_STATEMENT, THIRD_PARTY_STATEMENT, SELF_BILLED_INVOICE, SELF_BILLED_CREDIT_NOTE,
            OTHER. Future releases might contain additional new values.'
          example: INVOICE
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        tags:
          type: array
          description: tags
          items:
            type: string
            description: tags
        retentionTime:
          type: string
          description: datetime of document expiry
          format: date-time
        processingData:
          $ref: '#/components/schemas/JsonBMap'
        validationData:
          $ref: '#/components/schemas/JsonBMap'
        rawLinesData:
          $ref: '#/components/schemas/JsonBMap'
        rawData:
          $ref: '#/components/schemas/JsonBMap'
        balanceOffsets:
          type: array
          description: List of document balance offsets
          nullable: true
          items:
            $ref: '#/components/schemas/DocumentBalanceOffsetResult'
    DocumentValidationData:
      $ref: '#/components/schemas/JsonBMap'
    NoteBalanceOffsetResult:
      required:
      - aggregationStatus
      - offsetType
      - paymentId
      type: object
      allOf:
      - $ref: '#/components/schemas/BalanceOffsetResult'
      - type: object
        properties:
          comment:
            type: string
            description: Comment on the note balance offset.
    PaymentBalanceOffsetResult:
      required:
      - aggregationStatus
      - counterpartyPaymentId
      - offsetType
      - paymentId
      type: object
      allOf:
      - $ref: '#/components/schemas/BalanceOffsetResult'
      - type: object
        properties:
          counterpartyPaymentId:
            type: string
            description: Counterparty payment id
            format: uuid
    TaskV2:
      type: object
      properties:
        extensionName:
          type: string
          description: extension name
          example: com.unifiedpost.btx.data:approve
        status:
          type: string
          description: extension status
          example: approve
        context:
          $ref: '#/components/schemas/JsonBMap'
    DocumentConnectionRequest:
      required:
      - id
      - relationType
      type: object
      properties:
        id:
          type: string
          description: Relation ID of the connection to be saved as document connection.
            Must exist.
          format: uuid
          example: 4c32d3fb-0023-470c-ae21-105274a94706
        relationType:
          $ref: '#/components/schemas/ConnectionRelationType'
    BulkDocumentFullResponse:
      type: object
      allOf:
      - $ref: '#/components/schemas/BulkDocumentsResponse'
      - type: object
        properties:
          documents:
            type: array
            items:
              $ref: '#/components/schemas/DocumentV2'
    BulkDocumentIdsResponse:
      type: object
      allOf:
      - $ref: '#/components/schemas/BulkDocumentsResponse'
      - type: object
        properties:
          documents:
            type: array
            items:
              type: string
              format: uuid
    BulkDocumentsResponse:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/BulkResponseType'
      discriminator:
        propertyName: type
        mapping:
          ids: '#/components/schemas/BulkDocumentIdsResponse'
          full: '#/components/schemas/BulkDocumentFullResponse'
    BulkResponseType:
      type: string
      description: Bulk response type
      example: full
      enum:
      - full
      - ids
    BulkPatchDocumentRequestItem:
      type: object
      properties:
        id:
          type: string
        operations:
          $ref: '#/components/schemas/JsonPatch'
    BulkPatchDocumentsRequest:
      type: object
      properties:
        responseOptions:
          $ref: '#/components/schemas/BulkResponseOptions'
        documents:
          type: array
          description: List of documents to update
          items:
            $ref: '#/components/schemas/BulkPatchDocumentRequestItem'
    BulkResponseOptions:
      type: object
      properties:
        full:
          type: boolean
          description: 'Flag to indicate whether to return a detailed response.

            If `full` is false, only ids will be returned.

            '
          example: true
          default: false
      description: Response options
    CountDocumentsResponse:
      type: object
      properties:
        totalElements:
          type: integer
          description: Total number of items in the database that correspond to this
            search criteria
          format: int64
        currentPage:
          type: integer
          description: Current page
          format: int32
        pageSize:
          type: integer
          description: Response page size
          format: int32
        results:
          type: array
          description: List of document counts
          items:
            $ref: '#/components/schemas/DocumentCountResponse'
    DocumentCountResponse:
      type: object
      properties:
        spaceId:
          type: string
          description: Space unique identifier
          format: uuid
        documents:
          type: integer
          description: Count of documents in the space which matched the filters
          format: int64
    CountDocumentsRequest:
      required:
      - ql
      type: object
      properties:
        spaces:
          type: array
          description: List of space IDs used to filter
          items:
            type: string
            format: uuid
        ql:
          type: string
          description: BTX Query Language filter expression.
    DocumentRequestV2:
      required:
      - category
      - status
      type: object
      properties:
        waitForComplete:
          type: boolean
          description: Whether the document needs to wait for call to /complete endpoint,
            after representations have been uploaded
          example: true
        description:
          type: string
          description: Description of the document.
          example: This is the invoice for your new phone
        source:
          type: string
          description: Source of the document.
          example: choruspro
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        tags:
          type: array
          description: Document tags
          example:
          - expensive
          items:
            type: string
            description: Document tags
            example: '["expensive"]'
        retentionTime:
          type: string
          description: Expiry datetime for the document
        connections:
          type: array
          description: List of connection information
          nullable: true
          items:
            $ref: '#/components/schemas/DocumentConnectionRequest'
        status:
          $ref: '#/components/schemas/JsonBMap'
        category:
          $ref: '#/components/schemas/DocumentCategory'
        folder:
          $ref: '#/components/schemas/FolderV2'
        lines:
          type: array
          items:
            $ref: '#/components/schemas/JsonBMap'
        parentDirectoryId:
          type: string
          description: Parent directory id
          format: uuid
          example: 4c32d3fb-0023-470c-ae21-105274a94706
        customCategories:
          type: object
          additionalProperties:
            uniqueItems: true
            type: array
            description: Document's custom categories
            example:
              purchases:
              - fuel
              - restaurant
            items:
              type: string
              description: Document's custom categories
              example: '{"purchases":["fuel","restaurant"]}'
          description: Document's custom categories
          example:
            purchases:
            - fuel
            - restaurant
        createdAt:
          type: string
          description: Date and time of the document creation, usable only for migration
            tools (with migration_service scope) to keep original creation time during
            data migration
          format: date-time
    ListDocumentsResponseV2:
      type: object
      properties:
        documents:
          type: array
          description: List of documents
          items:
            $ref: '#/components/schemas/DocumentV2'
        totalElements:
          type: integer
          description: Total number of items in the database that correspond to this
            search criteria
          format: int64
        currentPage:
          type: integer
          description: Current page
          format: int32
        pageSize:
          type: integer
          description: Response page size
          format: int32
    ListDocumentsQueryParamsSingle:
      type: object
      properties:
        category:
          type: string
          description: Document category to filter. Can be multiple values separated
            by comma, or just one value
          example: PURCHASE_ORDER,RECEIPT
        connectionName[istart]:
          type: string
          description: Value for filtering by connection name having a specific prefix
          example: UNI
        connectionName[icont]:
          type: string
          description: Value for filtering by connection name containing a specific
            string anywhere in the string value
          example: nif
        documentNumber[istart]:
          type: string
          description: Value for filtering by documentNumber property having a specific
            prefix
          example: NR
        documentNumber[icont]:
          type: string
          description: Value for filtering by documentNumber property containing a
            specific string anywhere in the string value
          example: NR
        status[ql]:
          type: string
          description: Status query language DSL
          example: (document=FULLY_APPROVED OR document=SENT) AND (pay=FULLY_PAID
            OR pay=PARTIALLY_PAID)
        customCategories[ql]:
          type: string
          description: Custom categories language DSL
          example: (purchases=fuel AND purchases=restaurant AND purchases=groceries)
            OR purchases=books
        processingData:
          type: string
          description: processingData query param
          example: processingData=spaceExtensions/com.unifiedpost.btx.connectors/peppol/sbdhInstanceIdentifiers[any]=12345_118e3040-51d2-11e3-8f96-0800200c9a66,92345_118e3040-51d2-11e3-8f96-0800200c9a66
        folder:
          type: string
          description: Document folder to filter. Can be multiple values separated
            by comma, or just one value
          example: PURCHASES,STATEMENTS
        source:
          type: string
          description: Document source.
          example: documentCreator
        createdAt[eq]:
          type: string
          description: Created at equals specific timestamp, iso datetime format
          format: date-time
        createdAt[ne]:
          type: string
          description: Created at does not equal specific timestamp, iso datetime
            format
          format: date-time
        createdAt[lt]:
          type: string
          description: Created at is less than specific timestamp, iso datetime format
          format: date-time
        createdAt[lte]:
          type: string
          description: Created at is less or equal than specific timestamp, iso datetime
            format
          format: date-time
        createdAt[gt]:
          type: string
          description: Created at is greater than specific timestamp, iso datetime
            format
          format: date-time
        createdAt[gte]:
          type: string
          description: Created at is greater than specific timestamp, iso datetime
            format
          format: date-time
        dueDate[eq]:
          type: string
          description: Due date date equals, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        dueDate[ne]:
          type: string
          description: Due date not equals to specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        dueDate[gt]:
          type: string
          description: Due date greater than specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        dueDate[gte]:
          type: string
          description: Due date greater or equal to a specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        dueDate[lt]:
          type: string
          description: Due date less than a specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        dueDate[lte]:
          type: string
          description: Due date less than or equal to a specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[eq]:
          type: string
          description: Issue date date equals, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[ne]:
          type: string
          description: Issue date not equals to specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[gt]:
          type: string
          description: Issue date greater than specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[gte]:
          type: string
          description: Issue date greater or equal to a specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[lt]:
          type: string
          description: Issue date less than a specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[lte]:
          type: string
          description: Issue date less than or equal to a specific date, in format
            yyyy-MM-dd
          format: date
          example: 2024-04-15
        grossAmount[eq]:
          type: number
          description: Gross amount equal to
          example: 12.25
        grossAmount[ne]:
          type: number
          description: Gross amount not equal
          example: 12.25
        grossAmount[gt]:
          type: number
          description: Gross amount greater than
          example: 12.25
        grossAmount[gte]:
          type: number
          description: Gross amount greater than or equal to
          example: 12.25
        grossAmount[lt]:
          type: number
          description: Gross amount less than
          example: 12.25
        grossAmount[lte]:
          type: number
          description: Gross amount less than or equal to
          example: 12.25
        payableAmount[eq]:
          type: number
          description: Payable amount equal to
          example: 12.25
        payableAmount[ne]:
          type: number
          description: Payable amount not equal
          example: 12.25
        payableAmount[gt]:
          type: number
          description: Payable amount greater than
          example: 12.25
        payableAmount[gte]:
          type: number
          description: Payable amount greater than or equal to
          example: 12.25
        payableAmount[lt]:
          type: number
          description: Payable amount less than
          example: 12.25
        payableAmount[lte]:
          type: number
          description: Payable amount less than or equal to
          example: 12.25
        netAmount[eq]:
          type: number
          description: Net amount equal to
          example: 12.25
        netAmount[ne]:
          type: number
          description: Net amount not equal
          example: 12.25
        netAmount[gt]:
          type: number
          description: Net amount greater than
          example: 12.25
        netAmount[gte]:
          type: number
          description: Net amount greater than or equal to
          example: 12.25
        netAmount[lt]:
          type: number
          description: Net amount less than
          example: 12.25
        netAmount[lte]:
          type: number
          description: Net amount less than or equal to
          example: 12.25
        vatAmount[eq]:
          type: number
          description: VAT amount equal to
          example: 12.25
        vatAmount[ne]:
          type: number
          description: VAT amount not equal
          example: 12.25
        vatAmount[gt]:
          type: number
          description: VAT amount greater than
          example: 12.25
        vatAmount[gte]:
          type: number
          description: VAT amount greater than or equal to
          example: 12.25
        vatAmount[lt]:
          type: number
          description: VAT amount less than
          example: 12.25
        vatAmount[lte]:
          type: number
          description: VAT amount less than or equal to
          example: 12.25
        tags[in]:
          type: string
          description: Filter documents that contain any of the specified comma-separated
            tags
          example: tag1,tag2
        tags[notIn]:
          type: string
          description: Exclude documents that contain any of the specified comma-separated
            tags
          example: tag1,tag2
        balanceOffsets.aggregationStatus:
          $ref: '#/components/schemas/AggregationStatus'
        description:
          type: string
          description: Description of document
          example: My invoice
        updatedAt[eq]:
          type: string
          description: Updated at equals specific timestamp, iso datetime format
          format: date-time
        updatedAt[ne]:
          type: string
          description: Updated at does not equal specific timestamp, iso datetime
            format
          format: date-time
        updatedAt[lt]:
          type: string
          description: Updated at is less than specific timestamp, iso datetime format
          format: date-time
        updatedAt[lte]:
          type: string
          description: Updated at is less or equal than specific timestamp, iso datetime
            format
          format: date-time
        updatedAt[gt]:
          type: string
          description: Updated at is greater than specific timestamp, iso datetime
            format
          format: date-time
        updatedAt[gte]:
          type: string
          description: Updated at is greater than specific timestamp, iso datetime
            format
          format: date-time
        addIncomplete:
          type: boolean
          description: Flag to include documents with status wait_for_complete in
            response. Default is that documents with wait_for_complete are excluded.
    DocumentInclude:
      type: string
      description: The possible linked resources to include
      example: lines
      enum:
      - lines
      - tasks
      - connections
      - timestamps
      - rawData
      - rawLines
      - processingData
      - validationData
      - customCategories
      - balanceOffsets
    MoveDocumentToDirectoryRequest:
      type: object
      properties:
        parentDirectoryId:
          type: string
          description: Parent directory identifier
          format: uuid
          example: 44d929f7-952d-4283-9010-8a63a16831b3
    DocumentPatchRequestV2:
      type: object
      properties:
        description:
          type: string
          description: Description of the document.
          nullable: true
          example: This is the invoice for your new phone
        source:
          type: string
          description: Source of the document.
          nullable: true
          example: choruspro
        metadata:
          $ref: '#/components/schemas/JsonBMapNullable'
        tags:
          type: array
          description: Document tags
          nullable: true
          example:
          - expensive
          items:
            type: string
        retentionTime:
          type: string
          description: Expiry datetime for the document
          nullable: true
        status:
          $ref: '#/components/schemas/JsonBMapNullable'
        folder:
          $ref: '#/components/schemas/FolderV2'
        category:
          $ref: '#/components/schemas/DocumentCategory'
        lines:
          type: array
          description: List of line data
          nullable: true
          items:
            $ref: '#/components/schemas/JsonBMap'
        connections:
          type: array
          description: List of connection data
          nullable: true
          items:
            $ref: '#/components/schemas/DocumentConnectionRequest'
        customCategories:
          type: object
          additionalProperties:
            uniqueItems: true
            type: array
            description: Custom categories to replace
            nullable: true
            example:
              purchases:
              - fuel
              - restaurant
            items:
              type: string
              description: Custom categories to replace
              nullable: true
              example: '{"purchases":["fuel","restaurant"]}'
          description: Custom categories to replace
          nullable: true
          example:
            purchases:
            - fuel
            - restaurant
        createdAt:
          type: string
          description: Date and time of the document creation, usable only for migration
            tools (with migration_service scope) to keep original creation time during
            data migration
          format: date-time
    ExtensionDocumentStatus:
      type: object
      properties:
        empty:
          type: boolean
      additionalProperties:
        type: object
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.btx.fr.banqup.com/oauth2/client_credential/gettoken
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
        authorizationCode:
          authorizationUrl: https://api.btx.fr.banqup.com/oauth2/auth
          tokenUrl: https://api.btx.fr.banqup.com/oauth2/token
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
tags:
- name: Document validation
  description: These endpoints validate and detect the representation format of a
    document
- name: Spaces
  description: 'Spaces are virtual environments (work spaces) where all relevant resources
    of an entity are managed.  Spaces can also facilitate document exchange and communication
    among entities, depending on the space type.

    The role of spaces is to gather all relevant data of an entity into one accessible
    setting.  Such data can include: invoices, connections, cards, clients, payments,
    users, installed apps etc.  The capabilities offered by a space depends on the
    space type and the active subscription.'
  x-BTX:
    unDocumented: 'false'
    internal: 'false'
- name: Files
  description: A file refers to the digital container that stores the data of one
    or more documents.  Files are the medium through which electronic documents are
    stored, transmitted, and accessed.
  x-BTX:
    unDocumented: 'false'
    internal: 'false'
- name: Documents
  description: 'A document in e-invoicing refers to a formal, structured piece of
    information that contains details  related to invoicing: e.g financial data, payment
    details, tax information etc. or any other information  relevant to the company''s
    operations, services, or interactions with clients and partners.

    Every Banqup document is associated with a unique UUID that is stored in the Banqup
    database as documentId.  The UUID is generated when a new file is received/uploaded
    into Banqup and is necessary when performing  document actions via the Banqup
    APIs.'
  x-BTX:
    unDocumented: 'false'
    internal: 'false'
- name: Connections
  description: 'Connections are business and persons in the private address book of
    a space and they represent the actors involved  in document exchange, such as:
    customers, suppliers, accountants, partners, groups.'
  x-BTX:
    unDocumented: 'false'
    internal: 'false'
- name: Payments
  description: A payment is a generic term for the business event of transferring
    funds from one party to another.
  x-BTX:
    unDocumented: 'false'
    internal: 'false'
- name: Payment Accounts
  description: "Payment accounts are bank or financial accounts used for managing\
    \ payments, deposits, withdrawals, and transfers. \nThe Payment Accounts of a\
    \ space are all bank or financial account the business represented by the space\
    \ interacts with via e-invoicing or payments."
  x-BTX:
    unDocumented: 'false'
    internal: 'false'
- name: Payment Information
  description: "Payment Information representing some sort of evidence related to\
    \ a Payment.\nThis evidence could be in different forms :\n  - PaymentTransaction\
    \ : information related to a payment of which the transaction (initiation) \n\
    \                         was started on platform.\n  - BookedPaymentMovement\
    \ : information imported from your own account indicating a payment movement was\
    \ booked. \n  - PlannedPaymentMovement : information imported from your own account\
    \ indicating an amount was reserved \n                         for a future payment.\n\
    \  - ManualPaymentInformation : information about a payment that was manually\
    \ entered by a user of the platform.\n  - CounterpartyPaymentInformation : information\
    \ added to your space about a payment which was based on the \n              \
    \           PaymentInformation the counter party of the payment indicated on BTX\
    \ platform."
  x-BTX:
    unDocumented: 'false'
    internal: 'false'
- name: Internal Payments
  description: "This is a set of internal API call only intended to be used by BTX\
    \ Payment Service or Aggregation Service. They are restricted to ensure that updates\
    \ on payments, payment information and links to documents (BalanceOffset)  are\
    \ done in consistent way.  \nThe higher level public APIs for adding payment,\
    \ payment information and linking payments to documents  will be provided by the\
    \ BTX Payment Service or Aggregation Service."
  x-BTX:
    unDocumented: 'false'
    internal: 'true'
- name: Internal
  description: This is a set of pure internal API.  It contains for example callback
    endpoints that get registered to receive messages.
  x-BTX:
    unDocumented: 'true'
    internal: 'true'
security:
- oauth2: []
