openapi: 3.0.1
info:
  title: documents_payment API
  description: Merged OpenAPI spec for documents_payment domain
  version: 1.0.0
servers:
- url: https://api.cve.btx.eu.banqup.com/documents/payment
paths:
  /pay/v1/spaces/{spaceId}/documents/{documentId}/balanceOffsets:
    get:
      tags:
      - Documents
      summary: Get balance offsets of a document
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get balance offsets of a document on the given space <br/> Scope: space_read'
      operationId: getDocumentBalanceOffsets
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document uuid identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentBalanceOffsetResultList'
              example:
                balanceOffsets:
                - id: e4ff010d-e7cd-4247-a71d-86dab3b6c59d
                  spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                  amount:
                    value: '20.25'
                    currency: EUR
                  offsetType: FULL
                  aggregationStatus: AUTO_CONFIRMED
                  createdAt: 2023-10-30 15:25:11+00:00
                  updatedAt: 2023-10-30 15:25:11+00:00
                  documentId: 10000000-0000-0000-0000-000000000000
                  metadata:
                    rule: PAYREF_EXACT
                    smartLink: 'true'
                  payment:
                    id: e5352e62-e833-4194-833e-526d3d9318ed
                    reference: Invoice BTX-00129
                    status:
                      global: initiated
                      paymentProcess: started
                    endToEndId: 0a2e9932-a660-4354-82a9-b5c0897f5887
                    levelOfCertainty: AUTHORISED
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Document not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
  /pay/v1/spaces/{spaceId}/documents:balanceOffsets:
    post:
      tags:
      - Documents
      summary: Retrieve document list balance offsets
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Retrieve the balance offsets of a list of documents in the given space,
        ordered by document id. <br/> Scope: space_read'
      operationId: retrieveDocumentListBalanceOffsets
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: List of relevant document identifiers
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentListBalanceOffsetRequest'
            example:
              documents:
              - 72da25ee-b2b8-4862-803d-fe00befa0951
              - 2ad154be-b6ac-49ac-a6a8-b20f3189e186
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentBalanceOffsetResultList'
              example:
                balanceOffsets:
                - id: e4ff010d-e7cd-4247-a71d-86dab3b6c59d
                  spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                  amount:
                    value: '20.25'
                    currency: EUR
                  offsetType: FULL
                  aggregationStatus: AUTO_CONFIRMED
                  createdAt: 2024-09-11 08:30:45+00:00
                  updatedAt: 2024-09-11 08:30:45+00:00
                  documentId: 72da25ee-b2b8-4862-803d-fe00befa0951
                  metadata:
                    rule: PAYREF_EXACT
                    smartLink: 'true'
                  payment:
                    id: e5352e62-e833-4194-833e-526d3d9318ed
                    reference: Invoice BTX-00129
                    status:
                      global: initiated
                      paymentProcess: started
                    endToEndId: 0a2e9932-a660-4354-82a9-b5c0897f5887
                    levelOfCertainty: AUTHORISED
                - id: 73e3de10-e800-4036-861e-0ac44788da54
                  spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                  amount:
                    value: '47.11'
                    currency: EUR
                  offsetType: FULL
                  aggregationStatus: AUTO_CONFIRMED
                  createdAt: 2024-09-12 15:25:11+00:00
                  updatedAt: 2024-09-12 15:25:11+00:00
                  documentId: 2ad154be-b6ac-49ac-a6a8-b20f3189e186
                  metadata:
                    rule: PAYREF_EXACT
                    smartLink: 'true'
                  payment:
                    id: e5352e62-e833-4194-833e-526d3d9318ed
                    reference: Invoice BTX-00129
                    status:
                      global: initiated
                      paymentProcess: started
                    endToEndId: 0a2e9932-a660-4354-82a9-b5c0897f5887
                    levelOfCertainty: AUTHORISED
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
  /transaction/v1/spaces/{spaceId}/documents:paydetails:
    post:
      tags:
      - Documents
      summary: Get documents payment details
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get documents payment details by the IDs on the given space <br/> Scope:
        space_read'
      operationId: getDocumentPaymentDetails
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Document Payment Details to request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentPaymentDetailsRequest'
            example:
              documents:
              - 00000004-0000-0000-0000-000000000000
        required: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentPaymentDetailsResultList'
              example:
                documents:
                - id: 00000001-0000-0000-0000-000000000000
                  metadata:
                    documentNumber: DN001
                    issueDate: 2024-01-01
                    dueDate: 2024-01-02
                    documentType: invoice
                    currencyCode: EUR
                    netAmount: '200.00'
                    vatAmount: '30.00'
                    grossAmount: '230.00'
                    openBalance: '230.00'
                    vatDetails:
                    - vatCode: AE
                      vatPercentage: '0'
                      netAmount: '100.00'
                      vatAmount: '10.00'
                    - vatCode: AE
                      vatPercentage: '20.00'
                      netAmount: '100.00'
                      vatAmount: '20.00'
                    - vatCode: AE
                      vatPercentage: '0.9'
                      netAmount: '100.00'
                      vatAmount: '20.00'
                    paymentReference:
                      value: 001/4037/32870
                      type: STRUCTURED
                      scheme: OGM_VCS
                    uploadId: '123456789'
                    delivery:
                      deliveryDate: 2024-01-01
                  status:
                    pay: FULLY_PAID
                  tasks:
                  - extensionName: com.unifiedpost.btx.data:approve
                    status: approve
                  supplier:
                    id: 06141394-72eb-4eed-bfa5-84caf4b78470
                    name: The Supplier
                    paymentAccounts:
                    - id: 0ca2797b-6365-4bf2-a490-247075e3cede
                      identifier: BE19519469892112
                      scheme: IBAN
                      country: BE
                      currency: EUR
                      bank:
                        identifier: ABNABE2AIDJ
                        scheme: BIC
                      spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                  category: INVOICE
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
  /transaction/v2/spaces/{spaceId}/documents:paydetails:
    post:
      tags:
      - Documents
      summary: Get documents payment details v2
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get documents payment details v2 by the IDs on the given space <br/>
        Scope: space_read'
      operationId: getDocumentPaymentDetailsV2
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Document Payment Details to request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentPaymentDetailsRequestV2'
            example:
              documents:
              - 00000004-0000-0000-0000-000000000000
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentPaymentDetailsResultListV2'
              example:
                documents:
                - id: 00000001-0000-0000-0000-000000000000
                  metadata:
                    $schema: https://btx.unifiedpost.com/btx/datastore/document/document_metadata/v1/document-metadata-schema.json
                    documentNumber: ABC002
                    issueDate: 2024-01-31
                    invoiceType: '380'
                    currencyCode: EUR
                    dueDate: 2024-03-30
                    buyerReference: CUST-001
                    contractReference: CONTRACT001
                    purchaseOrderReference: PO123
                    paymentTerms: Net 60
                    notes:
                    - code: AAA
                      text: Goods item description
                    invoiceReferences:
                    - invoiceReference: ABC002
                      issueDate: 2024-01-14
                      invoiceType: '380'
                    supplier:
                      legalName: Monte Carlo Ltd
                      tradingName: Monte Carlo Ltd
                      address:
                        streetName: Rue des Fleurs
                        buildingNumber: 22BIS
                        floor: Zone industrielle de la Ballastrierre Ouest
                        postBox: BP 40122
                        department: Service achat
                        city: LIBOURNE CEDEX
                        postalCode: '33506'
                        countryCode: FR
                      globalIdentifiers:
                        fr:siren: '349718288'
                        fr:siret: '34971828812345'
                        fr:vat: FR63349718288
                        global:email:
                        - montecarloltd@example.com
                        global:phoneNumber:
                        - '+1234567890'
                    customer:
                      legalName: Unifiedpost Group
                      tradingName: ?????????
                      address:
                        streetName: Bloemendalelaan
                        buildingNumber: 62/3
                        buildingName: Building West
                        floor: '4'
                        room: '47'
                        city: Maldegem
                        postalCode: '9990'
                        countryCode: BE
                      globalIdentifiers:
                        be:vat: BE0412887923
                        global:email:
                        - john@example.com
                        global:phoneNumber:
                        - '+1234567890'
                    delivery:
                      deliveryDate: 2024-01-31
                    prepaid:
                      paymentDate: 2024-08-15
                      code: '55'
                      text: 'Advance payment for order #12345'
                      paymentReference:
                        value: Prepaid invoice ABC002
                        type: UNSTRUCTURED
                    paymentMeans:
                    - code: '42'
                      text: PPayment to bank account, Belgian structured reference
                      paymentReference:
                        value: 001/4037/32870
                        type: STRUCTURED
                        scheme: OGM_VCS
                      paymentAccount:
                        identifier: FR3330002005500000157841Z25
                        scheme: IBAN
                        country: FR
                        currency: EUR
                        bank:
                          identifier: CRLYFRPP
                          scheme: BIC
                      paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-...-166eca6e81a7
                    allowances:
                    - netAmount: '150'
                      baseAmount: '1000'
                      percentage: '15'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Discount
                      reasonCode: '95'
                    charges:
                    - netAmount: '200'
                      baseAmount: '1000'
                      percentage: '20'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Advertising
                      reasonCode: AA
                    documentTotals:
                      netAmount: '1000'
                      vatAmount: '100'
                      grossAmount: '1100'
                      prepaidAmount: '500'
                      roundingDifference: '1100'
                      payableAmount: '600'
                    vatDetails:
                    - vatCategory: S
                      vatPercentage: '10'
                      netAmount: '1000'
                      vatAmount: '100'
                      exemptionReason: Medical supplies are exempt from VAT
                      exemptionReasonCode: VATEX-EU-79-C
                    uploadId: '123456789'
                    vatChargeableMethod: payment_date
                    vatAlreadyDeclared: true
                    processControl:
                      businessProcess: goods
                  status:
                    pay: FULLY_PAID
                  tasks:
                  - extensionName: com.unifiedpost.btx.data:approve
                    status: approve
                  supplier:
                    id: 06141394-72eb-4eed-bfa5-84caf4b78470
                    name: The Supplier
                    paymentAccounts:
                    - id: 0ca2797b-6365-4bf2-a490-247075e3cede
                      identifier: BE19519469892112
                      scheme: IBAN
                      country: BE
                      currency: EUR
                      bank:
                        identifier: ABNABE2AIDJ
                        scheme: BIC
                      spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                  category: INVOICE
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
  /business/v1/spaces/{spaceId}/documents:paymentSummary:
    post:
      description: "For each indicated document, a list of payments linked to it is\
        \ returned.\nPayments can be filtered by status so that clients can see all\
        \ payments, already executed payments or payments that are planned or in progress\
        \ but have not yet affected the open balance of the document.\n <br/> Scope:\
        \ space_read"
      operationId: createDocumentsPaymentSummary_1
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentsPaymentSummaryRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentsPaymentSummaryResult'
          description: Document payment details
      security:
      - oauth2:
        - space_read
      summary: Provides a summary of the payments that the selected document(s) may
        have produced
      tags:
      - Documents
  /business/v1/spaces/{spaceId}/payments/aggregations:
    get:
      description: 'Get list of aggregated payments on the given space. <br/> Scope:
        space_read'
      operationId: getAggregatedPayments
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - description: Zero-based page index, cannot be negative, default 0
        example: 0
        in: query
        name: page
        required: false
        schema:
          type: integer
          format: int32
          default: 0
          description: Zero-based page index, cannot be negative, default 0
          example: 0
          maximum: 10000
          minimum: 0
      - description: 'Page size. Minimum 1, maximum: 200, default 20'
        example: 20
        in: query
        name: size
        required: false
        schema:
          type: integer
          format: int32
          default: 20
          description: 'Page size. Minimum 1, maximum: 200, default 20'
          example: 20
          maximum: 200
          minimum: 1
      - description: Return the totalElements number of entries in the response
        example: true
        in: query
        name: includeTotalElements
        required: false
        schema:
          type: boolean
          default: true
          description: Return the totalElements number of entries in the response
          example: true
      - description: Sorting criteria
        in: query
        name: sortBy
        required: false
        schema:
          type: string
          description: Sorting criteria
          enum:
          - createdAt
          - createdAt.asc
          - createdAt.desc
          - createdAt
          - createdAt.asc
          - createdAt.desc
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentAggregationsResponse'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentAggregationsResponse'
          description: Bad Request
      security:
      - oauth2:
        - space_read
      summary: Get Aggregated Payments
      tags:
      - DocumentsPayment
  /business/v1/spaces/{spaceId}/payments/documents:execute:
    post:
      description: 'Executes a documents payment. <br/> Scope: space_read'
      operationId: executeDocumentsPayment_1
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentsPaymentExecutionRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentsPaymentExecutionResult'
          description: The redirect url to the bank's payment page.
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: The payment could not be executed due to an invalid request
      security:
      - oauth2:
        - space_read
      summary: Execute document payment
      tags:
      - DocumentsPayment
  /business/v1/spaces/{spaceId}/payments/documents:findCreditorAccount:
    post:
      description: 'Find a payment account stored on the spaced to which the payment
        of each of the selected documents should be made <br/> Scope: space_read'
      operationId: findCreditorAccountsForDocuments
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkDocumentRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentsCreditorAccountsList'
          description: A list of pairs (docId, creditorAccountId)
      security:
      - oauth2:
        - space_read
      summary: Find document creditor account
      tags:
      - DocumentsPayment
  /business/v1/spaces/{spaceId}/payments/documents:paymentSummary:
    post:
      description: "For each indicated document, a list of payments linked to it is\
        \ returned.\nPayments can be filtered by status so that clients can see all\
        \ payments, already executed payments or payments that are planned or in progress\
        \ but have not yet affected the open balance of the document.\n <br/> Scope:\
        \ space_read"
      operationId: createDocumentsPaymentSummary
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentsPaymentSummaryRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentsPaymentSummaryResult'
          description: Document payment details
      security:
      - oauth2:
        - space_read
      summary: Provides a summary of the payments that the selected document(s) may
        have produced
      tags:
      - DocumentsPayment
  /business/v1/spaces/{spaceId}/payments/documents:requestPayment:
    post:
      description: 'Creates payment requests for a list of documents <br/> Scope:
        space_read, space_write'
      operationId: createDocumentsPaymentRequests
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentsPaymentRequestsCreateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentsPaymentRequestsResponse'
          description: The list of payment requests
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: The payment requests could not be created due to an invalid
            request
      security:
      - oauth2:
        - space_read
        - space_write
      summary: Create documents payment requests
      tags:
      - DocumentsPaymentRequests
  /business/v1/spaces/{spaceId}/payments/documents:validate:
    post:
      description: 'Validate a document payment. <br/> Scope: space_read'
      operationId: validateDocumentsPaymentV1
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentsPaymentRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentsPaymentValidationResultV1'
          description: The result of the validation
      security:
      - oauth2:
        - space_read
      summary: Validate document payment
      tags:
      - DocumentsPayment
  /business/v1/spaces/{spaceId}/payments/{paymentId}:
    get:
      description: 'Get the payment status and the associated documents. <br/> Scope:
        space_read'
      operationId: getPaymentDetails_1
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: paymentId
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentsPaymentV1'
          description: The payment details
      security:
      - oauth2:
        - space_read
      summary: Get Payment Details
      tags:
      - DocumentsPayment
  /business/v2/spaces/{spaceId}/payments/documents:execute:
    post:
      description: 'Executes a documents payment. <br/> Scope: space_read'
      operationId: executeDocumentsPayment
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentsPaymentExecutionRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentsPaymentExecutionResult'
          description: The redirect url to the bank's payment page.
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: The payment could not be executed due to an invalid request
      security:
      - oauth2:
        - space_read
      summary: Execute document payment
      tags:
      - documents-payment-controller
  /business/v2/spaces/{spaceId}/payments/documents:validate:
    post:
      description: 'Validate a document payment. <br/> Scope: space_read'
      operationId: validateDocumentsPayment
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentsPaymentRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentsPaymentValidationResult'
          description: The result of the validation
      security:
      - oauth2:
        - space_read
      summary: Validate document payment
      tags:
      - documents-payment-controller
  /business/v2/spaces/{spaceId}/payments/{paymentId}:
    get:
      description: 'Get the payment status and the associated documents. <br/> Scope:
        space_read'
      operationId: getPaymentDetails
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: paymentId
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentsPayment'
          description: The payment details
      security:
      - oauth2:
        - space_read
      summary: Get Payment Details
      tags:
      - documents-payment-controller
