openapi: 3.0.1
info:
  description: Document Processor Acceptor API
  title: Document Processor Acceptor API
  version: 1.12.0-CR12
servers:
- description: Generated server url
  url: https://api.uat.btx.fr.banqup.com/connectors/core
- description: Generated server url
  url: https://api.uat.btx.eu.banqup.com/connectors/core
security:
- oauth2: []
paths:
  /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
components:
  schemas:
    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
      required:
      - attachments
      - fileId
    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
    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
    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
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.uat.btx.fr.banqup.com/oauth2/client_credential/gettoken
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
        authorizationCode:
          authorizationUrl: https://api.uat.btx.fr.banqup.com/oauth2/auth
          tokenUrl: https://api.uat.btx.fr.banqup.com/oauth2/token
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
