openapi: 3.0.1
info:
  title: Aggregation API
  description: Service responsible for linking documents with payments
  version: 0.14.1
servers:
- description: Generated server url
  url: https://api.uat.btx.fr.banqup.com/pay/aggregation
- description: Generated server url
  url: https://api.uat.btx.eu.banqup.com/pay/aggregation
tags:
- name: messages
  description: the messages API
paths:
  /v1/transaction-radar/spaces/{spaceId}/payments/{paymentId}:matchDocuments:
    post:
      tags:
      - TransactionRadar
      summary: Manage payment matches
      description: 'Update the document matches of a payment <br/> Scope: []<br/>
        This Endpoint is part of: aggregation'
      operationId: matchDocuments
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: paymentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MatchDocumentsRequest'
        required: true
      responses:
        '200':
          description: OK
        '500':
          description: Internal server error
  /transaction-radar/v1/spaces/{spaceId}/payments/{paymentId}:matchDocuments:
    post:
      tags:
      - TransactionRadar
      summary: Manage payment matches
      description: 'Update the document matches of a payment <br/> Scope: []<br/>
        This Endpoint is part of: aggregation'
      operationId: matchDocuments_1
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: paymentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MatchDocumentsRequest'
        required: true
      responses:
        '200':
          description: OK
        '500':
          description: Internal server error
  /v1/transaction-radar/spaces/{spaceId}/documents/{documentId}:matchModifiers:
    post:
      tags:
      - TransactionRadar
      summary: Manage document matches
      description: 'Update the modifier matches of a document <br/> Scope: []<br/>
        This Endpoint is part of: aggregation'
      operationId: matchModifiers
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MatchModifiersRequest'
        required: true
      responses:
        '200':
          description: OK
        '500':
          description: Internal server error
  /transaction-radar/v1/spaces/{spaceId}/documents/{documentId}:matchModifiers:
    post:
      tags:
      - TransactionRadar
      summary: Manage document matches
      description: 'Update the modifier matches of a document <br/> Scope: []<br/>
        This Endpoint is part of: aggregation'
      operationId: matchModifiers_1
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MatchModifiersRequest'
        required: true
      responses:
        '200':
          description: OK
        '500':
          description: Internal server error
  /v1/receive/messages:
    post:
      tags:
      - messages
      operationId: receiveMessage
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Message'
        required: true
      responses:
        '200':
          description: OK
        '500':
          description: Internal server error
      description: ' <br/> Scope: []<br/> This Endpoint is part of: aggregation'
  /todos/v1/unmatchedPayments:
    post:
      tags:
      - Todos
      operationId: unmatchedPaymentsTodoAction
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TodoActionRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/TodoAction'
      description: ' <br/> Scope: []<br/> This Endpoint is part of: aggregation'
  /todos/v1/proposedAggregations:
    post:
      tags:
      - Todos
      operationId: proposedAggregationsTodoAction
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TodoActionRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/TodoAction'
      description: ' <br/> Scope: []<br/> This Endpoint is part of: aggregation'
  /support/v1/spaces/{spaceId}/documents/{documentId}:aggregate:
    post:
      tags:
      - Support
      summary: Aggregate Document
      description: 'Run aggregation for the given document <br/> Scope: []<br/> This
        Endpoint is part of: aggregation'
      operationId: aggregateDocument
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
        '500':
          description: Internal server error
  /payments/v2/spaces/{spaceId}/payments/{paymentId}:markAsReconciled:
    post:
      tags:
      - PaymentsV2
      summary: Mark Payment As Reconciled
      description: 'Reconcile a payment with a user note <br/> Scope: []<br/> This
        Endpoint is part of: aggregation'
      operationId: markAsReconciled
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: paymentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarkAsReconciledRequest'
        required: true
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
  /payments/v1/spaces/{spaceId}/payments/{paymentId}:initiateAggregation:
    post:
      tags:
      - Payments
      summary: Initiate payment aggregation
      description: 'Initiate aggregation for a payment based on the mapping of document
        ids to payment end-to-end ids <br/> Scope: []<br/> This Endpoint is part of:
        aggregation'
      operationId: initiateAggregation_1
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: paymentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentCorrelationList'
        required: true
      responses:
        '200':
          description: OK
        '400':
          description: Incorrect id in document correlation
        '404':
          description: Payment could not be found
        '500':
          description: Internal server error
  /payments/v1/spaces/{spaceId}/payments/{paymentId}:findProposedDocuments:
    post:
      tags:
      - Payments
      summary: Find Proposed Documents
      description: 'Find proposed documents that could be an acceptable match for
        a given payment <br/> Scope: []<br/> This Endpoint is part of: aggregation'
      operationId: findProposedDocuments
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: paymentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DocumentMatchResult'
        '500':
          description: Internal server error
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DocumentMatchResult'
  /enrichedMovementsReports/v2/spaces/{spaceId}/movements:enrich:
    post:
      tags:
      - EnrichedMovementsReports
      summary: Get enriched movements
      description: 'Get enriched movements V2 <br/> Scope: []<br/> This Endpoint is
        part of: aggregation'
      operationId: getEnrichedMovementsV2
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EMRContentRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/EMRContentResult'
        '500':
          description: Internal server error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/EMRContentResult'
  /enrichedMovementsReports/v2/spaces/{spaceId}/enrichedMovementsReports:generate:
    post:
      tags:
      - EnrichedMovementsReports
      summary: Generate enriched movements report
      description: 'Generate enriched movements report V2 <br/> Scope: []<br/> This
        Endpoint is part of: aggregation'
      operationId: generateEnrichedMovementsReportV2
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EMRRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EMRResult'
        '500':
          description: Internal server error
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EMRResult'
  /enrichedMovementsReports/v1/spaces/{spaceId}/enrichedMovementsReports:generate:
    post:
      tags:
      - EnrichedMovementsReports
      summary: Generate enriched movements report
      description: 'Generate enriched movements report <br/> Scope: []<br/> This Endpoint
        is part of: aggregation'
      operationId: generateEnrichedMovementsReport
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: accountIdentifier
        in: query
        required: true
        schema:
          type: string
      - name: toDate
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EMRResult'
        '500':
          description: Internal server error
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EMRResult'
  /enrichedMovementsReports/v1/spaces/{spaceId}/enrichedMovementsReports/{statementId}:regenerate:
    post:
      tags:
      - EnrichedMovementsReports
      summary: Regenerate enriched movements report
      description: 'Regenerate enriched movements report <br/> Scope: []<br/> This
        Endpoint is part of: aggregation'
      operationId: regenerateEnrichedMovementsReport
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: statementId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/EMRResult'
        '500':
          description: Internal server error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/EMRResult'
  /documents/v1/spaces/{spaceId}/documents:markAsUnpaid:
    post:
      tags:
      - Documents
      summary: Mark documents as unpaid
      description: 'Mark the given documents as unpaid <br/> Scope: []<br/> This Endpoint
        is part of: aggregation'
      operationId: markAsUnpaid
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarkAsUnpaidRequest'
        required: true
      responses:
        '200':
          description: OK
        '500':
          description: Internal server error
  /documents/v1/spaces/{spaceId}/documents:markAsPaid:
    post:
      tags:
      - Documents
      summary: Mark documents as paid
      description: 'Mark the given documents as paid with full amount <br/> Scope:
        []<br/> This Endpoint is part of: aggregation'
      operationId: markAsPaid
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarkAsPaidRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DocumentActionResult'
        '500':
          description: Internal server error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DocumentActionResult'
  /documents/v1/spaces/{spaceId}/documents/{documentId}:markAsUnpaid:
    post:
      tags:
      - Documents
      summary: Mark a document as unpaid
      description: 'Mark the given document as unpaid <br/> Scope: []<br/> This Endpoint
        is part of: aggregation'
      operationId: markAsUnpaid_1
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarkAsUnpaidData'
        required: true
      responses:
        '200':
          description: OK
        '500':
          description: Internal server error
  /documents/v1/spaces/{spaceId}/documents/{documentId}:markAsPaid:
    post:
      tags:
      - Documents
      summary: Mark a document as paid
      description: 'Mark the given document as paid <br/> Scope: []<br/> This Endpoint
        is part of: aggregation'
      operationId: markAsPaid_1
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarkAsPaidData'
        required: true
      responses:
        '200':
          description: OK
        '500':
          description: Internal server error
  /documents/v1/spaces/{spaceId}/documents/{documentId}:findProposedModifiers:
    post:
      tags:
      - Documents
      summary: Find Proposed Modifiers
      description: 'Find proposed documents or payments that could be an acceptable
        match for a given document <br/> Scope: []<br/> This Endpoint is part of:
        aggregation'
      operationId: findProposedModifiers
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ModifierMatchResult'
        '500':
          description: Internal server error
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ModifierMatchResult'
  /documents/v1/actions/markAsUnpaid:
    post:
      tags:
      - DocumentActions
      summary: Mark documents as unpaid
      description: 'Document action to mark the given documents as unpaid <br/> Scope:
        []<br/> This Endpoint is part of: aggregation'
      operationId: markAsUnpaidDocumentAction
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarkAsUnpaidActionRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DocumentActionResult'
        '500':
          description: Internal server error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DocumentActionResult'
  /documents/v1/actions/markAsPaid:
    post:
      tags:
      - DocumentActions
      summary: Mark documents as paid
      description: 'Document action to mark the given documents as paid <br/> Scope:
        []<br/> This Endpoint is part of: aggregation'
      operationId: markAsPaidDocumentAction
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarkAsPaidActionRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DocumentActionResult'
        '500':
          description: Internal server error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DocumentActionResult'
  /aggregations/v1/spaces/{spaceId}/aggregations:manage:
    post:
      tags:
      - Aggregations
      summary: Manage aggregations
      description: 'Add and reject aggregations in bulk <br/> Scope: []<br/> This
        Endpoint is part of: aggregation'
      operationId: manageAggregations
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ManageAggregationsRequest'
        required: true
      responses:
        '200':
          description: OK
        '500':
          description: Internal server error
  /aggregations/v1/spaces/{spaceId}/aggregations:bulkCreate:
    post:
      tags:
      - Aggregations
      summary: Add aggregation bulk
      description: 'Add multiple user-confirmed aggregations for the given document
        and modifier <br/> Scope: []<br/> This Endpoint is part of: aggregation'
      operationId: addAggregationBulk
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/AggregationRequest'
        required: true
      responses:
        '200':
          description: OK
        '500':
          description: Internal server error
  /aggregations/v1/spaces/{spaceId}/aggregations/{aggregationId}:reject:
    post:
      tags:
      - Aggregations
      summary: Reject aggregation
      description: 'Reject a proposed or previously confirmed aggregation <br/> Scope:
        []<br/> This Endpoint is part of: aggregation'
      operationId: rejectAggregation_1
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: aggregationId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
        '500':
          description: Internal server error
  /aggregations/v1/spaces/{spaceId}/aggregations/{aggregationId}:confirm:
    post:
      tags:
      - Aggregations
      summary: Confirm aggregation
      description: 'Confirm a proposed or previously rejected aggregation <br/> Scope:
        []<br/> This Endpoint is part of: aggregation'
      operationId: confirmAggregation_1
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: aggregationId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
        '500':
          description: Internal server error
  /aggregations/v1/spaces/{spaceId}/aggregations:
    post:
      tags:
      - Aggregations
      summary: Add aggregation
      description: 'Add a user-confirmed aggregation for the given payment and document
        <br/> Scope: []<br/> This Endpoint is part of: aggregation'
      operationId: addAggregation_1
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AggregationRequest'
        required: true
      responses:
        '200':
          description: OK
        '500':
          description: Internal server error
  /v1/transaction-radar/spaces/{spaceId}/payments/aggregations:
    get:
      tags:
      - TransactionRadar
      summary: Get Aggregated Payments
      description: 'Get list of aggregated payments on the given space. <br/> Scope:
        []<br/> This Endpoint is part of: aggregation'
      operationId: getPaymentAggregationsPaginated
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        required: false
        schema:
          maximum: 10000
          minimum: 0
          type: string
          description: Zero-based page index, cannot be negative, default 0
          example: 0
          default: '0'
        example: 0
      - name: size
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        required: false
        schema:
          maximum: 200
          minimum: 1
          type: string
          description: 'Page size. Minimum 1, maximum: 200, default 20'
          example: 20
          default: '20'
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        required: false
        schema:
          type: string
          description: Return the totalElements number of entries in the response
          example: true
          default: 'true'
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        required: false
        schema:
          type: string
          description: Sorting criteria
          enum:
          - createdAt
          - createdAt.asc
          - createdAt.desc
      - name: matchingStatus
        in: query
        required: false
        schema:
          type: string
          enum:
          - PROPOSED
          - UNMATCHED
          - MATCHED
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/TransactionRadarPaymentAggregationResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/TransactionRadarPaymentAggregationResponse'
  /transaction-radar/v1/spaces/{spaceId}/payments/aggregations:
    get:
      tags:
      - TransactionRadar
      summary: Get Aggregated Payments
      description: 'Get list of aggregated payments on the given space. <br/> Scope:
        []<br/> This Endpoint is part of: aggregation'
      operationId: getPaymentAggregationsPaginated_1
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        required: false
        schema:
          maximum: 10000
          minimum: 0
          type: string
          description: Zero-based page index, cannot be negative, default 0
          example: 0
          default: '0'
        example: 0
      - name: size
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        required: false
        schema:
          maximum: 200
          minimum: 1
          type: string
          description: 'Page size. Minimum 1, maximum: 200, default 20'
          example: 20
          default: '20'
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        required: false
        schema:
          type: string
          description: Return the totalElements number of entries in the response
          example: true
          default: 'true'
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        required: false
        schema:
          type: string
          description: Sorting criteria
          enum:
          - createdAt
          - createdAt.asc
          - createdAt.desc
      - name: matchingStatus
        in: query
        required: false
        schema:
          type: string
          enum:
          - PROPOSED
          - UNMATCHED
          - MATCHED
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/TransactionRadarPaymentAggregationResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/TransactionRadarPaymentAggregationResponse'
  /payments/v2/spaces/{spaceId}/payments/{paymentId}/aggregations:
    get:
      tags:
      - PaymentsV2
      summary: Get Aggregated Payment
      description: 'Get details of an aggregated payment <br/> Scope: []<br/> This
        Endpoint is part of: aggregation'
      operationId: getSinglePaymentAggregations
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: paymentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PaymentAggregationResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PaymentAggregationResponse'
  /payments/v2/spaces/{spaceId}/payments/aggregations:
    get:
      tags:
      - PaymentsV2
      summary: Get Aggregated Payments
      description: 'Get list of aggregated payments on the given space. <br/> Scope:
        []<br/> This Endpoint is part of: aggregation'
      operationId: getPaymentAggregationsPaginated_2
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        required: false
        schema:
          maximum: 10000
          minimum: 0
          type: string
          description: Zero-based page index, cannot be negative, default 0
          example: 0
          default: '0'
        example: 0
      - name: size
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        required: false
        schema:
          maximum: 200
          minimum: 1
          type: string
          description: 'Page size. Minimum 1, maximum: 200, default 20'
          example: 20
          default: '20'
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        required: false
        schema:
          type: string
          description: Return the totalElements number of entries in the response
          example: true
          default: 'true'
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        required: false
        schema:
          type: string
          description: Sorting criteria
          enum:
          - createdAt
          - createdAt.asc
          - createdAt.desc
      - name: matchingStatus
        in: query
        required: false
        schema:
          type: string
          enum:
          - PROPOSED
          - UNMATCHED
          - MATCHED
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PaymentAggregationResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PaymentAggregationResponse'
  /payments/v1/spaces/{spaceId}/payments/{paymentId}/aggregations:
    get:
      tags:
      - Payments
      summary: Get Aggregated Payment
      description: 'Get details of an aggregated payment <br/> Scope: []<br/> This
        Endpoint is part of: aggregation'
      operationId: getSinglePaymentAggregations_1
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: paymentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PaymentAggregationResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PaymentAggregationResponse'
  /payments/v1/spaces/{spaceId}/payments/aggregations:
    get:
      tags:
      - Payments
      summary: Get Aggregated Payments
      description: 'Get list of aggregated payments on the given space. <br/> Scope:
        []<br/> This Endpoint is part of: aggregation'
      operationId: getPaymentAggregationsPaginated_3
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        required: false
        schema:
          maximum: 10000
          minimum: 0
          type: string
          description: Zero-based page index, cannot be negative, default 0
          example: 0
          default: '0'
        example: 0
      - name: size
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        required: false
        schema:
          maximum: 200
          minimum: 1
          type: string
          description: 'Page size. Minimum 1, maximum: 200, default 20'
          example: 20
          default: '20'
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        required: false
        schema:
          type: string
          description: Return the totalElements number of entries in the response
          example: true
          default: 'true'
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        required: false
        schema:
          type: string
          description: Sorting criteria
          enum:
          - createdAt
          - createdAt.asc
          - createdAt.desc
      - name: matchingStatus
        in: query
        required: false
        schema:
          type: string
          enum:
          - PROPOSED
          - UNMATCHED
          - MATCHED
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PaymentAggregationResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PaymentAggregationResponse'
  /enrichedMovementsReports/v1/spaces/{spaceId}/movements:enrich:
    get:
      tags:
      - EnrichedMovementsReports
      summary: Get enriched movements
      description: 'Get enriched movements <br/> Scope: []<br/> This Endpoint is part
        of: aggregation'
      operationId: getEnrichedMovements
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: accountIdentifier
        in: query
        required: true
        schema:
          type: string
      - name: fromDate
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: toDate
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/EMRContentResult'
        '500':
          description: Internal server error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/EMRContentResult'
  /documents/v2/spaces/{spaceId}/documents/{documentId}/aggregations:
    get:
      tags:
      - DocumentsV2
      summary: Get Aggregated Document
      description: 'Get details of an aggregated document <br/> Scope: []<br/> This
        Endpoint is part of: aggregation'
      operationId: getSingleDocumentAggregations
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DocumentAggregationResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DocumentAggregationResponse'
  /documents/v2/spaces/{spaceId}/documents/aggregations:
    get:
      tags:
      - DocumentsV2
      summary: Get Aggregated Documents
      description: 'Get list of aggregated documents on the given space <br/> Scope:
        []<br/> This Endpoint is part of: aggregation'
      operationId: getDocumentAggregationsPaginated
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        required: false
        schema:
          maximum: 10000
          minimum: 0
          type: string
          description: Zero-based page index, cannot be negative, default 0
          example: 0
          default: '0'
        example: 0
      - name: size
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        required: false
        schema:
          maximum: 200
          minimum: 1
          type: string
          description: 'Page size. Minimum 1, maximum: 200, default 20'
          example: 20
          default: '20'
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        required: false
        schema:
          type: string
          description: Return the totalElements number of entries in the response
          example: true
          default: 'true'
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        required: false
        schema:
          type: string
          description: Sorting criteria
          enum:
          - createdAt
          - createdAt.asc
          - createdAt.desc
      - name: matchingStatus
        in: query
        required: false
        schema:
          type: string
          enum:
          - PROPOSED
          - UNMATCHED
          - MATCHED
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DocumentAggregationResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DocumentAggregationResponse'
  /documents/v1/spaces/{spaceId}/documents/{documentId}/aggregations:
    get:
      tags:
      - Documents
      summary: Get Aggregated Document
      description: 'Get details of an aggregated document <br/> Scope: []<br/> This
        Endpoint is part of: aggregation'
      operationId: getSingleDocumentAggregations_1
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DocumentAggregationResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DocumentAggregationResponse'
  /documents/v1/spaces/{spaceId}/documents/aggregations:
    get:
      tags:
      - Documents
      summary: Get Aggregated Documents
      description: 'Get list of aggregated documents on the given space. <br/> Scope:
        []<br/> This Endpoint is part of: aggregation'
      operationId: getDocumentAggregationsPaginated_1
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        required: false
        schema:
          maximum: 10000
          minimum: 0
          type: string
          description: Zero-based page index, cannot be negative, default 0
          example: 0
          default: '0'
        example: 0
      - name: size
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        required: false
        schema:
          maximum: 200
          minimum: 1
          type: string
          description: 'Page size. Minimum 1, maximum: 200, default 20'
          example: 20
          default: '20'
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        required: false
        schema:
          type: string
          description: Return the totalElements number of entries in the response
          example: true
          default: 'true'
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        required: false
        schema:
          type: string
          description: Sorting criteria
          enum:
          - createdAt
          - createdAt.asc
          - createdAt.desc
      - name: matchingStatus
        in: query
        required: false
        schema:
          type: string
          enum:
          - PROPOSED
          - UNMATCHED
          - MATCHED
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DocumentAggregationResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DocumentAggregationResponse'
components:
  schemas:
    MatchDocumentRequest:
      required:
      - documentId
      type: object
      allOf:
      - $ref: '#/components/schemas/MatchPayableRequest'
      - type: object
        properties:
          documentId:
            type: string
            description: The id of the document to match
            format: uuid
          amount:
            type: string
            description: The amount to match
          balanceOffsetId:
            type: string
            description: The id of the balance offset for matches that were already
              selected
            format: uuid
    MatchDocumentsRequest:
      required:
      - currentSelection
      - updatedSelection
      type: object
      properties:
        currentSelection:
          type: array
          description: List of balance offset id's that were already matched
          items:
            type: string
            description: List of balance offset id's that were already matched
            format: uuid
        updatedSelection:
          type: array
          description: List of new match requests
          items:
            oneOf:
            - $ref: '#/components/schemas/MatchDocumentRequest'
            - $ref: '#/components/schemas/MatchNoteRequest'
    MatchNoteRequest:
      type: object
      allOf:
      - $ref: '#/components/schemas/MatchPayableRequest'
      - type: object
        properties:
          comment:
            type: string
            description: 'The user comment to reconcile the payment '
          amount:
            type: string
            description: The amount to match
          balanceOffsetId:
            type: string
            description: The id of the balance offset for matches that were already
              selected
            format: uuid
    MatchPayableRequest:
      type: object
      properties:
        payableType:
          type: string
          enum:
          - DOCUMENT
          - NOTE
      description: List of new match requests
      discriminator:
        propertyName: payableType
        mapping:
          DOCUMENT: '#/components/schemas/MatchDocumentRequest'
          NOTE: '#/components/schemas/MatchNoteRequest'
    MatchModifierRequest:
      required:
      - modifierId
      - modifierType
      type: object
      properties:
        modifierId:
          type: string
          description: The id of the modifier to match
          format: uuid
        modifierType:
          type: string
          description: The modifier type of the match
          enum:
          - PAYMENT
          - DOCUMENT
          - CREDIT_NOTE
        amount:
          type: string
          description: The amount to match
        balanceOffsetId:
          type: string
          description: The id of the balance offset for matches that were already
            selected
          format: uuid
      description: List of new match requests
    MatchModifiersRequest:
      required:
      - currentSelection
      - updatedSelection
      type: object
      properties:
        currentSelection:
          type: array
          description: List of balance offset id's that were already matched
          items:
            type: string
            description: List of balance offset id's that were already matched
            format: uuid
        updatedSelection:
          type: array
          description: List of new match requests
          items:
            $ref: '#/components/schemas/MatchModifierRequest'
    Message:
      required:
      - category
      - data
      - messageId
      - type
      type: object
      properties:
        messageId:
          type: string
          description: The ID assigned by the API to this message.
        category:
          type: string
          description: The category of the message.
        type:
          type: string
          description: The type of the message.
        data:
          type: object
          description: All information related to the event that was emitted.
    DocumentCorrelation:
      required:
      - documentId
      type: object
      properties:
        documentId:
          type: string
          format: uuid
        endToEndIdentification:
          type: string
    DocumentCorrelationList:
      required:
      - documents
      type: object
      properties:
        documents:
          type: array
          items:
            $ref: '#/components/schemas/DocumentCorrelation'
    RequiredPermission:
      type: object
      properties:
        resourceId:
          type: string
          description: The UMA resource needed to view this item.
          example: 1b34de13-4063-41e6-8b68-237f0c391550
        scope:
          type: string
          description: The UMA scope needed on the specified resource.
          example: space_read
      description: The permission needed to view this item
    TodoActionRequest:
      required:
      - todoItems
      type: object
      properties:
        todoItems:
          type: array
          description: List of todo items.
          example:
          - id: cd319a93-1782-4c3d-b4cd-ac5bb06a20c3
            spaceId: 1b34de13-4063-41e6-8b68-237f0c391550
            type: paymentDue
            data:
              spaceId: 1b34de13-4063-41e6-8b68-237f0c391550
              documentId: dab33574-472c-4353-8119-678d705e7f9d
            reference: dab33574-472c-4353-8119-678d705e7f9d
            requiredPermission:
              resourceId: 1b34de13-4063-41e6-8b68-237f0c391550
              scope: space_read
          - id: cd319a93-1782-4c3d-b4cd-ac5bb06a20c5
            spaceId: 1b34de13-4063-41e6-8b68-237f0c391550
            type: paymentDue
            data:
              spaceId: 1b34de13-4063-41e6-8b68-237f0c391550
              documentId: dab33574-472c-4353-8119-678d705e7f9e
            reference: dab33574-472c-4353-8119-678d705e7f9e
            requiredPermission:
              resourceId: 1b34de13-4063-41e6-8b68-237f0c391550
              scope: space_read
          items:
            $ref: '#/components/schemas/TodoItem'
    TodoItem:
      required:
      - type
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the todo.(A UUID specified by RFC4122)
          format: uuid
          example: bf514229-fa39-4bca-b8d9-b96607e9954a
        spaceId:
          type: string
          description: The space identifier.(A UUID specified by RFC4122)
          format: uuid
          example: 1b34de13-4063-41e6-8b68-237f0c391550
        type:
          type: string
          description: The type of the todo item.
          example: reviewPurchaseDocument
        data:
          $ref: '#/components/schemas/TodoItemData'
        reference:
          type: string
          description: Optional identifier to quickly find todo items.
          example: bf514229-fa39-4bca-b8d9-b96607e9961e
        requiredPermission:
          $ref: '#/components/schemas/RequiredPermission'
    TodoItemData:
      type: object
      properties:
        spaceId:
          type: string
          description: Identifier of the space. (A UUID specified by RFC4122).
          format: uuid
          example: 1b34de13-4063-41e6-8b68-237f0c391550
        paymentId:
          type: string
          description: Identifier of the document. (A UUID specified by RFC4122).
          format: uuid
          example: bf514229-fa39-4bca-b8d9-b96607e9961e
        balanceOffsetId:
          type: string
          description: Identifier of the balanceOffset. (A UUID specified by RFC4122).
          format: uuid
          example: 2c45de13-4063-41e6-8b68-237f0c392661
      description: Type‑specific data describing the todo item.
    TodoAction:
      type: object
      properties:
        type:
          type: string
    MarkAsReconciledRequest:
      type: object
      properties:
        amount:
          type: string
        comment:
          type: string
    AggregationConnection:
      required:
      - displayName
      - id
      type: object
      properties:
        id:
          type: string
          format: uuid
        displayName:
          type: string
        relationType:
          type: string
    AggregationDocumentMetadata:
      type: object
      properties:
        documentNumber:
          type: string
        paymentReference:
          type: object
          additionalProperties:
            type: string
        documentReference:
          type: string
        currencyCode:
          type: string
        documentTotals:
          $ref: '#/components/schemas/DocumentAggregationTotals'
    DocumentAggregationTotals:
      type: object
      properties:
        payableAmount:
          type: number
        totalAmount:
          type: number
        projectedOpenBalance:
          type: number
    DocumentInfo:
      required:
      - connections
      - createdAt
      - folder
      - id
      - metadata
      type: object
      properties:
        id:
          type: string
          format: uuid
        folder:
          type: string
        category:
          type: string
        createdAt:
          type: string
          format: date-time
        metadata:
          $ref: '#/components/schemas/AggregationDocumentMetadata'
        connections:
          type: array
          items:
            $ref: '#/components/schemas/AggregationConnection'
    DocumentMatchResult:
      type: object
      properties:
        document:
          $ref: '#/components/schemas/DocumentInfo'
        rule:
          type: string
    AccountIdentifier:
      required:
      - currency
      - identifier
      - scheme
      type: object
      properties:
        identifier:
          type: string
          description: Account Identifier
          example: BE83504010119715
        scheme:
          type: string
          description: Account Scheme
          example: IBAN
        bank:
          $ref: '#/components/schemas/BankIdentifier'
        country:
          pattern: ^[a-zA-Z]{2}
          type: string
          example: BE
        currency:
          pattern: '[A-Z]{3}'
          type: string
          description: International code ISO 4217 of the currency used
          example: EUR
        parent:
          $ref: '#/components/schemas/AccountIdentifier'
    BankIdentifier:
      required:
      - identifier
      - scheme
      type: object
      properties:
        identifier:
          type: string
          description: Bank Identifier
          example: PANXBEB1XXX
        scheme:
          type: string
          description: Bank Identifier Scheme
          example: BIC
          enum:
          - BIC
          - CODE
          - THIRD_PARTY
      description: Information about the issuer of the account
    EMRContentRequest:
      required:
      - fromDate
      - toDate
      type: object
      properties:
        fromDate:
          type: string
          format: date
        toDate:
          type: string
          format: date
        account:
          $ref: '#/components/schemas/AccountIdentifier'
    EMRAccountResult:
      type: object
      properties:
        bic:
          type: string
        accountNumber:
          type: string
        scheme:
          type: string
        id:
          type: string
        country:
          type: string
        bank:
          $ref: '#/components/schemas/EMRBankResult'
        description:
          type: string
        currency:
          type: string
    EMRBalanceResult:
      type: object
      properties:
        amount:
          type: number
        debitOrCredit:
          type: string
    EMRBankResult:
      type: object
      properties:
        scheme:
          type: string
        id:
          type: string
    EMRContentResult:
      type: object
      properties:
        statement:
          $ref: '#/components/schemas/EMRStatementResult'
    EMRDateBalanceResult:
      type: object
      properties:
        date:
          type: string
          format: date
        balance:
          $ref: '#/components/schemas/EMRBalanceResult'
    EMRHeaderResult:
      type: object
      properties:
        sequenceNumber:
          type: integer
          format: int32
        orderingParty:
          $ref: '#/components/schemas/EMRPartyResult'
        summary:
          $ref: '#/components/schemas/EMRSummaryResult'
    EMRPartyResult:
      type: object
      properties:
        holderName:
          type: string
        account:
          $ref: '#/components/schemas/EMRAccountResult'
    EMRStatementResult:
      type: object
      properties:
        header:
          $ref: '#/components/schemas/EMRHeaderResult'
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/EMRTransactionResult'
    EMRSummaryResult:
      type: object
      properties:
        creditCount:
          type: integer
          format: int32
        creditTotal:
          type: number
        debitCount:
          type: integer
          format: int32
        debitTotal:
          type: number
        toDate:
          type: string
          format: date
        openingBalance:
          $ref: '#/components/schemas/EMRDateBalanceResult'
        closingBalance:
          $ref: '#/components/schemas/EMRDateBalanceResult'
    EMRTransactionResult:
      type: object
      properties:
        bookingDate:
          type: string
          format: date
        currency:
          type: string
        amount:
          type: number
        endToEndId:
          type: string
        counterParty:
          $ref: '#/components/schemas/EMRPartyResult'
        debitOrCredit:
          type: string
        structuredReference:
          type: string
        unstructuredReference:
          type: string
    EMRRequest:
      type: object
      properties:
        toDate:
          type: string
          format: date
        account:
          $ref: '#/components/schemas/AccountIdentifier'
    EMRResult:
      type: object
      properties:
        spaceId:
          type: string
          format: uuid
        statementId:
          type: string
          format: uuid
    MarkAsUnpaidData:
      type: object
      properties:
        comment:
          type: string
        reason:
          type: string
        email:
          type: string
        balanceOffsetIds:
          type: array
          items:
            type: string
            format: uuid
        sharePaymentStatus:
          type: boolean
    MarkAsUnpaidRequest:
      type: object
      properties:
        documents:
          type: array
          items:
            type: string
            format: uuid
        data:
          $ref: '#/components/schemas/MarkAsUnpaidData'
    MarkAsPaidData:
      type: object
      properties:
        comment:
          type: string
        paymentAmount:
          type: string
        paymentDate:
          type: string
        paymentReferenceNumber:
          type: string
        paymentMethod:
          type: string
          enum:
          - BANK_TRANSFER
          - CREDIT_CARD
          - DEBIT_CARD
          - CASH
          - OTHER
        sharePaymentStatus:
          type: boolean
    MarkAsPaidRequest:
      type: object
      properties:
        documents:
          type: array
          items:
            type: string
            format: uuid
        data:
          $ref: '#/components/schemas/MarkAsPaidData'
    DocumentActionResult:
      type: object
      properties:
        success:
          type: array
          items:
            type: string
            format: uuid
        failure:
          type: array
          items:
            type: string
            format: uuid
    AmountDto:
      type: object
      properties:
        value:
          type: string
        currency:
          type: string
    CounterPartyPaymentAccountInfo:
      required:
      - currency
      - identifier
      - scheme
      type: object
      properties:
        identifier:
          type: string
          description: Account Identifier
          example: BE83504010119715
        scheme:
          type: string
          description: Account Scheme
          example: IBAN
        bank:
          $ref: '#/components/schemas/BankIdentifier'
        country:
          pattern: ^[a-zA-Z]{2}
          type: string
          example: BE
        currency:
          pattern: '[A-Z]{3}'
          type: string
          description: International code ISO 4217 of the currency used
          example: EUR
        parent:
          $ref: '#/components/schemas/AccountIdentifier'
        ownerName:
          type: string
        alias:
          type: string
    DocumentModifierInfo:
      required:
      - connections
      - createdAt
      - folder
      - id
      - metadata
      type: object
      allOf:
      - $ref: '#/components/schemas/ModifierInfo'
      - type: object
        properties:
          id:
            type: string
            format: uuid
          folder:
            type: string
          category:
            type: string
          createdAt:
            type: string
            format: date-time
          metadata:
            $ref: '#/components/schemas/AggregationDocumentMetadata'
          connections:
            type: array
            items:
              $ref: '#/components/schemas/AggregationConnection'
    ModifierInfo:
      required:
      - matchType
      type: object
      properties:
        matchType:
          type: string
      discriminator:
        propertyName: matchType
        mapping:
          PAYMENT: '#/components/schemas/PaymentModifierInfo'
          DOCUMENT: '#/components/schemas/DocumentModifierInfo'
    ModifierMatchResult:
      type: object
      properties:
        modifier:
          oneOf:
          - $ref: '#/components/schemas/DocumentModifierInfo'
          - $ref: '#/components/schemas/PaymentModifierInfo'
        rule:
          type: string
    OwnerBankInfo:
      required:
      - identifier
      - scheme
      type: object
      properties:
        identifier:
          type: string
          description: Bank Identifier
          example: PANXBEB1XXX
        scheme:
          type: string
          description: Bank Identifier Scheme
          example: BIC
          enum:
          - BIC
          - CODE
          - THIRD_PARTY
        logoUrl:
          type: string
        financialPlatformName:
          type: string
        financialPlatformId:
          type: string
          format: uuid
    OwnerPaymentAccountInfo:
      required:
      - currency
      - identifier
      - scheme
      type: object
      properties:
        identifier:
          type: string
          description: Account Identifier
          example: BE83504010119715
        scheme:
          type: string
          description: Account Scheme
          example: IBAN
        bank:
          $ref: '#/components/schemas/OwnerBankInfo'
        country:
          pattern: ^[a-zA-Z]{2}
          type: string
          example: BE
        currency:
          pattern: '[A-Z]{3}'
          type: string
          description: International code ISO 4217 of the currency used
          example: EUR
        parent:
          $ref: '#/components/schemas/AccountIdentifier'
        ownerName:
          type: string
        alias:
          type: string
    PaymentModifierInfo:
      required:
      - amount
      - createdAt
      - id
      - openForRecon
      - operationType
      type: object
      allOf:
      - $ref: '#/components/schemas/ModifierInfo'
      - type: object
        properties:
          id:
            type: string
            format: uuid
          createdAt:
            type: string
            format: date-time
          operationType:
            type: string
            enum:
            - CREDIT
            - DEBIT
            - DOC_TO_DOC
          amount:
            $ref: '#/components/schemas/AmountDto'
          openForRecon:
            $ref: '#/components/schemas/AmountDto'
          paymentReference:
            type: string
          paymentCertaintyLevel:
            type: string
          paymentAccount:
            $ref: '#/components/schemas/OwnerPaymentAccountInfo'
          counterpartyPaymentAccount:
            $ref: '#/components/schemas/CounterPartyPaymentAccountInfo'
          data:
            type: object
            additionalProperties:
              type: string
    MarkAsUnpaidActionRequest:
      type: object
      properties:
        spaceId:
          type: string
          format: uuid
        documents:
          type: array
          items:
            type: string
            format: uuid
        data:
          $ref: '#/components/schemas/MarkAsUnpaidData'
    MarkAsPaidActionRequest:
      type: object
      properties:
        spaceId:
          type: string
          format: uuid
        documents:
          type: array
          items:
            type: string
            format: uuid
        data:
          $ref: '#/components/schemas/MarkAsPaidData'
    AggregationRequest:
      type: object
      properties:
        documentId:
          type: string
          format: uuid
        paymentId:
          type: string
          format: uuid
        modifierId:
          type: string
          format: uuid
        amount:
          type: string
        modifierType:
          type: string
          enum:
          - PAYMENT
          - DOCUMENT
          - CREDIT_NOTE
    ManageAggregationsRequest:
      type: object
      properties:
        matchRequests:
          type: array
          items:
            $ref: '#/components/schemas/AggregationRequest'
        unmatchRequests:
          type: array
          items:
            type: string
            format: uuid
    PaymentAccountInfo:
      type: object
      properties:
        identifier:
          type: string
        name:
          type: string
    PaymentAccountWithLogo:
      type: object
      properties:
        identifier:
          type: string
        name:
          type: string
        logo:
          type: string
        financialPlatformId:
          type: string
          format: uuid
    TransactionRadarAggregationWithPayable:
      required:
      - aggregationStatus
      - availableOperations
      - smartLink
      type: object
      properties:
        id:
          type: string
          format: uuid
        smartLink:
          type: boolean
        amount:
          $ref: '#/components/schemas/AmountDto'
        rule:
          type: string
        aggregationStatus:
          type: string
          enum:
          - PROPOSED
          - UNMATCHED
          - MATCHED
        availableOperations:
          type: array
          items:
            type: string
            enum:
            - ACCEPT
            - REJECT
            - MATCH
            - UNMATCH
            - EDIT
        payable:
          $ref: '#/components/schemas/TransactionRadarPayableInfo'
        payableType:
          type: string
          enum:
          - NOTE
          - DOCUMENT
          - UNMATCHED
    TransactionRadarPayableInfo:
      required:
      - documentDate
      - id
      type: object
      properties:
        id:
          type: string
          format: uuid
        operationType:
          type: string
          enum:
          - CREDIT
          - DEBIT
          - DOC_TO_DOC
        documentDate:
          type: string
          format: date
        name:
          type: string
        info:
          type: string
        paymentReference:
          type: string
        amountDue:
          $ref: '#/components/schemas/AmountDto'
        totalAmount:
          $ref: '#/components/schemas/AmountDto'
        projectedBalance:
          $ref: '#/components/schemas/AmountDto'
        url:
          type: string
    TransactionRadarPaymentAggregation:
      required:
      - amount
      - id
      - openForRecon
      - operationType
      - paymentDate
      type: object
      properties:
        id:
          type: string
          format: uuid
        paymentDate:
          type: string
          format: date
        operationType:
          type: string
          enum:
          - CREDIT
          - DEBIT
          - DOC_TO_DOC
        amount:
          $ref: '#/components/schemas/AmountDto'
        openForRecon:
          $ref: '#/components/schemas/AmountDto'
        paymentReference:
          type: string
        paymentCertaintyLevel:
          type: string
        paymentAccount:
          $ref: '#/components/schemas/PaymentAccountWithLogo'
        counterpartyPaymentAccount:
          $ref: '#/components/schemas/PaymentAccountInfo'
        aggregations:
          type: array
          items:
            $ref: '#/components/schemas/TransactionRadarAggregationWithPayable'
      description: List of payment aggregations
    TransactionRadarPaymentAggregationResponse:
      type: object
      properties:
        paymentAggregations:
          type: array
          items:
            $ref: '#/components/schemas/TransactionRadarPaymentAggregation'
        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
        totalAllElements:
          type: integer
          description: Total number of items regardless of matches
          format: int64
        totalMatchedElements:
          type: integer
          description: Total number of confirmed matches
          format: int64
        totalProposedElements:
          type: integer
          description: Total number of proposed matches
          format: int64
        totalUnmatchedElements:
          type: integer
          description: Total number of items that are not fully matched
          format: int64
    AggregationWithDocument:
      required:
      - aggregationStatus
      - availableOperations
      type: object
      allOf:
      - $ref: '#/components/schemas/AggregationWithPayable'
      - type: object
        properties:
          document:
            $ref: '#/components/schemas/DocumentInfo'
    AggregationWithNote:
      required:
      - aggregationStatus
      - availableOperations
      type: object
      allOf:
      - $ref: '#/components/schemas/AggregationWithPayable'
      - type: object
        properties:
          comment:
            type: string
    AggregationWithPayable:
      required:
      - aggregationStatus
      - availableOperations
      - payableType
      type: object
      properties:
        balanceOffset:
          $ref: '#/components/schemas/BalanceOffsetSummary'
        aggregationStatus:
          type: string
          enum:
          - PROPOSED
          - UNMATCHED
          - MATCHED
        availableOperations:
          type: array
          items:
            type: string
            enum:
            - ACCEPT
            - REJECT
            - MATCH
            - UNMATCH
            - EDIT
        payableType:
          type: string
      discriminator:
        propertyName: payableType
        mapping:
          NOTE: '#/components/schemas/AggregationWithNote'
          DOCUMENT: '#/components/schemas/AggregationWithNote'
    BalanceOffsetSummary:
      required:
      - smartLink
      type: object
      properties:
        id:
          type: string
          format: uuid
        smartLink:
          type: boolean
        amount:
          type: string
        currency:
          type: string
        rule:
          type: string
    PaymentAggregation:
      required:
      - amount
      - createdAt
      - id
      - openForRecon
      - operationType
      type: object
      properties:
        id:
          type: string
          format: uuid
        createdAt:
          type: string
          format: date-time
        operationType:
          type: string
          enum:
          - CREDIT
          - DEBIT
          - DOC_TO_DOC
        amount:
          $ref: '#/components/schemas/AmountDto'
        openForRecon:
          $ref: '#/components/schemas/AmountDto'
        paymentReference:
          type: string
        paymentCertaintyLevel:
          type: string
        paymentAccount:
          $ref: '#/components/schemas/OwnerPaymentAccountInfo'
        counterpartyPaymentAccount:
          $ref: '#/components/schemas/CounterPartyPaymentAccountInfo'
        data:
          type: object
          additionalProperties:
            type: string
        aggregations:
          type: array
          items:
            oneOf:
            - $ref: '#/components/schemas/AggregationWithPayable'
            - $ref: '#/components/schemas/AggregationWithDocument'
            - $ref: '#/components/schemas/AggregationWithNote'
      description: List of payment aggregations
    PaymentAggregationResponse:
      type: object
      properties:
        paymentAggregations:
          type: array
          items:
            $ref: '#/components/schemas/PaymentAggregation'
        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
        totalAllElements:
          type: integer
          description: Total number of items regardless of matches
          format: int64
        totalMatchedElements:
          type: integer
          description: Total number of confirmed matches
          format: int64
        totalProposedElements:
          type: integer
          description: Total number of proposed matches
          format: int64
        totalUnmatchedElements:
          type: integer
          description: Total number of items that are not fully matched
          format: int64
    AggregationWithModifier:
      required:
      - aggregationStatus
      - availableOperations
      type: object
      properties:
        balanceOffset:
          $ref: '#/components/schemas/BalanceOffsetSummary'
        aggregationStatus:
          type: string
          enum:
          - PROPOSED
          - UNMATCHED
          - MATCHED
        availableOperations:
          type: array
          items:
            type: string
            enum:
            - ACCEPT
            - REJECT
            - MATCH
            - UNMATCH
            - EDIT
        modifier:
          oneOf:
          - $ref: '#/components/schemas/DocumentModifierInfo'
          - $ref: '#/components/schemas/PaymentModifierInfo'
    DocumentAggregation:
      required:
      - connections
      - createdAt
      - folder
      - id
      - metadata
      type: object
      properties:
        id:
          type: string
          format: uuid
        folder:
          type: string
        category:
          type: string
        createdAt:
          type: string
          format: date-time
        metadata:
          $ref: '#/components/schemas/AggregationDocumentMetadata'
        connections:
          type: array
          items:
            $ref: '#/components/schemas/AggregationConnection'
        aggregations:
          type: array
          items:
            $ref: '#/components/schemas/AggregationWithModifier'
      description: List of document aggregations
    DocumentAggregationResponse:
      type: object
      properties:
        documentAggregations:
          type: array
          items:
            $ref: '#/components/schemas/DocumentAggregation'
        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
        totalAllElements:
          type: integer
          description: Total number of items regardless of matches
          format: int64
        totalMatchedElements:
          type: integer
          description: Total number of confirmed matches
          format: int64
        totalProposedElements:
          type: integer
          description: Total number of proposed matches
          format: int64
        totalUnmatchedElements:
          type: integer
          description: Total number of items that are not fully matched
          format: int64
  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.