components:
  schemas:
    JsonBMap:
      type: object
      additionalProperties: true
    JsonBMapNullable:
      type: object
      additionalProperties: true
      nullable: true
    PatchRequest:
      type: array
      items:
        $ref: '#/components/schemas/PatchDocument'
    PatchDocument:
      required:
      - op
      - path
      type: object
      properties:
        op:
          type: string
          description: The operation to be performed
          enum:
          - add
          - remove
          - replace
          - move
          - copy
          - test
        path:
          type: string
          description: A JSON-Pointer
        value:
          type: object
          description: The value to be used within the operations.
        from:
          type: string
          description: A string containing a JSON Pointer value.
      description: A JSONPatch document as defined by RFC 6902
    AggregationStatus:
      type: string
      description: Status determined by aggregation
      example: AUTO_CONFIRMED
      enum:
      - PROPOSED
      - AUTO_CONFIRMED
      - USER_CONFIRMED
      - REJECTED
    AmountDto:
      type: object
      properties:
        value:
          type: string
          description: Amount value with a maximum of 14 integer digits and 2 fractional
            digits
          example: '10.05'
        currency:
          pattern: '[A-Z]{3}'
          type: string
          description: International code of the currency used
          example: EUR
      required:
      - currency
      - value
    BalanceOffsetPayableType:
      type: string
      description: Discriminator to determine the payable type.
      example: document
      enum:
      - document
      - note
      - payment
    BalanceOffsetResult:
      required:
      - aggregationStatus
      - offsetType
      - paymentId
      type: object
      properties:
        payableType:
          $ref: '#/components/schemas/BalanceOffsetPayableType'
        id:
          type: string
          description: id of balance offset
          format: uuid
        spaceId:
          type: string
          description: Space id
          format: uuid
        paymentId:
          type: string
          description: Payment id
          format: uuid
        amount:
          $ref: '#/components/schemas/AmountDto'
        offsetType:
          $ref: '#/components/schemas/BalanceOffsetType'
        aggregationStatus:
          $ref: '#/components/schemas/AggregationStatus'
        createdAt:
          type: string
          description: creation datetime
          format: date-time
        updatedAt:
          type: string
          description: updated datetime
          format: date-time
        metadata:
          $ref: '#/components/schemas/JsonBMap'
      discriminator:
        propertyName: payableType
        mapping:
          document: '#/components/schemas/DocumentBalanceOffsetResult'
          note: '#/components/schemas/NoteBalanceOffsetResult'
          payment: '#/components/schemas/PaymentBalanceOffsetResult'
    BalanceOffsetType:
      type: string
      description: Type of balance offset
      example: PARTIAL
      enum:
      - FULL
      - PARTIAL
      - DISCOUNT
      - REFUND
      - TIP
      - UNDERPAYMENT
      - OVERPAYMENT
      - FEE
    DocumentBalanceOffsetResult:
      required:
      - aggregationStatus
      - documentId
      - offsetType
      - paymentId
      type: object
      allOf:
      - $ref: '#/components/schemas/BalanceOffsetResult'
      - type: object
        properties:
          documentId:
            type: string
            description: Document id
            format: uuid
    NoteBalanceOffsetResult:
      required:
      - aggregationStatus
      - offsetType
      - paymentId
      type: object
      allOf:
      - $ref: '#/components/schemas/BalanceOffsetResult'
      - type: object
        properties:
          comment:
            type: string
            description: Comment on the note balance offset.
    PaymentBalanceOffsetResult:
      required:
      - aggregationStatus
      - counterpartyPaymentId
      - offsetType
      - paymentId
      type: object
      allOf:
      - $ref: '#/components/schemas/BalanceOffsetResult'
      - type: object
        properties:
          counterpartyPaymentId:
            type: string
            description: Counterparty payment id
            format: uuid
    ApiErrorProblemDetail:
      required:
      - error
      - requestId
      - timestamp
      type: object
      properties:
        status:
          type: integer
          format: int32
        error:
          type: string
        requestId:
          type: string
        timestamp:
          type: string
          format: date-time
        type:
          type: string
          format: uri
        title:
          type: string
        detail:
          type: string
        instance:
          type: string
          format: uri
        problems:
          type: array
          items:
            $ref: '#/components/schemas/NestedProblem'
        properties:
          type: object
          additionalProperties:
            type: object
    NestedProblem:
      required:
      - detail
      - error
      - title
      type: object
      properties:
        error:
          type: string
        title:
          type: string
        detail:
          type: string
        type:
          type: string
          format: uri
    BalanceOffsetRequest:
      required:
      - aggregationStatus
      - offsetType
      - payableType
      type: object
      properties:
        payableType:
          $ref: '#/components/schemas/BalanceOffsetPayableType'
        paymentId:
          type: string
          description: Payment id associated to the balance offset.
          format: uuid
        amount:
          $ref: '#/components/schemas/AmountDto'
        offsetType:
          $ref: '#/components/schemas/BalanceOffsetType'
        aggregationStatus:
          $ref: '#/components/schemas/AggregationStatus'
        metadata:
          $ref: '#/components/schemas/JsonBMap'
      discriminator:
        propertyName: payableType
        mapping:
          document: '#/components/schemas/DocumentBalanceOffsetRequest'
          note: '#/components/schemas/NoteBalanceOffsetRequest'
          payment: '#/components/schemas/PaymentBalanceOffsetRequest'
    DocumentBalanceOffsetRequest:
      required:
      - aggregationStatus
      - documentId
      - offsetType
      - payableType
      type: object
      allOf:
      - $ref: '#/components/schemas/BalanceOffsetRequest'
      - type: object
        properties:
          documentId:
            type: string
            description: Document id associated to the balance offset.
            format: uuid
    NoteBalanceOffsetRequest:
      required:
      - aggregationStatus
      - comment
      - offsetType
      - payableType
      type: object
      allOf:
      - $ref: '#/components/schemas/BalanceOffsetRequest'
      - type: object
        properties:
          comment:
            type: string
            description: Comment on the note balance offset.
    PaymentBalanceOffsetRequest:
      required:
      - aggregationStatus
      - counterpartyPaymentId
      - offsetType
      - payableType
      type: object
      allOf:
      - $ref: '#/components/schemas/BalanceOffsetRequest'
      - type: object
        properties:
          counterpartyPaymentId:
            type: string
            description: Counterparty payment id associated to the balance offset.
            format: uuid
    DocumentBalanceOffsetResultList:
      required:
      - balanceOffsets
      type: object
      properties:
        balanceOffsets:
          type: array
          description: balanceOffsets of given document
          items:
            $ref: '#/components/schemas/DocumentBalanceOffsetWithPaymentDetailsResult'
    DocumentBalanceOffsetWithPaymentDetailsResult:
      type: object
      properties:
        id:
          type: string
          description: id of balance offset
          format: uuid
        spaceId:
          type: string
          description: Space id
          format: uuid
        amount:
          $ref: '#/components/schemas/AmountDto'
        offsetType:
          $ref: '#/components/schemas/BalanceOffsetType'
        aggregationStatus:
          $ref: '#/components/schemas/AggregationStatus'
        createdAt:
          type: string
          description: creation datetime
          format: date-time
        updatedAt:
          type: string
          description: updated datetime
          format: date-time
        documentId:
          type: string
          description: Document id
          format: uuid
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        payment:
          $ref: '#/components/schemas/PaymentDetails'
      description: balanceOffsets of given document
    LevelOfCertainty:
      type: string
      description: Level of certainty
      example: INFORMATIONAL
      enum:
      - REQUESTED
      - INFORMATIONAL
      - INITIATED
      - AUTHORISED
      - TRANSACTION_SUCCESSFUL
      - PLANNED
      - RESERVED
      - BOOKED_REVERSIBLE
      - BOOKED_GUARANTEED
      - ABANDONED
      - NOT_APPLICABLE
    PaymentDetails:
      required:
      - status
      type: object
      properties:
        id:
          type: string
          description: id of payment
          format: uuid
        reference:
          type: string
          description: Reference details filled in by the payer when making the payment.
            It can have a fixed format depending on the country.
        status:
          $ref: '#/components/schemas/JsonBMap'
        endToEndId:
          type: string
          description: End to end id, according to PSD2 directive.
        levelOfCertainty:
          $ref: '#/components/schemas/LevelOfCertainty'
      description: Details of the payment
    UpdateBalanceOffsetRequest:
      required:
      - aggregationStatus
      - payableType
      type: object
      properties:
        aggregationStatus:
          $ref: '#/components/schemas/AggregationStatus'
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        payableType:
          type: string
      discriminator:
        propertyName: payableType
        mapping:
          document: '#/components/schemas/UpdateDocumentBalanceOffsetRequest'
          note: '#/components/schemas/UpdateNoteBalanceOffsetRequest'
          payment: '#/components/schemas/UpdatePaymentBalanceOffsetRequest'
    UpdateDocumentBalanceOffsetRequest:
      required:
      - aggregationStatus
      type: object
      allOf:
      - $ref: '#/components/schemas/UpdateBalanceOffsetRequest'
    UpdateNoteBalanceOffsetRequest:
      required:
      - aggregationStatus
      type: object
      allOf:
      - $ref: '#/components/schemas/UpdateBalanceOffsetRequest'
      - type: object
        properties:
          comment:
            type: string
            description: Comment on the note balance offset.
    UpdatePaymentBalanceOffsetRequest:
      required:
      - aggregationStatus
      type: object
      allOf:
      - $ref: '#/components/schemas/UpdateBalanceOffsetRequest'
    DocumentListBalanceOffsetRequest:
      type: object
      properties:
        documents:
          type: array
          description: List of document ids
          items:
            type: string
            description: Document id
            format: uuid
    AccountIdentifier:
      type: object
      properties:
        identifier:
          type: string
          description: Account Identifier
          example: BE83504010119715
          minLength: 1
        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'
      description: Parent payment account
      required:
      - currency
      - identifier
      - scheme
    BankIdentifier:
      type: object
      properties:
        identifier:
          type: string
          description: Bank Identifier
          example: PANXBEB1XXX
          minLength: 1
        scheme:
          type: string
          description: Bank Identifier Scheme
          example: BIC
          enum:
          - BIC
          - CODE
          - ABA
          - CLABE
          - THIRD_PARTY
      description: Information about the issuer of the account
      required:
      - identifier
      - scheme
    DocumentCategory:
      type: string
      description: Document category
      example: PURCHASE_ORDER
      enum:
      - PURCHASE_ORDER
      - ORDER_CONFIRMATION
      - DELIVERY_NOTE
      - GOODS_RECEIVED_NOTE
      - PROFORMA_INVOICE
      - INVOICE
      - INVOICE_REMINDER
      - CREDIT_NOTE
      - RECEIPT
      - STATEMENT
      - FILE
      - QUOTE
      - CREDIT_CARD_STATEMENT
      - THIRD_PARTY_STATEMENT
      - SELF_BILLED_INVOICE
      - SELF_BILLED_CREDIT_NOTE
      - OTHER
    DocumentPaymentDetailsListItem:
      required:
      - status
      type: object
      properties:
        id:
          type: string
          description: id of document
          format: uuid
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        status:
          $ref: '#/components/schemas/JsonBMap'
        tasks:
          type: array
          description: tasks
          items:
            $ref: '#/components/schemas/TaskResult'
        supplier:
          $ref: '#/components/schemas/Supplier'
        category:
          $ref: '#/components/schemas/DocumentCategory'
    DocumentPaymentDetailsResultList:
      type: object
      properties:
        documents:
          type: array
          description: List of response document payment details
          items:
            $ref: '#/components/schemas/DocumentPaymentDetailsListItem'
    Iso20022StructuredAddress:
      type: object
      properties:
        country:
          type: string
          description: Nation with its own government, expressed as a two letter ISO
            3166 code (alpha-2) of the country. The country code is written in upper
            case.
          example: BE
        townName:
          type: string
          description: Name of a built-up area, with defined boundaries, and a local
            government.
          example: La Hulpe
        addressType:
          type: string
          description: Identifies the nature of the postal address.
          example: ADDR
          enum:
          - ADDR
          - PBOX
          - HOME
          - BIZZ
          - MLTO
          - DLVY
        streetName:
          maxLength: 140
          type: string
          description: Name of a street or thoroughfare.
          example: Avenue Reine Astrid
        buildingNumber:
          maxLength: 16
          type: string
          description: A unique number assigned to the building in the street or area
            //Number that identifies the position of a building on a street.
          example: '40'
        careOf:
          maxLength: 140
          type: string
          description: Identifies an addressee that is accepting the correspondence
            for the intended recipient. Using care of ensures the correspondence reaches
            the right recipient rather than getting returned to the sender.
          example: Finance
        department:
          maxLength: 70
          type: string
          description: Identification of a division of a large organisation or building.
          example: Finance
        subDepartment:
          maxLength: 70
          type: string
          description: Identification of a sub-division of a large organisation or
            building.
          example: Accounting
        buildingName:
          maxLength: 140
          type: string
          description: Name of the building or house.
          example: Empire State Building
        floor:
          maxLength: 70
          type: string
          description: Floor or storey within a building.
          example: ground
        unitNumber:
          maxLength: 16
          type: string
          description: Identifies a flat or dwelling within the building.
          example: '2'
        postBox:
          maxLength: 16
          type: string
          description: Numbered box in a post office, assigned to a person or organisation,
            where letters are kept until called for.
          example: '1003'
        room:
          maxLength: 70
          type: string
          description: Building room number.
          example: '2.22'
        postCode:
          maxLength: 16
          type: string
          description: Identifier consisting of a group of letters and/or numbers
            that is added to a postal address to assist the sorting of mail.
          example: '1310'
        townLocationName:
          maxLength: 140
          type: string
          description: Specific location name within the town. eg Borough (USA), Village
            (GB).
          example: Miami Beach
        districtName:
          maxLength: 140
          type: string
          description: Identifies a subdivision within a country sub-division eg County
            (USA), Landkreis (DE).
          example: Miami-Dade, Coburg
        countrySubDivision:
          maxLength: 35
          type: string
          description: Identifies a subdivision of a country such as state (USA),
            Bundesland (DE), region, province,....
          example: Florida, Bayern, Wallonia, Hainaut
      description: Information that locates and identifies a specific address, as
        defined by postal services
      externalDocs:
        description: More about EPC Interbank Structured Address Structure; see also
          PostalAddress27 type in https://www.iso20022.org/message/22905/download
        url: https://www.europeanpaymentscouncil.eu/sites/default/files/kb/file/2022-10/EPC153-22%20EPC%20guidance%20document%20-%20Use%20of%20Structured%20Address%20under%20the%20SEPA%20Payment%20Schemes%20as%20of%20Nov%202025.pdf
    PaymentAccountListItem:
      type: object
      properties:
        id:
          type: string
          description: Payment account ID
          format: uuid
        identifier:
          type: string
          description: Identifier of the payment account
        scheme:
          type: string
          description: Scheme of the payment account
        country:
          type: string
          description: Country for the payment account
        currency:
          type: string
          description: Currency for the payment account
        bank:
          $ref: '#/components/schemas/BankIdentifier'
        spaceId:
          type: string
          description: Space id
          format: uuid
        ownedBySpace:
          type: boolean
          description: Flag to indicate if the space is the actual holder of the payment
            account.
        active:
          type: boolean
          description: Flag to indicate if the payment account is active or not.
        ownerName:
          type: string
          description: Name of owner.
        address:
          $ref: '#/components/schemas/Iso20022StructuredAddress'
        parent:
          $ref: '#/components/schemas/AccountIdentifier'
        financialPlatformId:
          type: string
          description: Optional identifier of the financial platform.
      description: List of payment accounts
    Supplier:
      type: object
      properties:
        type:
          type: string
          description: Type of supplier (business/person).
          example: business
        id:
          type: string
          description: the supplier id
        name:
          type: string
          description: the supplier name
        paymentAccounts:
          type: array
          description: List of payment accounts
          items:
            $ref: '#/components/schemas/PaymentAccountListItem'
      description: Supplier of the document
    TaskResult:
      type: object
      properties:
        extensionName:
          type: string
          description: extension name
          example: com.unifiedpost.btx.data:approve
        status:
          type: string
          description: extension status
          example: approve
        context:
          $ref: '#/components/schemas/JsonBMap'
      description: tasks
    DocumentPaymentDetailsRequest:
      type: object
      properties:
        documents:
          type: array
          description: List of document IDs
          format: uuid
          items:
            type: string
            description: List of document IDs
            format: uuid
    DocumentPaymentDetailsListItemV2:
      required:
      - status
      type: object
      properties:
        id:
          type: string
          description: id of document
          format: uuid
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        status:
          $ref: '#/components/schemas/JsonBMap'
        tasks:
          type: array
          description: tasks
          items:
            $ref: '#/components/schemas/TaskResult'
        supplier:
          $ref: '#/components/schemas/Supplier'
        category:
          $ref: '#/components/schemas/DocumentCategory'
    DocumentPaymentDetailsResultListV2:
      type: object
      properties:
        documents:
          type: array
          description: List of response document payment details
          items:
            $ref: '#/components/schemas/DocumentPaymentDetailsListItemV2'
    DocumentPaymentDetailsRequestV2:
      type: object
      properties:
        documents:
          type: array
          description: List of document IDs
          items:
            type: string
            format: uuid
    BalanceOffset:
      type: object
      properties:
        amount:
          $ref: '#/components/schemas/AmountDto'
        id:
          type: string
          format: uuid
      required:
      - id
    BalanceOffsetSummary:
      type: object
      description: Balance offset summary
      properties:
        id:
          type: string
          format: uuid
      required:
      - id
    BulkDocumentRequest:
      type: object
      properties:
        documentIds:
          type: array
          items:
            type: string
            format: uuid
    Creditor:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
      required:
      - id
      - name
    DocumentCreditorAccountSuggestion:
      type: object
      properties:
        creditorAccountId:
          type: string
          format: uuid
        documentId:
          type: string
          format: uuid
    DocumentPaymentRequest:
      type: object
      properties:
        amount:
          $ref: '#/components/schemas/AmountDto'
        documentId:
          type: string
          format: uuid
        paymentId:
          type: string
          format: uuid
        paymentRequestId:
          type: string
          format: uuid
        paymentRequestLinks:
          $ref: '#/components/schemas/PaymentRequestLinks'
        status:
          type: string
          enum:
          - OPEN
          - PAID
          - PARTIALLY_PAID
          - ALMOST_DUE
          - PAST_DUE
          - SUSPENDED
          - EXPIRED
          - SUBMITTED
          - UNKNOWN
          - FAILED
          - PAID_REQUESTED
          - CANCELLED
      required:
      - amount
      - documentId
      - paymentId
      - paymentRequestId
      - paymentRequestLinks
      - status
    DocumentPaymentSummary:
      type: object
      properties:
        documentId:
          type: string
          format: uuid
        payments:
          type: array
          items:
            $ref: '#/components/schemas/PaymentSummary'
      required:
      - documentId
      - payments
    DocumentValidationMessage:
      type: object
      properties:
        code:
          type: string
          enum:
          - MISSING_CREDITOR_ACCOUNT
          - NEGATIVE_OPEN_BALANCE
          - CURRENCY_MISMATCH
          - NOT_PAYABLE
          - DUPLICATE_E2E_IDENTIFICATION
          - PARTIAL_AMOUNT_GREATER_THAN_PAYABLE
          - OPEN_PAYMENT_EXISTS
          - PLANNED_PAYMENT_EXISTS
          - IN_TRANSIT_PAYMENT_EXISTS
          - DOCUMENT_SUGGESTED_PAYMENT_ACCOUNTS_PRESENT_BUT_IGNORED
          - NEW_PAYMENT_MEANS_ACCOUNT_DETECTED
        data:
          type: object
        type:
          type: string
          enum:
          - INFO
          - WARNING
          - ERROR
      required:
      - code
      - type
    DocumentValidationMessageV1:
      type: object
      properties:
        code:
          type: string
          enum:
          - MISSING_CREDITOR_ACCOUNT
          - NEGATIVE_OPEN_BALANCE
          - CURRENCY_MISMATCH
          - NOT_PAYABLE
          - DUPLICATE_E2E_IDENTIFICATION
          - PARTIAL_AMOUNT_GREATER_THAN_PAYABLE
          - OPEN_PAYMENT_EXISTS
          - PLANNED_PAYMENT_EXISTS
          - IN_TRANSIT_PAYMENT_EXISTS
          - DOCUMENT_SUGGESTED_PAYMENT_ACCOUNTS_PRESENT_BUT_IGNORED
          - NEW_PAYMENT_MEANS_ACCOUNT_DETECTED
        data:
          type: object
        type:
          type: string
          enum:
          - INFO
          - WARNING
          - ERROR
      required:
      - code
      - type
    DocumentValidationMessages:
      type: object
      properties:
        id:
          type: string
          format: uuid
        messages:
          type: array
          items:
            $ref: '#/components/schemas/DocumentValidationMessage'
      required:
      - id
      - messages
    DocumentValidationMessagesV1:
      type: object
      properties:
        id:
          type: string
          format: uuid
        messages:
          type: array
          items:
            $ref: '#/components/schemas/DocumentValidationMessageV1'
      required:
      - id
      - messages
    DocumentsCreditorAccountsList:
      type: object
      properties:
        documents:
          type: array
          items:
            $ref: '#/components/schemas/DocumentCreditorAccountSuggestion'
    DocumentsPayment:
      type: object
      properties:
        counterPartyAmount:
          $ref: '#/components/schemas/AmountDto'
        documents:
          type: array
          description: The list of documents that were paid in this payment. Note
            that this list can be empty if aggregation is still ongoing.
          items:
            $ref: '#/components/schemas/DocumentsPaymentDocument'
        id:
          type: string
          format: uuid
        originatingPartyAmount:
          $ref: '#/components/schemas/AmountDto'
        requestedExecutionDate:
          type: string
          format: date
        status:
          type: string
          enum:
          - RECEIVED
          - OPEN
          - IN_TRANSIT
          - SUCCESSFUL
          - FAILED
          - CANCELED
          - UNKNOWN
          - PLANNED
        statusReason:
          type: array
          items:
            type: string
      required:
      - counterPartyAmount
      - documents
      - id
      - originatingPartyAmount
      - status
      - statusReason
    DocumentsPaymentDocument:
      type: object
      description: The list of documents that were paid in this payment. Note that
        this list can be empty if aggregation is still ongoing.
      properties:
        creditor:
          $ref: '#/components/schemas/Creditor'
        documentNumber:
          type: string
          minLength: 1
        id:
          type: string
          format: uuid
        paymentRelatedBalanceOffset:
          $ref: '#/components/schemas/BalanceOffset'
      required:
      - creditor
      - documentNumber
      - id
      - paymentRelatedBalanceOffset
    DocumentsPaymentExecutionRequest:
      type: object
      properties:
        acceptedFeeId:
          type: string
          format: uuid
          description: 'Identifier of the fee associated with the payment.

            If applicable, will be returned by the validation endpoint.'
        bulk:
          type: boolean
        documents:
          type: array
          items:
            $ref: '#/components/schemas/DocumentsPaymentRequestDocument'
          minItems: 1
        language:
          type: string
          deprecated: true
          description: This field is deprecated, please use locale instead.
        locale:
          type: string
          description: The locale to use on web pages presented to the user
          example: nl, NL, NL-NL, nl-NL, nl-BE, NL-BE
        paymentAccountId:
          type: string
          format: uuid
        redirectUrl:
          type: string
          format: uri
          description: URL to redirect the user to, once the flow is completed
          example: https://app.btx.banqup.com/paymentAccounts
        requestedExecutionDate:
          type: string
          format: date
          description: The requested execution date
          example: 2024-10-10
      required:
      - documents
      - paymentAccountId
      - redirectUrl
    DocumentsPaymentExecutionResult:
      type: object
      properties:
        paymentId:
          type: string
          format: uuid
        redirectUrl:
          type: string
          minLength: 1
      required:
      - paymentId
      - redirectUrl
    DocumentsPaymentRequest:
      type: object
      properties:
        acceptedFeeId:
          type: string
          format: uuid
          description: 'Identifier of the fee associated with the payment.

            If applicable, will be returned by the validation endpoint.'
        bulk:
          type: boolean
        documents:
          type: array
          items:
            $ref: '#/components/schemas/DocumentsPaymentRequestDocument'
          minItems: 1
        language:
          type: string
          deprecated: true
          description: This field is deprecated, please use locale instead.
        locale:
          type: string
          description: The locale to use on web pages presented to the user
          example: nl, NL, NL-NL, nl-NL, nl-BE, NL-BE
        paymentAccountId:
          type: string
          format: uuid
        requestedExecutionDate:
          type: string
          format: date
          description: The requested execution date
          example: 2024-10-10
      required:
      - documents
      - paymentAccountId
    DocumentsPaymentRequestDocument:
      type: object
      properties:
        creditorPaymentAccountId:
          type: string
          format: uuid
        creditorVerificationId:
          type: string
        endToEndIdentification:
          type: string
          maxLength: 35
          minLength: 0
        id:
          type: string
          format: uuid
        partialPaymentAmount:
          type: string
          description: Partial Payment Amount value specified in the same currency
            as the document's open balance
          example: '1.99'
          exclusiveMinimum: true
          maximum: 99999999999999.98
          minimum: 0
          pattern: ^\d{1,14}(\.\d{1,2})?$
      required:
      - id
    DocumentsPaymentRequestsCreateRequest:
      type: object
      properties:
        collect:
          $ref: '#/components/schemas/PaymentCollectInstruction'
        documentIds:
          type: array
          items:
            type: string
            format: uuid
          minItems: 1
      required:
      - documentIds
    DocumentsPaymentRequestsResponse:
      type: object
      properties:
        documentsPaymentRequests:
          type: array
          items:
            $ref: '#/components/schemas/DocumentPaymentRequest'
          minItems: 1
      required:
      - documentsPaymentRequests
    DocumentsPaymentSummaryRequest:
      type: object
      properties:
        acceptedPaymentStatuses:
          type: array
          description: Specify the status of payments included into the summary. When
            null, all payments related to document are included
          items:
            type: string
            description: Specify the status of payments included into the summary.
              When null, all payments related to document are included
            enum:
            - RECEIVED
            - OPEN
            - IN_TRANSIT
            - SUCCESSFUL
            - FAILED
            - CANCELED
            - UNKNOWN
            - PLANNED
          uniqueItems: true
        documentIds:
          type: array
          description: List of documents for which the summary is requested
          items:
            type: string
            format: uuid
            description: List of documents for which the summary is requested
          maxItems: 100
          minItems: 0
      required:
      - documentIds
    DocumentsPaymentSummaryResult:
      type: object
      properties:
        documents:
          type: array
          items:
            $ref: '#/components/schemas/DocumentPaymentSummary'
          minItems: 1
      required:
      - documents
    DocumentsPaymentV1:
      type: object
      properties:
        amount:
          $ref: '#/components/schemas/AmountDto'
        documents:
          type: array
          description: The list of documents that were paid in this payment. Note
            that this list can be empty if aggregation is still ongoing.
          items:
            $ref: '#/components/schemas/DocumentsPaymentDocument'
        id:
          type: string
          format: uuid
        requestedExecutionDate:
          type: string
          format: date
        status:
          type: string
          enum:
          - RECEIVED
          - OPEN
          - IN_TRANSIT
          - SUCCESSFUL
          - FAILED
          - CANCELED
          - UNKNOWN
          - PLANNED
        statusReason:
          type: array
          items:
            type: string
      required:
      - amount
      - documents
      - id
      - status
      - statusReason
    DocumentsPaymentValidationMessages:
      type: object
      properties:
        documentsMessages:
          type: array
          items:
            $ref: '#/components/schemas/DocumentValidationMessages'
        paymentMessages:
          type: array
          items:
            $ref: '#/components/schemas/PaymentValidationMessage'
      required:
      - documentsMessages
      - paymentMessages
    DocumentsPaymentValidationMessagesV1:
      type: object
      properties:
        documentsMessages:
          type: array
          items:
            $ref: '#/components/schemas/DocumentValidationMessagesV1'
        documentsPaymentErrors:
          type: array
          items:
            type: string
            enum:
            - MISSING_DEBTOR_ACCOUNT
            - INVALID_CURRENCY
            - PIS_NOT_SUPPORTED
            - FINANCIAL_PLATFORM_UNKNOWN
            - MISSING_PAYABLE_ITEM
            - BULK_PAYMENT_NOT_SUPPORTED
            - DUPLICATE_PAYABLE_ITEM_ID
            - FUTURE_EXECUTION_DATE_NOT_SUPPORTED
            - UNACCEPTABLE_FUTURE_EXECUTION_DATE
            - PARTIAL_PAYMENT_NOT_SUPPORTED
            - NEW_FEE_DETECTED
            - FEE_MISMATCH_OR_EXPIRED
            - FAILED_CONTEXT_VALIDATION
      required:
      - documentsMessages
      - documentsPaymentErrors
    DocumentsPaymentValidationResult:
      type: object
      properties:
        status:
          type: string
          enum:
          - VALID
          - VALID_WITH_WARNINGS
          - INVALID
        validationResult:
          $ref: '#/components/schemas/DocumentsPaymentValidationMessages'
      required:
      - status
      - validationResult
    DocumentsPaymentValidationResultV1:
      type: object
      properties:
        status:
          type: string
          enum:
          - VALID
          - VALID_WITH_WARNINGS
          - INVALID
        validationResult:
          $ref: '#/components/schemas/DocumentsPaymentValidationMessagesV1'
      required:
      - status
      - validationResult
    PaymentAggregation:
      type: object
      description: Payment aggregation with matching details
      properties:
        aggregationStatus:
          type: string
          description: Aggregation status
          enum:
          - PROPOSED
          - UNMATCHED
          - MATCHED
        amount:
          $ref: '#/components/schemas/AmountDto'
        availableOperations:
          type: array
          items:
            type: string
            description: Available operations for payment aggregation
            enum:
            - ACCEPT
            - REJECT
            - MATCH
            - UNMATCH
            - EDIT
          minItems: 1
        balanceOffset:
          $ref: '#/components/schemas/BalanceOffsetSummary'
        counterpartyPaymentAccount:
          $ref: '#/components/schemas/AccountIdentifier'
        createdAt:
          type: string
          format: date-time
        document:
          $ref: '#/components/schemas/PaymentAggregationDocument'
        id:
          type: string
          format: uuid
        paymentAccount:
          $ref: '#/components/schemas/AccountIdentifier'
      required:
      - aggregationStatus
      - amount
      - availableOperations
      - createdAt
      - id
    PaymentAggregationConnection:
      type: object
      properties:
        displayName:
          type: string
        id:
          type: string
          format: uuid
      required:
      - displayName
      - id
    PaymentAggregationDocument:
      type: object
      properties:
        connections:
          type: array
          items:
            $ref: '#/components/schemas/PaymentAggregationConnection'
          minItems: 1
        folder:
          type: string
          enum:
          - PURCHASES
          - SALES
          - DRAFTS
          - INBOX
          - STATEMENTS
          - FILES
        id:
          type: string
          format: uuid
        metadata:
          $ref: '#/components/schemas/PaymentAggregationDocumentMetadata'
      required:
      - connections
      - folder
      - id
      - metadata
    PaymentAggregationDocumentMetadata:
      type: object
      properties:
        currencyCode:
          type: string
        documentNumber:
          type: string
        documentTotals:
          $ref: '#/components/schemas/PaymentAggregationDocumentTotals'
    PaymentAggregationDocumentTotals:
      type: object
      properties:
        payableAmount:
          type: number
    PaymentAggregationsResponse:
      type: object
      properties:
        currentPage:
          type: integer
          format: int32
          description: Current page
        pageSize:
          type: integer
          format: int32
          description: Response page size
        paymentAggregations:
          type: array
          items:
            $ref: '#/components/schemas/PaymentAggregation'
        totalElements:
          type: integer
          format: int64
          description: Total number of items in the database that correspond to this
            search criteria
    PaymentCollectInstruction:
      type: object
      properties:
        consentId:
          type: string
          format: uuid
          description: Identifier of the consent to be used to automatically initiate
            a transaction for the document.
        requestedExecutionDate:
          type: string
          format: date
          description: The requested execution date for the payment collect transaction
      required:
      - consentId
    PaymentRequestLinks:
      type: object
      properties:
        checkoutUrl:
          type: string
          description: URL to redirect the payer to initiate the payment
          example: https://app.btx.banqup.com/payments/payment-feedback
        statusImageUrl:
          type: string
          description: URL of the real time status image of the payment request
          example: https://app.btx.banqup.com/payments/payment-feedback
        statusTextUrl:
          type: string
          description: URL of the real time status of the payment request
          example: https://app.btx.banqup.com/payments/payment-feedback
    PaymentSummary:
      type: object
      properties:
        amount:
          $ref: '#/components/schemas/AmountDto'
        paymentId:
          type: string
          format: uuid
        status:
          type: string
          enum:
          - RECEIVED
          - OPEN
          - IN_TRANSIT
          - SUCCESSFUL
          - FAILED
          - CANCELED
          - UNKNOWN
          - PLANNED
      required:
      - amount
      - paymentId
      - status
    PaymentValidationMessage:
      type: object
      properties:
        code:
          type: string
          enum:
          - MISSING_DEBTOR_ACCOUNT
          - INVALID_CURRENCY
          - PIS_NOT_SUPPORTED
          - FINANCIAL_PLATFORM_UNKNOWN
          - MISSING_PAYABLE_ITEM
          - BULK_PAYMENT_NOT_SUPPORTED
          - DUPLICATE_PAYABLE_ITEM_ID
          - FUTURE_EXECUTION_DATE_NOT_SUPPORTED
          - UNACCEPTABLE_FUTURE_EXECUTION_DATE
          - PARTIAL_PAYMENT_NOT_SUPPORTED
          - NEW_FEE_DETECTED
          - FEE_MISMATCH_OR_EXPIRED
          - CAF_PAYMENT
          - FX_PAYMENT
          - FAILED_CONTEXT_VALIDATION
          - CONTEXT_VALIDATION_WARNING
          - PAYMENT_EXECUTION_METHOD_PROVIDER_OUT_OF_WORKING_HOURS
          - PAYMENT_EXECUTION_NOT_SUPPORTED
          - SERVICE_UNAVAILABLE
        data:
          type: object
        type:
          type: string
          enum:
          - INFO
          - WARNING
          - ERROR
      required:
      - code
      - type
    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
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.cve.btx.eu.banqup.com/oauth2/client_credential/gettoken
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
        authorizationCode:
          authorizationUrl: https://api.cve.btx.eu.banqup.com/oauth2/auth
          tokenUrl: https://api.cve.btx.eu.banqup.com/oauth2/token
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
tags:
- name: Spaces
  description: 'Spaces are virtual environments (work spaces) where all relevant resources
    of an entity are managed.  Spaces can also facilitate document exchange and communication
    among entities, depending on the space type.

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

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