openapi: 3.0.1
info:
  title: 'Partner Store Service: API Specification'
  description: The Partner Store REST Service is providing REST api endpoints to stored
    partner related data.
  version: 1.11.1
servers:
- description: ''
  url: https://api.btx.fr.banqup.com/datastore/partner
- description: ''
  url: https://api.btx.eu.banqup.com/datastore/partner
paths:
  /v1/spaces/{spaceId}/clients/{clientId}/documents/{documentId}/representations:
    get:
      tags:
      - Documents
      summary: Get list of document representations on client's business space
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get list of document representations on the business space of the given
        client, with options to filter out the result. The API supports pagination.
        <br/> Scope: client_read"
      operationId: getClientDocumentRepresentations
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The client identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: mainRepresentation
        in: query
        description: Whether the document is main or not
        schema:
          type: boolean
      - name: original
        in: query
        description: Whether the document is original or not
        schema:
          type: boolean
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          type: integer
          format: int32
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          type: integer
          format: int32
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllDocumentRepresentationResult'
              example:
                document_representations:
                - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                  documentId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                  retentionTime: 2024-08-12T09:26:51.434000Z
                  type: legal_xml
                  filename: legal_xml.xml
                  contentType: application/xml
                  size: 2048
                  status: PROCESSING
                  main: true
                  uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=ABC
                  md5Hash: 938c2cc0dcc05f2b68c4287040cfcf71
                  createdAt: 2024-08-12T09:26:51.434000Z
                  updatedAt: 2024-08-12T09:26:51.434000Z
                totalElements: 1
                currentPage: 0
                pageSize: 20
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                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-27T12:34:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2:
        - client_read
    post:
      tags:
      - Documents
      summary: Create document representation
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Create document representation on the client space. <br/> Scope: client_write"
      operationId: createClientDocumentRepresentation
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The client identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Document representation data to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentRepresentationRequest'
            example:
              fileSize: 10
              retentionTime: 2023-10-04T14:20:31.502921Z
              type: legal_xml
              filename: legal_xml.xml
              contentType: application/xml
              main: false
              md5Hash: 938c2cc0dcc05f2b68c4287040cfcf71
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentRepresentationResult'
              example:
                id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                documentId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                retentionTime: 2024-08-12T09:26:51.434000Z
                type: legal_xml
                filename: legal_xml.xml
                contentType: application/xml
                size: 2048
                status: PROCESSING
                main: true
                uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=ABC
                md5Hash: 938c2cc0dcc05f2b68c4287040cfcf71
                createdAt: 2024-08-12T09:26:51.434000Z
                updatedAt: 2024-08-12T09:26:51.434000Z
        '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-27T12:34:50Z
                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-27T12:34:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2:
        - client_write
  /v1/spaces/{spaceId}/clients/{clientId}/documents/{documentId}/representations/{documentRepresentationId}:
    get:
      tags:
      - Documents
      summary: Get document representation info on client's business space
      description: "Get client's document representation information by its ID on
        the given space. <br/> Scope: client_read"
      operationId: getClientDocumentRepresentation
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The client identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      - name: documentRepresentationId
        in: path
        description: The document representation identifier
        required: true
        schema:
          type: string
          format: uuid
        example: 1d0159ca-ab19-49d5-9e13-9d34afb03849
      responses:
        '200':
          description: Ok. Document representation info.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentRepresentationResult'
              example:
                id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                documentId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                retentionTime: 2024-08-12T09:26:51.434000Z
                type: legal_xml
                filename: legal_xml.xml
                contentType: application/xml
                size: 2048
                status: PROCESSING
                main: true
                uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=ABC
                md5Hash: 938c2cc0dcc05f2b68c4287040cfcf71
                createdAt: 2024-08-12T09:26:51.434000Z
                updatedAt: 2024-08-12T09:26:51.434000Z
        '404':
          description: Not Found. Document uuid must be invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2:
        - client_read
    delete:
      tags:
      - Documents
      summary: Delete document representation
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Delete document representation on the client space. <br/> Scope: client_write"
      operationId: deleteClientDocumentRepresentation
      parameters:
      - name: spaceId
        in: path
        description: The partner space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The client identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentRepresentationId
        in: path
        description: The representation identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2:
        - client_write
  /v1/spaces/{spaceId}/clients/{clientId}/documents/{documentId}/representations/{documentRepresentationId}/content:
    get:
      tags:
      - Documents
      summary: Retrieve document content
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Retrieve document content by its ID on the given space. <br/> Scope:
        client_read"
      operationId: getDocumentRepresentationContent
      parameters:
      - name: spaceId
        in: path
        description: The partner space's identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: Unique identifier of partner space's client
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: Unique identifier of the document
        required: true
        schema:
          type: string
          format: uuid
      - name: documentRepresentationId
        in: path
        description: Unique identifier of the document representation
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '302':
          description: Found
          headers:
            Location:
              description: Redirect URL
              style: simple
              schema:
                type: string
        '404':
          description: UUID not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2:
        - client_read
  /v1/spaces/{spaceId}/clients/{clientId}/documents/{documentId}:
    get:
      tags:
      - Documents
      summary: Get document info in folder
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get document information by its ID in the given folder <br/> Scope:
        client_read"
      operationId: getClientDocument
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The client identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: query
        description: Document folder
        required: true
        schema:
          type: string
          enum:
          - AP
          - AR
          - PURCHASES
          - SALES
          - DRAFTS
          - INBOX
          - STATEMENTS
          - FILES
        example: PURCHASES
      - name: includeLines
        in: query
        description: Should include lines in the result? Default is false
        schema:
          type: boolean
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResult'
              examples:
                Document:
                  description: Document
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    supplier:
                      id: 00000001-0000-0000-0000-000000000001
                    customer:
                      id: 00000001-0000-0000-0000-000000000002
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      virus: hidden
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    retentionTime: 2023-10-04T14:20:31.502921Z
                    createdAt: 2023-10-04T14:20:31.502921Z
                    updatedAt: 2023-10-04T14:20:31.502921Z
                Document including lines:
                  description: Document including lines
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    supplier:
                      id: 00000001-0000-0000-0000-000000000001
                    customer:
                      id: 00000001-0000-0000-0000-000000000002
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      virus: hidden
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    retentionTime: 2023-10-04T14:20:31.502921Z
                    lines:
                    - id: 7a1cf570-db5c-4e41-992e-9890532212ae
                      sequence: 1
                      identifier: identifier 1
                      description: Line item 1
                      itemId: item1
                      itemCategory: category
                      productIdentifiers:
                        commodityCode: '123456'
                      quantity: 2
                      unit: PCS
                      startDate: 2024-01-23
                      endDate: 2024-06-23
                      discounts:
                        value: '20.0'
                      charges:
                        value: '76.67'
                      unitPrice: '40.278192'
                      netAmount: '80.56'
                      grossAmount: '96.67'
                      vatAmount: '16.11'
                      currency: USD
                      vatRate: '0.2'
                      vatCode: VAT
                    createdAt: 2023-10-04T14:20:31.502921Z
                    updatedAt: 2023-10-04T14:20:31.502921Z
        '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-27T12:34:50Z
                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-27T12:34:50Z
                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:
        - client_read
    patch:
      tags:
      - Documents
      summary: Update document in folder
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update document by its ID in the given folder by sending json with the
        changes <br/> Scope: client_write"
      operationId: updateDocument
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The client identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: query
        description: Document folder
        required: true
        schema:
          type: string
          enum:
          - AP
          - AR
          - PURCHASES
          - SALES
          - DRAFTS
          - INBOX
          - STATEMENTS
          - FILES
        example: PURCHASES
      requestBody:
        description: Document data to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDocumentRequest'
            example:
              metadata:
                supplier: Jack Doe
              status:
                accept: UNACCEPTED
              category: CREDITCARD_STATEMENT
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: replace
              path: /status
              value:
                pay: FULLY_PAID
            - op: add
              path: /foo
              value: bar
        required: true
      responses:
        '200':
          description: Update document successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResult'
              example:
                documents:
                - id: 0ca2797b-6365-4bf2-a490-247075e3cede
                  spaceId: 00000001-0000-0000-0000-000000000000
                  description: Sample Document
                  source: Sample Source
                  folder: PURCHASES
                  supplier:
                    id: 00000001-0000-0000-0000-000000000001
                  customer:
                    id: 00000001-0000-0000-0000-000000000002
                  status:
                    pay: FULLY_PAID
                  category: INVOICE
                  metadata:
                    virus: hidden
                  tags:
                  - new
                  tasks:
                  - extensionName: com.unifiedpost.btx.data:approve
                    status: approve
                  retentionTime: 2023-10-04T14:20:31.502921Z
                  createdAt: 2023-10-04T14:20:31.502921Z
                  updatedAt: 2023-10-04T14:20:31.502921Z
                totalElements: 100
                currentPage: 2
                pageSize: 2
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space UUID, Folder or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                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:
        - client_write
  /v1/spaces/{spaceId}/clients/{clientId}/documents:
    get:
      tags:
      - Documents
      summary: Get list of documents on client's business space
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get list of documents on the business space of the given client, with
        options to filter out the result. The API supports pagination and sorting.
        <br/> Scope: client_read"
      operationId: getClientDocuments
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The client identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: metadata
        in: query
        schema:
          type: array
          items:
            type: string
      - name: category
        in: query
        description: Document category to filter
        schema:
          type: string
          enum:
          - PURCHASE_ORDER
          - ORDER_CONFIRMATION
          - DELIVERY_NOTE
          - GOODS_RECEIVED_NOTE
          - INVOICE
          - INVOICE_REMINDER
          - CREDIT_NOTE
          - RECEIPT
          - STATEMENT
          - FILE
          - QUOTE
          - CREDITCARD_STATEMENT
          - OTHER
        example: PURCHASE_ORDER
      - name: status
        in: query
        schema:
          type: array
          items:
            type: string
      - name: status[ql]
        in: query
        description: Status query language DSL
        schema:
          type: string
        examples:
          example without parantheses:
            description: example without parantheses
            value: document=RECEIVED OR document=AWAITING_VALIDATION OR document=VALIDATED
              OR pay[exists]=true OR pay[notIn]=PARTIALLY_PAID,FULLY_PAID
          example with parantheses:
            description: example with parantheses
            value: (document=FULLY_APPROVED OR document=SENT) AND (pay=FULLY_PAID
              OR pay=PARTIALLY_PAID)
      - name: folder
        in: query
        description: Document folder
        schema:
          type: string
          enum:
          - AP
          - AR
          - PURCHASES
          - SALES
          - DRAFTS
          - INBOX
          - STATEMENTS
          - FILES
        example: PURCHASES
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          type: integer
          format: int32
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          type: integer
          format: int32
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        schema:
          type: string
          enum:
          - createdAt
          - createdAt.asc
          - createdAt.desc
        example: createdAt.asc
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllDocumentResult'
              example:
                documents:
                - id: 0ca2797b-6365-4bf2-a490-247075e3cede
                  spaceId: 00000001-0000-0000-0000-000000000000
                  description: Sample Document
                  source: Sample Source
                  folder: PURCHASES
                  supplier:
                    id: 00000001-0000-0000-0000-000000000001
                  customer:
                    id: 00000001-0000-0000-0000-000000000002
                  status:
                    pay: FULLY_PAID
                  category: INVOICE
                  metadata:
                    virus: hidden
                  tags:
                  - new
                  tasks:
                  - extensionName: com.unifiedpost.btx.data:approve
                    status: approve
                  retentionTime: 2023-10-04T14:20:31.502921Z
                  createdAt: 2023-10-04T14:20:31.502921Z
                  updatedAt: 2023-10-04T14:20:31.502921Z
                totalElements: 100
                currentPage: 2
                pageSize: 2
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                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-27T12:34:50Z
                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:
        - client_read
  /v1/spaces/{spaceId}/clients/{clientId}/documents/{documentId}:getOrCreateRepresentation:
    post:
      tags:
      - Documents
      summary: Get or create document representation via document processor service.
      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 or create document representation of given type for partner document
        via document processor service. <br/> Scope: client_write"
      operationId: getOrCreateDocumentProcessorRepresentation
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The client identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Request body to send to document processor service
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetOrCreateRepresentationRequest'
            example:
              documentType: com.unifiedpost.btx.datastore.json
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
        '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-27T12:34:50Z
                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-27T12:34:50Z
                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:
        - client_write
  /v1/spaces/{spaceId}/clients/{clientId}/documents/{documentId}:jsonpatch:
    patch:
      tags:
      - Documents
      summary: Json patch document in folder
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update document by its ID in the given folder by sending JSON patch
        <br/> Scope: client_write"
      operationId: jsonpatchDocument
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The client identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: folder
        in: query
        description: Document folder
        required: true
        schema:
          type: string
          enum:
          - AP
          - AR
          - PURCHASES
          - SALES
          - DRAFTS
          - INBOX
          - STATEMENTS
          - FILES
        example: PURCHASES
      requestBody:
        description: Document data to update
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: replace
              path: /status
              value:
                pay: FULLY_PAID
            - op: add
              path: /foo
              value: bar
        required: true
      responses:
        '200':
          description: Update document successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResult'
              example:
                documents:
                - id: 0ca2797b-6365-4bf2-a490-247075e3cede
                  spaceId: 00000001-0000-0000-0000-000000000000
                  description: Sample Document
                  source: Sample Source
                  folder: PURCHASES
                  supplier:
                    id: 00000001-0000-0000-0000-000000000001
                  customer:
                    id: 00000001-0000-0000-0000-000000000002
                  status:
                    pay: FULLY_PAID
                  category: INVOICE
                  metadata:
                    virus: hidden
                  tags:
                  - new
                  tasks:
                  - extensionName: com.unifiedpost.btx.data:approve
                    status: approve
                  retentionTime: 2023-10-04T14:20:31.502921Z
                  createdAt: 2023-10-04T14:20:31.502921Z
                  updatedAt: 2023-10-04T14:20:31.502921Z
                totalElements: 100
                currentPage: 2
                pageSize: 2
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space UUID, Folder or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                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:
        - client_write
  /v1/spaces/{spaceId}/clients:
    get:
      tags:
      - Clients
      summary: Get list of clients
      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 list of clients <br/> Scope: client_read, space_client_manage"
      operationId: getClients
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: status
        in: query
        schema:
          type: string
          description: |-
            Filter by multiple statuses, which can be separated by comma, or just one value.
            The API interprets this as a logical OR.
          example: DRAFT,INVITED
      - name: name
        in: query
        schema:
          type: string
          description: Filter by name
          example: Client A
      - name: spaceExtensions[].name
        in: query
        schema:
          type: string
          description: |-
            Name of extension. This will be applied to filter on multiple extension
            names separated by comma, or just one value. The API interprets this as a logical OR.
          example: Chorus Pro,BTX Extension
      - name: spaceExtensions[].status
        in: query
        schema:
          type: string
          description: |-
            Status of extension. This will be applied to filter on multiple
            statuses separated by comma, or just one value. The API interprets this as a logical OR.
          example: ACTIVE,INACTIVE,PENDING
      - name: spaceExtensions[].category
        in: query
        schema:
          type: string
          description: |-
            Category of extension. This will be applied to filter on multiple extension
            categories separated by comma, or just one value. The API interprets this as a logical OR.
          example: APPLICATION,CONNECTOR,SERVICE
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          type: integer
          format: int32
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          type: integer
          format: int32
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        schema:
          type: string
          enum:
          - name
          - name.asc
          - name.desc
          - status
          - status.asc
          - status.desc
        example: name.asc
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientResultList'
              example:
                clients:
                - id: 69f296a5-fb7e-47d8-a1de-bd528f0038b0
                  name: Client A
                  identifiers:
                    internalId: xxxx
                    externalId: yyyy
                    cbeNumber: zzzz
                    vat: '1234567890'
                  addresses:
                    main:
                      streetName: Nitzsche Lodge
                      house: '80728'
                      postalCode: '3110'
                      city: Fernandahaven
                      country: Belgium
                      countryCode: BE
                  contacts:
                  - id: 1bee5b5c-3c20-4dbf-91c5-1498ac130abc
                    firstName: First
                    lastName: Last
                    email: clienta@example.com
                    language: en
                  syncPlatforms:
                  - Google Drive
                  - Yuki
                  metadata:
                    bankAccounts:
                    - iban: '1234567890'
                      bic: '123'
                    financialInfo:
                      financialPeriod: YEARLY
                      financialEndDate: 2023-12-31
                    registrationCountry: BE
                    department: TEST
                    language: en
                  spaceExtensions:
                  - extensionId: 5eec8595-e610-4185-af45-ebe3752443e3
                    namespace: com.unifiedpost.btx.connectors
                    name: peppol
                    status: ACTIVE
                    category: CONNECTOR
                    version: 1.5.0
                  status: DRAFT
                  clientSpaceUrl: 
                    https://api.dev.btx.eu.banqup.com/entitystore/v1/directory/entities/00000001-0000-0000-0000-000000000000/spaces/00000001-0000-0000-0000-000000000000
                totalElements: 5
                currentPage: 0
                pageSize: 1
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                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:
        - client_read
        - space_client_manage
    post:
      tags:
      - Clients
      summary: Create new client
      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/> Request to create a client <br/> Scope: space_client_manage"
      operationId: createClient
      parameters:
      - name: spaceId
        in: path
        description: The partner space's identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Client data to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClientRequest'
            example:
              name: Client A
              identifiers:
                internalId: xxxx
                externalId: yyyy
                cbeNumber: zzzz
                vat: '1234567890'
              addresses:
                main:
                  streetName: Nitzsche Lodge
                  house: '80728'
                  postalCode: '3100'
                  city: Fernandahaven
                  country: Belgium
                  countryCode: BE
                  postBox: PO123
              contacts:
              - firstName: First
                lastName: Last
                email: clienta@example.com
                language: en
              syncPlatforms:
              - Google Drive
              - Yuki
              metadata:
                bankAccounts:
                - iban: '1234567890'
                  bic: '123'
                financialInfo:
                  financialPeriod: YEARLY
                  financialEndDate: 2023-12-31
                registrationCountry: BE
                department: TEST
                language: en
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientResult'
              example:
                id: 69f296a5-fb7e-47d8-a1de-bd528f0038b0
                name: Client A
                identifiers:
                  internalId: xxxx
                  externalId: yyyy
                  cbeNumber: zzzz
                  vat: '1234567890'
                addresses:
                  main:
                    streetName: Nitzsche Lodge
                    house: '80728'
                    postalCode: '3110'
                    city: Fernandahaven
                    country: Belgium
                    countryCode: BE
                    postBox: PO123
                contacts:
                - id: 1bee5b5c-3c20-4dbf-91c5-1498ac130abc
                  firstName: First
                  lastName: Last
                  email: clienta@example.com
                  language: en
                syncPlatforms:
                - Google Drive
                - Yuki
                metadata:
                  bankAccounts:
                  - iban: '1234567890'
                    bic: '123'
                  financialInfo:
                    financialPeriod: YEARLY
                    financialEndDate: 2023-12-31
                  registrationCountry: BE
                  department: TEST
                  language: en
                spaceExtensions:
                - extensionId: 5eec8595-e610-4185-af45-ebe3752443e3
                  namespace: com.unifiedpost.btx.connectors
                  name: peppol
                  status: ACTIVE
                  category: CONNECTOR
                  version: 1.5.0
                status: DRAFT
        '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-27T12:34:50Z
                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_client_manage
  /v1/spaces/{spaceId}/clients/{clientId}:
    get:
      tags:
      - Clients
      summary: Get client data
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Retrieve data of a specific client <br/> Scope: client_read, space_client_manage"
      operationId: getClient
      parameters:
      - name: spaceId
        in: path
        description: The partner space's identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: Unique identifier of partner space's client
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientResult'
              example:
                id: 69f296a5-fb7e-47d8-a1de-bd528f0038b0
                name: Client A
                identifiers:
                  internalId: xxxx
                  externalId: yyyy
                  cbeNumber: zzzz
                  vat: '1234567890'
                addresses:
                  main:
                    streetName: Nitzsche Lodge
                    house: '80728'
                    postalCode: '3110'
                    city: Fernandahaven
                    country: Belgium
                    countryCode: BE
                    postBox: PO123
                contacts:
                - id: 1bee5b5c-3c20-4dbf-91c5-1498ac130abc
                  firstName: First
                  lastName: Last
                  email: clienta@example.com
                  language: en
                syncPlatforms:
                - Google Drive
                - Yuki
                metadata:
                  bankAccounts:
                  - iban: '1234567890'
                    bic: '123'
                  financialInfo:
                    financialPeriod: YEARLY
                    financialEndDate: 2023-12-31
                  registrationCountry: BE
                  department: TEST
                  language: en
                spaceExtensions:
                - extensionId: 5eec8595-e610-4185-af45-ebe3752443e3
                  namespace: com.unifiedpost.btx.connectors
                  name: peppol
                  status: ACTIVE
                  category: CONNECTOR
                  version: 1.5.0
                status: DRAFT
                clientSpaceUrl: 
                  https://api.dev.btx.eu.banqup.com/entitystore/v1/directory/entities/d1cbd185-8e94-49bb-b25a-9a7dd0c23d37/spaces/94e29950-a87a-4fb5-b3dd-c2ef1d419431
                clientEntityId: d1cbd185-8e94-49bb-b25a-9a7dd0c23d37
                clientSpaceId: 94e29950-a87a-4fb5-b3dd-c2ef1d419431
        '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-27T12:34:50Z
                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-27T12:34:50Z
                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:
        - client_read
        - space_client_manage
    delete:
      tags:
      - Clients
      summary: Delete client
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Remove a specific client from a partner space <br/> Scope: client_write,
        space_client_manage"
      operationId: deleteClient
      parameters:
      - name: spaceId
        in: path
        description: The partner space's identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: Unique identifier of partner space's client
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                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:
        - client_write
        - space_client_manage
    patch:
      tags:
      - Clients
      summary: Update client
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update client <br/> Scope: client_write, space_client_manage"
      operationId: updateClient
      parameters:
      - name: spaceId
        in: path
        description: The partner space's identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: Unique identifier of partner space's client
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Client data to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateClientRequest'
            example:
              name: Client A
              identifiers:
                externalId: yyyy
                cbeNumber: zzzz
                vat: '1234567890'
              addresses:
                main:
                  streetName: Nitzsche Lodge
                  house: '80728'
                  postalCode: '3110'
                  city: Fernandahaven
                  country: Belgium
                  countryCode: BE
                  postBox: PO123
              contacts:
              - firstName: First
                lastName: Last
                email: clienta@example.com
                language: en
              syncPlatforms:
              - platform_1
              - platform_2
              metadata:
                bankAccounts:
                - iban: '1234567890'
                  bic: '123'
                financialInfo:
                  financialPeriod: '2023'
                  financialEndDate: 2023-12-31
                registrationCountry: BE
                department: TEST
                language: en
              status: DRAFT
              clientSpaceUrl: 
                https://api.dev.btx.eu.banqup.com/entitystore/v1/directory/entities/00000001-0000-0000-0000-000000000000/spaces/00000001-0000-0000-0000-000000000000
        required: true
      responses:
        '200':
          description: Client updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientResult'
              example:
                id: 69f296a5-fb7e-47d8-a1de-bd528f0038b0
                name: Client A
                identifiers:
                  internalId: xxxx
                  externalId: yyyy
                  cbeNumber: zzzz
                  vat: '1234567890'
                addresses:
                  main:
                    streetName: Nitzsche Lodge
                    house: '80728'
                    postalCode: '3110'
                    city: Fernandahaven
                    country: Belgium
                    countryCode: BE
                    postBox: PO123
                contacts:
                - id: 1bee5b5c-3c20-4dbf-91c5-1498ac130abc
                  firstName: First
                  lastName: Last
                  email: clienta@example.com
                  language: en
                syncPlatforms:
                - Google Drive
                - Yuki
                metadata:
                  bankAccounts:
                  - iban: '1234567890'
                    bic: '123'
                  financialInfo:
                    financialPeriod: YEARLY
                    financialEndDate: 2023-12-31
                  registrationCountry: BE
                  department: TEST
                  language: en
                spaceExtensions:
                - extensionId: 5eec8595-e610-4185-af45-ebe3752443e3
                  namespace: com.unifiedpost.btx.connectors
                  name: peppol
                  status: ACTIVE
                  category: CONNECTOR
                  version: 1.5.0
                status: DRAFT
                clientSpaceUrl: 
                  https://api.dev.btx.eu.banqup.com/entitystore/v1/directory/entities/d1cbd185-8e94-49bb-b25a-9a7dd0c23d37/spaces/94e29950-a87a-4fb5-b3dd-c2ef1d419431
                clientEntityId: d1cbd185-8e94-49bb-b25a-9a7dd0c23d37
                clientSpaceId: 94e29950-a87a-4fb5-b3dd-c2ef1d419431
        '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-27T12:34:50Z
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Client UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                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:
        - client_write
        - space_client_manage
  /v1/spaces/{spaceId}/clients/{clientId}:deletePartnerLink:
    post:
      tags:
      - Clients
      summary: Delete partner link
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Remove the link between partner and client's business space <br/> Scope:
        space_client_manage"
      operationId: deletePartnerLink
      parameters:
      - name: spaceId
        in: path
        description: The partner space's identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: Unique identifier of partner space's client
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                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_client_manage
  /v1/spaces/{spaceId}/clients/{clientId}/permissions:
    get:
      tags:
      - Clients
      summary: Get permissions
      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 permissions on a client <br/> Scope: space_client_manage, client_read"
      operationId: getPermissions
      parameters:
      - name: spaceId
        in: path
        description: The partner space's identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: Unique identifier of partner space's client
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionsWrapperResult'
              example:
                subjects:
                - requester: 00000001-0000-0000-0000-000000000000
                  permissions:
                  - id: 10000001-0000-0000-0000-000000000000_10000000-0000-0000-0000-000000000000
                    scope: client_read
                    granted: true
                  - id: 10000001-0000-0000-0000-000000000000_20000000-0000-0000-0000-000000000000
                    scope: client_write
                    granted: true
                - requester: 00000002-0000-0000-0000-000000000000
                  permissions:
                  - id: 10000001-0000-0000-0000-000000000000_30000000-0000-0000-0000-000000000000
                    scope: client_read
                    granted: true
                  - id: 10000001-0000-0000-0000-000000000000_40000000-0000-0000-0000-000000000000
                    scope: client_write
                    granted: true
        '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-27T12:34:50Z
                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_client_manage
        - client_read
    post:
      tags:
      - Clients
      summary: Grant permission
      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/> Grant permission on a client <br/> Scope: space_client_manage, client_write"
      operationId: grantPermission
      parameters:
      - name: spaceId
        in: path
        description: The partner space's identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: Unique identifier of partner space's client
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Permission data to grant
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PermissionRequest'
            example:
              requester: requester_subject_id
              permission: client_read
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionResult'
              example:
                requester: 00000001-0000-0000-0000-000000000000
                id: 32026548-88a8-40bb-9e23-64dc2691cb2d
                scope: client_read
                granted: true
        '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-27T12:34:50Z
                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_client_manage
        - client_write
  /v1/spaces/{spaceId}/clients/{clientId}/extensions:
    get:
      tags:
      - Clients
      summary: Get extensions of client space
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Retrieve all extensions of client space <br/> Scope: client_read"
      operationId: listExtensions
      parameters:
      - name: spaceId
        in: path
        description: The partner space's identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: Extension client id
        required: true
        schema:
          type: string
          format: uuid
      - name: category
        in: query
        schema:
          type: string
          enum:
          - APPLICATION
          - CONNECTOR
          - SERVICE
      - name: status
        in: query
        schema:
          type: string
          enum:
          - ACTIVE
          - INACTIVE
          - PENDING
          - ERROR
      - name: name
        in: query
        description: Extension name for searching
        schema:
          type: string
      - name: supportClients
        in: query
        description: Extension support client
        schema:
          type: boolean
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          type: integer
          format: int32
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          type: integer
          format: int32
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllExtensionResult'
        '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-27T12:34:50Z
                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-27T12:34:50Z
                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:
        - client_read
  /v1/spaces/{spaceId}/clients/{clientId}/permissions/{permissionId}:
    delete:
      tags:
      - Clients
      summary: Revoke permission
      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/> Revoke granted permission for the client on this partner space <br/>
        Scope: space_client_manage"
      operationId: revokePermission
      parameters:
      - name: spaceId
        in: path
        description: The partner space's identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: Unique identifier of partner space's client
        required: true
        schema:
          type: string
          format: uuid
      - name: permissionId
        in: path
        description: Unique identifier of permission
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                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-27T12:34:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 409
                error: ABORTED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                type: about:blank
                title: Conflict
                detail: Specific detail about what could not be done.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_client_manage
  /v1/spaces/{spaceId}/clients/{clientId}/events:
    get:
      tags:
      - Clients
      summary: Get list of space events
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get list of space events <br/> Scope: client_read"
      operationId: listSpaceEvents
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The client identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: minLevel
        in: query
        description: Can be used to select events with level equal or with higher
          priority than the given level. E.g. given 'WARN' will yield WARNING and
          ERROR logs
        schema:
          type: string
          enum:
          - INFO
          - WARN
          - ERROR
        example: WARN
      - name: propertiesFilter
        in: query
        description: Property filters, sending same property name multiple times functions
          as an OR
        schema:
          type: array
          items:
            type: string
        example: |
          propertiesFilter=document_type:invoice&propertiesFilter=document_type:credit_note
      - name: categoryFilters
        in: query
        description: Event category & subcategory filters; category is key, subcategory
          is value; having more than one value in subcategory functions as an OR
        schema:
          type: array
          items:
            type: string
        example: categoryFilters=payment:payment_sent&categoryFilters=payment:payment_received
      - name: subjectTypeFilter
        in: query
        description: Can be used to select events created by a specific subject type
        schema:
          type: string
          example: connector
      - name: subjectIdFilter
        in: query
        description: Can be used to select events created by a specific subject IDS.
          Repeatable.
        schema:
          type: string
          example: connector
      - name: createdAtStart
        in: query
        description: Can be used to select events created from a specific datetime
          forward
        schema:
          type: string
          format: date-time
      - name: createdAtEnd
        in: query
        description: Can be used to select events created until a specific datetime
        schema:
          type: string
          format: date-time
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          type: integer
          format: int32
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          type: integer
          format: int32
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sort by criteria
        schema:
          type: string
          enum:
          - createdAt
          - createdAt.asc
          - createdAt.desc
        example: createdAt
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllEventResult'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_read
  /v2/spaces/{spaceId}/clients/{clientId}/documents:
    get:
      tags:
      - Documents
      summary: Get list of documents on client's business space 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 list of documents on the business space of the given client, with
        options to filter out the result. The API supports pagination and sorting.
        <br/> Scope: client_read"
      operationId: getDocumentsV2
      parameters:
      - name: filter
        in: query
        schema:
          $ref: '#/components/schemas/ListDocumentsQueryParamsSingle'
      - name: spaceId
        in: path
        description: The partner space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The client identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: metadata
        in: query
        description: "\tMetadata filter.\n\tExample:\n\tIf document metadata is:\n\
          \t{\n\t\t\"supplier\":\"Jack Doe\",\n\t\t\"filename\": \"123.pdf\",\n\t\t\
          \"other\": {\n\t\t\t\"documentReferences\": [\n\t\t\t\t{\n\t\t\t\t\t\"referencedInvoiceDate\"\
          : \"2024-01-14\",\n\t\t\t\t\t\"referencedInvoiceType\": \"380\",\n\t\t\t\
          \t\t\"numbers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"referencedInvoiceNumber\"\
          : \"ABC002\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t
          }\n\tTo filter by referencedInvoiceNumber=ABC002, the query param should
          be sent as:\n\t\"?metadata=other.documentReferences[].numbers[].referencedInvoiceNumber=ABC002\"\
          \n\tOf course, for simpler structures the query param is more simple.\n"
        schema:
          type: array
          items:
            type: string
        example: ?metadata=other.documentReferences[].numbers[].referencedInvoiceNumber=ABC002
      - name: status
        in: query
        schema:
          type: array
          items:
            type: string
      - name: include
        in: query
        description: What extra data to include in the response.
        explode: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/DocumentInclude'
        example: lines,connections
      - name: connections[customer].id[in]
        in: query
        description: List of connection IDs with type customer
        explode: false
        schema:
          type: array
          items:
            type: string
            format: uuid
        example: ecc46f54-71f8-4951-944e-a87c3fc57c35,da753d31-2068-4584-b91f-ae012f6b7df3
      - name: connections[supplier].id[in]
        in: query
        description: List of connection IDs with type supplier
        explode: false
        schema:
          type: array
          items:
            type: string
            format: uuid
        example: ecc46f54-71f8-4951-944e-a87c3fc57c35,da753d31-2068-4584-b91f-ae012f6b7df3
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          type: integer
          format: int32
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          type: integer
          format: int32
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        schema:
          type: string
          enum:
          - category
          - category.asc
          - category.desc
          - createdAt
          - createdAt.asc
          - createdAt.desc
          - grossAmount
          - grossAmount.asc
          - grossAmount.desc
          - payableAmount
          - payableAmount.asc
          - payableAmount.desc
          - documentNumber
          - documentNumber.asc
          - documentNumber.desc
          - issueDate
          - issueDate.asc
          - issueDate.desc
          - dueDate
          - dueDate.asc
          - dueDate.desc
          - status.delivery
          - status.delivery.asc
          - status.delivery.desc
          - status.document
          - status.document.asc
          - status.document.desc
          - status.pay
          - status.pay.asc
          - status.pay.desc
          - connections[customer].displayName
          - connections[customer].displayName.asc
          - connections[customer].displayName.desc
          - connections[supplier].displayName
          - connections[supplier].displayName.asc
          - connections[supplier].displayName.desc
        example: createdAt.asc
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListDocumentsResponseV2'
              example:
                documents:
                - id: 0ca2797b-6365-4bf2-a490-247075e3cede
                  spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                  description: Sample Document
                  source: Sample Source
                  status:
                    pay: FULLY_PAID
                  category: INVOICE
                  metadata:
                    documentNumber: ABC002
                    issueDate: 2024-01-31
                    invoiceType: '380'
                    currencyCode: EUR
                    dueDate: 2024-03-30
                    buyerReference: CUST-001
                    contractReference: CONTRACT001
                    purchaseOrderReference: PO123
                    paymentTerms: Net 60
                    notes:
                    - code: AAA
                      text: Goods item description
                    invoiceReferences:
                    - invoiceReference: ABC002
                      issueDate: 2024-01-14
                      invoiceType: '380'
                    supplier:
                      legalName: Monte Carlo Ltd
                      tradeName: Monte Carlo Ltd
                      address:
                        department: Service achat
                        streetName: RUE DES FLEURS
                        buildingNumber: 22BIS
                        floor: Zone industrielle de la Ballastrierre Ouest
                        postBox: BP 40122
                        townName: LIBOURNE CEDEX
                        postCode: '33506'
                        country: FR
                      globalIdentifiers:
                        fr:siren: '349718288'
                        fr:siret: '34971828812345'
                        fr:vat: FR63349718288
                        global:phoneNumber:
                        - '+3221234567'
                        global:email:
                        - contact@supplier.be
                    customer:
                      legalName: Central Argo Trading
                      tradeName: Central Argo Trading
                      address:
                        streetName: Bloemendalelaan
                        buildingNumber: 62/3
                        buildingName: Building West
                        floor: '4'
                        room: '47'
                        townName: Maldegem
                        postCode: '9990'
                        country: BE
                      globalIdentifiers:
                        be:vat: BE0412887923
                        global:phoneNumber:
                        - '+3237890123'
                        global:email:
                        - contact@customer.be
                    delivery:
                      deliveryDate: 2024-01-31
                    prepaid:
                      paymentDate: 2024-08-15
                      code: '55'
                      text: 'Advance payment for order #12345'
                      paymentReference:
                        value: Prepaid invoice ABC002
                        type: UNSTRUCTURED
                    paymentMeans:
                    - code: '42'
                      text: Payment to bank account, Belgian structured reference
                      paymentReference:
                        value: 001/4037/32870
                        type: STRUCTURED
                        scheme: OGM_VCS
                      paymentAccount:
                        identifier: FR3330002005500000157841Z25
                        scheme: IBAN
                        country: FR
                        currency: EUR
                        bank:
                          identifier: CRLYFRPP
                          scheme: BIC
                      paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-...-166eca6e81a7
                    allowances:
                    - netAmount: '150'
                      baseAmount: '1000'
                      percentage: '15'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Discount
                      reasonCode: '95'
                    charges:
                    - netAmount: '200'
                      baseAmount: '1000'
                      percentage: '20'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Advertising
                      reasonCode: AA
                    documentTotals:
                      netAmount: '1000'
                      vatAmount: '100'
                      grossAmount: '1100'
                      prepaidAmount: '500'
                      roundingDifference: '1100'
                      payableAmount: '600'
                      linesNetAmount: '900'
                      allowancesNetAmount: '100'
                      chargesNetAmount: '200'
                    vatDetails:
                    - vatCategory: S
                      vatPercentage: '10'
                      netAmount: '1000'
                      vatAmount: '100'
                      exemptionReason: Medical supplies are exempt from VAT
                      exemptionReasonCode: VATEX-EU-79-C
                    uploadId: '123456789'
                    vatChargeableMethod: payment_date
                    vatAlreadyDeclared: true
                    processControl:
                      businessProcess: goods
                  tags:
                  - new
                  tasks:
                  - extensionName: com.unifiedpost.btx.data:approve
                    status: approve
                  retentionTime: 2023-10-04T14:20:31.502921Z
                  customCategories:
                    purchases:
                    - fuel
                    - restaurant
                totalElements: 100
                currentPage: 2
                pageSize: 2
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                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-27T12:34:50Z
                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:
        - client_read
    post:
      tags:
      - Documents
      summary: Create document v2
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Create document v2 on the client space <br/> Scope: client_write"
      operationId: createDocumentV2
      parameters:
      - name: spaceId
        in: path
        description: The space unique identifier (A UUID specified by RFC4122).
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The client identifier (A UUID specified by RFC4122).
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Document to add
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentRequestV2'
            examples:
              Document:
                description: Document
                value:
                  description: Sample invoice for choruspro
                  source: choruspro
                  metadata:
                    documentNumber: ABC002
                    issueDate: 2024-01-31
                    invoiceType: '380'
                    currencyCode: EUR
                    dueDate: 2024-03-30
                    buyerReference: CUST-001
                    contractReference: CONTRACT001
                    purchaseOrderReference: PO123
                    paymentTerms: Net 60
                    notes:
                    - code: AAA
                      text: Goods item description
                    invoiceReferences:
                    - invoiceReference: ABC002
                      issueDate: 2024-01-14
                      invoiceType: '380'
                    supplier:
                      legalName: Monte Carlo Ltd
                      tradeName: Monte Carlo Ltd
                      address:
                        department: Service achat
                        streetName: RUE DES FLEURS
                        buildingNumber: 22BIS
                        floor: Zone industrielle de la Ballastrierre Ouest
                        postBox: BP 40122
                        townName: LIBOURNE CEDEX
                        postCode: '33506'
                        country: FR
                      globalIdentifiers:
                        fr:siren: '349718288'
                        fr:siret: '34971828812345'
                        fr:vat: FR63349718288
                        global:phoneNumber:
                        - '+3221234567'
                        global:email:
                        - contact@supplier.be
                    customer:
                      legalName: Central Argo Trading
                      tradeName: Central Argo Trading
                      address:
                        streetName: Bloemendalelaan
                        buildingNumber: 62/3
                        buildingName: Building West
                        floor: '4'
                        room: '47'
                        townName: Maldegem
                        postCode: '9990'
                        country: BE
                      globalIdentifiers:
                        be:vat: BE0412887923
                        global:phoneNumber:
                        - '+3237890123'
                        global:email:
                        - contact@customer.be
                    delivery:
                      deliveryDate: 2024-01-31
                    prepaid:
                      paymentDate: 2024-08-15
                      code: '55'
                      text: 'Advance payment for order #12345'
                      paymentReference:
                        value: Prepaid invoice ABC002
                        type: UNSTRUCTURED
                    paymentMeans:
                    - code: '42'
                      text: PPayment to bank account, Belgian structured reference
                      paymentReference:
                        value: 001/4037/32870
                        type: STRUCTURED
                        scheme: OGM_VCS
                      paymentAccount:
                        identifier: FR3330002005500000157841Z25
                        scheme: IBAN
                        country: FR
                        currency: EUR
                        bank:
                          identifier: CRLYFRPP
                          scheme: BIC
                      paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-...-166eca6e81a7
                    allowances:
                    - netAmount: '150'
                      baseAmount: '1000'
                      percentage: '15'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Discount
                      reasonCode: '95'
                    charges:
                    - netAmount: '200'
                      baseAmount: '1000'
                      percentage: '20'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Advertising
                      reasonCode: AA
                    documentTotals:
                      netAmount: '1000'
                      vatAmount: '100'
                      grossAmount: '1100'
                      prepaidAmount: '500'
                      roundingDifference: '1100'
                      payableAmount: '600'
                      linesNetAmount: '900'
                      allowancesNetAmount: '100'
                      chargesNetAmount: '200'
                    vatDetails:
                    - vatCategory: S
                      vatPercentage: '10'
                      netAmount: '1000'
                      vatAmount: '100'
                      exemptionReason: Medical supplies are exempt from VAT
                      exemptionReasonCode: VATEX-EU-79-C
                    uploadId: '123456789'
                    vatChargeableMethod: payment_date
                    vatAlreadyDeclared: true
                    processControl:
                      businessProcess: goods
                  retentionTime: 2029-01-14T19:58:47+02:00
                  status:
                    accept: ACCEPTED
                  category: INVOICE
                  folder: INBOX
                  connections:
                  - id: 00000001-0000-0000-0000-000000000001
                    relationType: SUPPLIER
                  - id: 00000001-0000-0000-0000-000000000002
                    relationType: CUSTOMER
              Document containing lines:
                description: Document containing lines
                value:
                  description: Sample invoice for choruspro
                  source: choruspro
                  metadata:
                    documentNumber: ABC002
                    issueDate: 2024-01-31
                    invoiceType: '380'
                    currencyCode: EUR
                    dueDate: 2024-03-30
                    buyerReference: CUST-001
                    contractReference: CONTRACT001
                    purchaseOrderReference: PO123
                    paymentTerms: Net 60
                    notes:
                    - code: AAA
                      text: Goods item description
                    invoiceReferences:
                    - invoiceReference: ABC002
                      issueDate: 2024-01-14
                      invoiceType: '380'
                    supplier:
                      legalName: Monte Carlo Ltd
                      tradeName: Monte Carlo Ltd
                      address:
                        department: Service achat
                        streetName: RUE DES FLEURS
                        buildingNumber: 22BIS
                        floor: Zone industrielle de la Ballastrierre Ouest
                        postBox: BP 40122
                        townName: LIBOURNE CEDEX
                        postCode: '33506'
                        country: FR
                      globalIdentifiers:
                        fr:siren: '349718288'
                        fr:siret: '34971828812345'
                        fr:vat: FR63349718288
                        global:phoneNumber:
                        - '+3221234567'
                        global:email:
                        - contact@supplier.be
                    customer:
                      legalName: Central Argo Trading
                      tradeName: Central Argo Trading
                      address:
                        streetName: Bloemendalelaan
                        buildingNumber: 62/3
                        buildingName: Building West
                        floor: '4'
                        room: '47'
                        townName: Maldegem
                        postCode: '9990'
                        country: BE
                      globalIdentifiers:
                        be:vat: BE0412887923
                        global:phoneNumber:
                        - '+3237890123'
                        global:email:
                        - contact@customer.be
                    delivery:
                      deliveryDate: 2024-01-31
                    prepaid:
                      paymentDate: 2024-08-15
                      code: '55'
                      text: 'Advance payment for order #12345'
                      paymentReference:
                        value: Prepaid invoice ABC002
                        type: UNSTRUCTURED
                  paymentMeans:
                  - code: '42'
                    text: PPayment to bank account, Belgian structured reference
                    paymentReference:
                      value: 001/4037/32870
                      type: STRUCTURED
                      scheme: OGM_VCS
                    paymentAccount:
                      identifier: FR3330002005500000157841Z25
                      scheme: IBAN
                      country: FR
                      currency: EUR
                      bank:
                        identifier: CRLYFRPP
                        scheme: BIC
                    paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-166eca6e81a7
                  allowances:
                  - netAmount: '150'
                    baseAmount: '1000'
                    percentage: '15'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Discount
                    reasonCode: '95'
                  charges:
                  - netAmount: '200'
                    baseAmount: '1000'
                    percentage: '20'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Advertising
                    reasonCode: AA
                  documentTotals:
                    netAmount: '1000'
                    vatAmount: '100'
                    grossAmount: '1100'
                    prepaidAmount: '500'
                    roundingDifference: '1100'
                    payableAmount: '600'
                    linesNetAmount: '900'
                    allowancesNetAmount: '100'
                    chargesNetAmount: '200'
                  vatDetails:
                  - vatCategory: S
                    vatPercentage: '10'
                    netAmount: '1000'
                    vatAmount: '100'
                    exemptionReason: Medical supplies are exempt from VAT
                    exemptionReasonCode: VATEX-EU-79-C
                  uploadId: '123456789'
                  vatChargeableMethod: payment_date
                  vatAlreadyDeclared: true
                  processControl:
                    businessProcess: goods
                  retentionTime: 2029-01-14T19:58:47+02:00
                  status:
                    accept: ACCEPTED
                  category: INVOICE
                  folder: INBOX
                  connections:
                  - id: 00000001-0000-0000-0000-000000000001
                    relationType: SUPPLIER
                  - id: 00000001-0000-0000-0000-000000000002
                    relationType: CUSTOMER
                  lines:
                  - $schema: 
                      https://btx.unifiedpost.com/btx/datastore/document/document_line/v1/document-line-schema.json
                    quantity: '2'
                    unit: H87
                    netAmount: '80.56'
                    currency: USD
                    metadata:
                      externalLineId: A
                      notes:
                      - code: AAA
                        text: Goods item description
                      - code: AAB
                        text: Net 60
                      buyerAccountingReference: CUST-001
                      invoiceReferences:
                      - invoiceReference: ABC002
                        invoiceType: '380'
                        issueDate: 2024-01-14
                        invoiceNumber: ABC002
                      delivery:
                        name: xxxxxx
                        address:
                          department: Service achat
                          streetName: RUE DES FLEURS
                          buildingNumber: 22BIS
                          floor: Zone industrielle de la Ballastrierre Ouest
                          postBox: BP 40122
                          townName: LIBOURNE CEDEX
                          postCode: '33506'
                          country: FR
                        deliveryDate: 2024-01-10
                      startDate: 2024-01-23
                      endDate: 2024-06-23
                      allowances:
                      - netAmount: '20.0'
                        baseAmount: '1000'
                        percentage: '15'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Discount
                        reasonCode: '95'
                      charges:
                      - netAmount: '76.67'
                        baseAmount: '1000'
                        percentage: '20'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Advertising
                        reasonCode: AA
                    pricing:
                      itemNetPrice: '80.56'
                      itemGrossPrice: '96.67'
                      itemPriceQuantity: '40.278192'
                      itemPriceDiscount: '10.0'
                    vatDetails:
                      vatCategory: S
                      vatPercentage: '0.2'
                      vatAmount: '16.11'
                    productIdentifiers:
                      itemId: item1
                      itemCategory: Electronics
                      itemDescription: Noise-cancelling wireless headphones with Bluetooth.
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentV2'
              examples:
                Document:
                  description: Document
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    supplier:
                      id: 00000001-0000-0000-0000-000000000001
                    customer:
                      id: 00000001-0000-0000-0000-000000000002
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      virus: hidden
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    retentionTime: 2023-10-04T14:20:31.502921Z
                    createdAt: 2023-10-04T14:20:31.502921Z
                    updatedAt: 2023-10-04T14:20:31.502921Z
                Document containing lines:
                  description: Document containing lines
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    supplier:
                      id: 00000001-0000-0000-0000-000000000001
                    customer:
                      id: 00000001-0000-0000-0000-000000000002
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      virus: hidden
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    retentionTime: 2023-10-04T14:20:31.502921Z
                    lines:
                    - id: 7a1cf570-db5c-4e41-992e-9890532212ae
                      sequence: 1
                      identifier: identifier 1
                      description: Line item 1
                      itemId: item1
                      itemCategory: category
                      productIdentifiers:
                        commodityCode: '123456'
                      quantity: 2
                      unit: PCS
                      startDate: 2024-01-23
                      endDate: 2024-06-23
                      discounts:
                        value: '20.0'
                      charges:
                        value: '76.67'
                      unitPrice: '40.278192'
                      netAmount: '80.56'
                      grossAmount: '96.67'
                      vatAmount: '16.11'
                      currency: USD
                      vatRate: '0.2'
                      vatCode: VAT
                    createdAt: 2023-10-04T14:20:31.502921Z
                    updatedAt: 2023-10-04T14:20:31.502921Z
        '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-27T12:34:50Z
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                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:
        - client_write
  /v2/spaces/{spaceId}/clients/{clientId}/documents/{documentId}:
    get:
      tags:
      - Documents
      summary: Get document info v2
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get document info v2 on the client space <br/> Scope: client_read"
      operationId: getDocumentV2
      parameters:
      - name: spaceId
        in: path
        description: The partner space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The client identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: include
        in: query
        description: What extra data to include in the response.
        explode: false
        schema:
          type: array
          items:
            type: string
            enum:
            - lines
            - tasks
            - connections
            - timestamps
            - rawData
            - rawLines
            - processingData
            - validationData
            - customCategories
        example: lines,connections
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentV2'
              examples:
                Document:
                  description: Document
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    supplier:
                      id: 00000001-0000-0000-0000-000000000001
                    customer:
                      id: 00000001-0000-0000-0000-000000000002
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      virus: hidden
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    retentionTime: 2023-10-04T14:20:31.502921Z
                    createdAt: 2023-10-04T14:20:31.502921Z
                    updatedAt: 2023-10-04T14:20:31.502921Z
                Document containing lines:
                  description: Document containing lines
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    supplier:
                      id: 00000001-0000-0000-0000-000000000001
                    customer:
                      id: 00000001-0000-0000-0000-000000000002
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      virus: hidden
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    retentionTime: 2023-10-04T14:20:31.502921Z
                    lines:
                    - id: 7a1cf570-db5c-4e41-992e-9890532212ae
                      sequence: 1
                      identifier: identifier 1
                      description: Line item 1
                      itemId: item1
                      itemCategory: category
                      productIdentifiers:
                        commodityCode: '123456'
                      quantity: 2
                      unit: PCS
                      startDate: 2024-01-23
                      endDate: 2024-06-23
                      discounts:
                        value: '20.0'
                      charges:
                        value: '76.67'
                      unitPrice: '40.278192'
                      netAmount: '80.56'
                      grossAmount: '96.67'
                      vatAmount: '16.11'
                      currency: USD
                      vatRate: '0.2'
                      vatCode: VAT
                    createdAt: 2023-10-04T14:20:31.502921Z
                    updatedAt: 2023-10-04T14:20:31.502921Z
        '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-27T12:34:50Z
                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-27T12:34:50Z
                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:
        - client_read
    delete:
      tags:
      - Documents
      summary: Delete document v2
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Delete document v2 on the client space <br/> Scope: client_write"
      operationId: deleteDocumentV2
      parameters:
      - name: spaceId
        in: path
        description: The partner space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The client identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2:
        - client_write
    patch:
      tags:
      - Documents
      summary: Update document v2
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update document v2 by its ID on the given space by sending json with
        the changes <br/> Scope: client_write"
      operationId: updateDocumentV2
      parameters:
      - name: spaceId
        in: path
        description: The partner space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The client identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        description: The document identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Document data to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentPatchRequestV2'
            example:
              metadata:
                supplier:
                  legalName: Jack Doe
                  tradeName: Jack Doe
              tags:
              - seen
              retentionTime: 2029-01-14T19:58:47+02:00
              status:
                accept: UNACCEPTED
              category: INVOICE
              lines:
              - $schema: 
                  https://btx.unifiedpost.com/btx/datastore/document/document_line/v1/document-line-schema.json
                quantity: '2'
                unit: H87
                netAmount: '80.56'
                currency: USD
                metadata:
                  externalLineId: A
                  notes:
                  - code: AAA
                    text: Goods item description
                  - code: AAB
                    text: Net 60
                  buyerAccountingReference: CUST-001
                  invoiceReferences:
                  - invoiceReference: ABC002
                    invoiceType: '380'
                    issueDate: 2024-01-14
                    invoiceNumber: ABC002
                  delivery:
                    name: xxxxxx
                    address:
                      department: Service achat
                      streetName: RUE DES FLEURS
                      buildingNumber: 22BIS
                      floor: Zone industrielle de la Ballastrierre Ouest
                      postBox: BP 40122
                      townName: LIBOURNE CEDEX
                      postCode: '33506'
                      country: FR
                    deliveryDate: 2024-01-10
                  startDate: 2024-01-23
                  endDate: 2024-06-23
                  allowances:
                  - netAmount: '20.0'
                    baseAmount: '1000'
                    percentage: '15'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Discount
                    reasonCode: '95'
                  charges:
                  - netAmount: '76.67'
                    baseAmount: '1000'
                    percentage: '20'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Advertising
                    reasonCode: AA
                pricing:
                  itemNetPrice: '80.56'
                  itemGrossPrice: '96.67'
                  itemPriceQuantity: '40.278192'
                  itemPriceDiscount: '10.0'
                vatDetails:
                  vatCategory: S
                  vatPercentage: '0.2'
                  vatAmount: '16.11'
                productIdentifiers:
                  itemId: item1
                  itemCategory: Electronics
                  itemDescription: Noise-cancelling wireless headphones with Bluetooth.
              connections:
              - id: 00000001-0000-0000-0000-000000000001
                relationType: SUPPLIER
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: replace
              path: /description
              value: patched description
            - op: remove
              path: /foo
        required: true
      responses:
        '200':
          description: Updated document successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentV2'
              example:
                id: 0ca2797b-6365-4bf2-a490-247075e3cede
                spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                description: Sample Document
                source: Sample Source
                folder: PURCHASES
                supplier:
                  id: 00000001-0000-0000-0000-000000000001
                customer:
                  id: 00000001-0000-0000-0000-000000000002
                status:
                  pay: FULLY_PAID
                category: INVOICE
                metadata:
                  virus: hidden
                tags:
                - new
                tasks:
                - extensionName: com.unifiedpost.btx.data:approve
                  status: approve
                retentionTime: 2023-10-04T14:20:31.502921Z
                createdAt: 2023-10-04T14:20:31.502921Z
                updatedAt: 2023-10-04T14:20:31.502921Z
        '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-27T12:34:50Z
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space and/or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                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:
        - client_write
  /v2/spaces/{spaceId}/clients/{clientId}/documents/{documentId}:jsonpatch:
    patch:
      tags:
      - Documents
      summary: Json patch document v2
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update document v2 by its ID on the given space by sending JSON patch
        <br/> Scope: client_write"
      operationId: jsonpatchDocumentV2
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: documentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Document data to update
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: replace
              path: /description
              value: patched description
            - op: remove
              path: /foo
        required: true
      responses:
        '200':
          description: Updated document successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentV2'
              example:
                id: 0ca2797b-6365-4bf2-a490-247075e3cede
                spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                description: Sample Document
                source: Sample Source
                folder: PURCHASES
                supplier:
                  id: 00000001-0000-0000-0000-000000000001
                customer:
                  id: 00000001-0000-0000-0000-000000000002
                status:
                  pay: FULLY_PAID
                category: INVOICE
                metadata:
                  virus: hidden
                tags:
                - new
                tasks:
                - extensionName: com.unifiedpost.btx.data:approve
                  status: approve
                retentionTime: 2023-10-04T14:20:31.502921Z
                createdAt: 2023-10-04T14:20:31.502921Z
                updatedAt: 2023-10-04T14:20:31.502921Z
        '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-27T12:34:50Z
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space and/or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                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:
        - client_write
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
    DocumentRepresentationResult:
      required:
      - main
      type: object
      properties:
        id:
          type: string
          format: uuid
        documentId:
          type: string
          format: uuid
        retentionTime:
          type: string
          format: date-time
        type:
          type: string
        filename:
          type: string
        contentType:
          type: string
        size:
          type: number
        metadata:
          type: object
          additionalProperties:
            type: object
        status:
          type: string
          enum:
          - AWAITING_UPLOAD
          - VIRUS_SCANNING
          - VIRUS_SCANNED
          - VIRUS_ERROR
          - PROCESSING
          - PROCESSED
          - ERROR
        main:
          type: boolean
        uploadUrl:
          type: string
        md5Hash:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        original:
          type: boolean
    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
    DocumentRepresentationRequest:
      required:
      - contentType
      - filename
      - type
      type: object
      properties:
        fileSize:
          type: integer
          format: int32
        retentionTime:
          type: string
          format: date-time
        type:
          type: string
        filename:
          type: string
        contentType:
          type: string
        main:
          type: boolean
        md5Hash:
          type: string
        original:
          type: boolean
    AllDocumentRepresentationResult:
      type: object
      properties:
        document_representations:
          type: array
          items:
            $ref: '#/components/schemas/DocumentRepresentationResult'
        totalElements:
          type: integer
          format: int64
        currentPage:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
    ConnectionData:
      type: object
      properties:
        displayName:
          type: string
        id:
          type: string
          format: uuid
    DocumentResult:
      required:
      - category
      - status
      type: object
      properties:
        id:
          type: string
          format: uuid
        spaceId:
          type: string
          format: uuid
        description:
          type: string
        source:
          type: string
        folder:
          type: string
          enum:
          - AP
          - AR
          - PURCHASES
          - SALES
          - DRAFTS
          - INBOX
          - STATEMENTS
          - FILES
        supplier:
          $ref: '#/components/schemas/ConnectionData'
        customer:
          $ref: '#/components/schemas/ConnectionData'
        status:
          type: object
          additionalProperties:
            type: object
        category:
          type: string
          enum:
          - PURCHASE_ORDER
          - ORDER_CONFIRMATION
          - DELIVERY_NOTE
          - GOODS_RECEIVED_NOTE
          - INVOICE
          - INVOICE_REMINDER
          - CREDIT_NOTE
          - RECEIPT
          - STATEMENT
          - FILE
          - QUOTE
          - CREDITCARD_STATEMENT
          - OTHER
        metadata:
          type: object
          additionalProperties:
            type: object
        tags:
          type: array
          items:
            type: string
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/TaskResult'
        retentionTime:
          type: string
          format: date-time
        lines:
          type: array
          items:
            $ref: '#/components/schemas/LineItemResult'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    LineItemResult:
      required:
      - currency
      - grossAmount
      - quantity
      - sequence
      - unit
      - unitPrice
      type: object
      properties:
        id:
          type: string
          format: uuid
        sequence:
          type: integer
          format: int32
        identifier:
          type: string
        description:
          type: string
        itemId:
          type: string
        itemCategory:
          type: string
        productIdentifiers:
          type: object
          additionalProperties:
            type: object
        quantity:
          type: integer
          format: int32
        unit:
          type: string
        startDate:
          type: string
          format: date
        endDate:
          type: string
          format: date
        discounts:
          type: object
          additionalProperties:
            type: object
        charges:
          type: object
          additionalProperties:
            type: object
        unitPrice:
          type: string
        netAmount:
          type: string
        grossAmount:
          type: string
        vatAmount:
          type: string
        currency:
          type: string
        vatRate:
          type: string
        vatCode:
          type: string
    TaskResult:
      type: object
      properties:
        extensionName:
          type: string
        status:
          type: string
        context:
          type: object
          additionalProperties:
            type: object
    AllDocumentResult:
      type: object
      properties:
        documents:
          type: array
          items:
            $ref: '#/components/schemas/DocumentResult'
        totalElements:
          type: integer
          format: int64
        currentPage:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
    HttpServletResponse:
      type: object
      properties:
        headerNames:
          type: array
          items:
            type: string
        trailerFields:
          type: object
        status:
          type: integer
          format: int32
        characterEncoding:
          type: string
        contentLengthLong:
          type: integer
          format: int64
          writeOnly: true
        committed:
          type: boolean
        bufferSize:
          type: integer
          format: int32
        locale:
          type: object
          properties:
            language:
              type: string
            displayName:
              type: string
            country:
              type: string
            variant:
              type: string
            script:
              type: string
            unicodeLocaleAttributes:
              uniqueItems: true
              type: array
              items:
                type: string
            unicodeLocaleKeys:
              uniqueItems: true
              type: array
              items:
                type: string
            displayLanguage:
              type: string
            displayScript:
              type: string
            displayCountry:
              type: string
            displayVariant:
              type: string
            extensionKeys:
              uniqueItems: true
              type: array
              items:
                type: string
            iso3Language:
              type: string
            iso3Country:
              type: string
        contentType:
          type: string
        contentLength:
          type: integer
          format: int32
          writeOnly: true
        outputStream:
          $ref: '#/components/schemas/ServletOutputStream'
        writer:
          type: object
    ServletOutputStream:
      type: object
      properties:
        writeListener:
          $ref: '#/components/schemas/WriteListener'
        ready:
          type: boolean
    WriteListener:
      type: object
    GetOrCreateRepresentationRequest:
      required:
      - documentType
      type: object
      properties:
        documentType:
          type: string
    JsonPatch:
      type: object
    UpdateDocumentRequest:
      type: object
      properties:
        metadata:
          type: object
          additionalProperties:
            type: object
            description: Document metadata
            example:
              issueDate: 2024-01-01
              dueDate: 2024-01-02
          description: Document metadata
          example:
            issueDate: 2024-01-01
            dueDate: 2024-01-02
        status:
          type: object
          additionalProperties:
            type: object
            description: Status of the document
            example:
              pay: FULLY_PAID
          description: Status of the document
          example:
            pay: FULLY_PAID
        category:
          type: string
          enum:
          - PURCHASE_ORDER
          - ORDER_CONFIRMATION
          - DELIVERY_NOTE
          - GOODS_RECEIVED_NOTE
          - INVOICE
          - INVOICE_REMINDER
          - CREDIT_NOTE
          - RECEIPT
          - STATEMENT
          - FILE
          - QUOTE
          - CREDITCARD_STATEMENT
          - OTHER
    Data:
      type: object
      properties:
        spaceId:
          type: string
        partnerId:
          type: string
        clientId:
          type: string
    ExtensionCreatedMessage:
      required:
      - category
      - type
      type: object
      properties:
        resourceId:
          type: string
        scope:
          type: string
        category:
          type: string
        type:
          type: string
        orderGroup:
          type: string
        data:
          $ref: '#/components/schemas/Data'
        valid:
          type: boolean
    ExtensionDeletedMessage:
      required:
      - category
      - type
      type: object
      properties:
        resourceId:
          type: string
        scope:
          type: string
        category:
          type: string
        type:
          type: string
        orderGroup:
          type: string
        data:
          $ref: '#/components/schemas/Data'
        valid:
          type: boolean
    ExtensionUpdatedMessage:
      required:
      - category
      - type
      type: object
      properties:
        resourceId:
          type: string
        scope:
          type: string
        category:
          type: string
        type:
          type: string
        orderGroup:
          type: string
        data:
          $ref: '#/components/schemas/Data'
        valid:
          type: boolean
    PartnerLinkDeletedMessage:
      required:
      - category
      - type
      type: object
      properties:
        resourceId:
          type: string
        scope:
          type: string
        category:
          type: string
        type:
          type: string
        orderGroup:
          type: string
        data:
          $ref: '#/components/schemas/Data'
    ClientResult:
      type: object
      properties:
        id:
          type: string
          description: Client ID
          format: uuid
          example: 69f296a5-fb7e-47d8-a1de-bd528f0038b0
        name:
          type: string
          description: Client name
          example: Client A
        identifiers:
          $ref: '#/components/schemas/JsonBMap'
        addresses:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SepaStructuredAddress'
          description: Addresses
          example:
            main:
              streetName: Nitzsche Lodge
              house: '80728'
              postalCode: '3110'
              city: Fernandahaven
              country: Belgium
              countryCode: BE
              postBox: PO123
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/ContactResult'
        syncPlatforms:
          type: array
          items:
            type: string
            description: List of sync platforms
            example: '["Google Drive","Yuki"]'
        status:
          $ref: '#/components/schemas/ClientStatus'
        clientSpaceUrl:
          type: string
          description: URL to the BTX Space endpoint of this client
          example: 
            https://api.dev.btx.eu.banqup.com/entitystore/v1/directory/entities/d1cbd185-8e94-49bb-b25a-9a7dd0c23d37/spaces/94e29950-a87a-4fb5-b3dd-c2ef1d419431
        clientEntityId:
          type: string
          description: Client entity id
          format: uuid
          example: d1cbd185-8e94-49bb-b25a-9a7dd0c23d37
        clientSpaceId:
          type: string
          description: Client space id
          format: uuid
          example: 94e29950-a87a-4fb5-b3dd-c2ef1d419431
        spaceExtensions:
          type: array
          description: List of installed extensions of the client space
          items:
            type: object
            additionalProperties:
              type: object
    ClientStatus:
      type: string
      description: Client status
      example: INVITED
      enum:
      - DRAFT
      - INVITED
      - INVITATION_REJECTED
      - ACCESS_REJECTED
      - ARCHIVE
      - LOST
      - ACTIVE
    ContactResult:
      type: object
      properties:
        id:
          type: string
          description: Contact ID
          format: uuid
          example: 6af2665d-3cd3-4aeb-a6cb-39f6e59c6cff
        firstName:
          type: string
          description: First name
          example: John
        lastName:
          type: string
          description: Last name
          example: D.
        mobile:
          type: string
          description: 'The contact mobile. Expecting E.164 international phone number
            format : +[country code][area code][local phone number]'
          example: '+32497666003'
        email:
          type: string
          description: Email
          example: john.d@example.com
        language:
          type: string
          description: Language
          example: en
      description: List of contacts
    SepaStructuredAddress:
      required:
      - city
      type: object
      properties:
        streetName:
          type: string
          description: Name of the street
          example: Avenue Reine Astrid
        house:
          type: string
        buildingNumber:
          type: string
          description: A unique number assigned to the building in the street or area
          example: A22
        level:
          type: string
        postalCode:
          type: string
          description: Series of letters or digits or both, included in a postal address
          example: 12345-1A
        city:
          type: string
          description: Name of the city
          example: La Hulpe
        state:
          type: string
          description: Name of the state
          example: California
        country:
          type: string
          description: Name of the country
          example: Belgium
        countryCode:
          type: string
          description: Two-letter country code defined in ISO 3166
          example: BE
        province:
          type: string
        postalCodeExtension:
          type: string
        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: 35
          type: string
          description: Name of the building or house.
          example: Empire State Building
        floor:
          maxLength: 70
          type: string
          description: A unique number or name assigned to the floor within the building
          example: ground
        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: '1033'
        room:
          maxLength: 70
          type: string
          description: Building room number.
          example: '2.22'
        cityLocationName:
          maxLength: 35
          type: string
          description: Specific location name within the town.
          example: City center
        district:
          type: string
          description: Identifies a subdivision within a country sub-division
          example: Walloon Brabant
        subDistrict:
          maxLength: 35
          type: string
          description: Identifies a subdivision of a country such as state, region,
            county.
          example: Wallonia
      description: |
        EPC Interbank Structured Address Structure. Structured addresses are address information split into several fields instead of one unstructured address field.
        From November 2023, all banks and PSPs will have to accept payment messages with structured addresses.
        From 2025, banks and PSPs will have to send all their messages with structured addresses.
      example:
        main:
          streetName: Nitzsche Lodge
          house: '80728'
          postalCode: '3110'
          city: Fernandahaven
          country: Belgium
          countryCode: BE
          postBox: PO123
      externalDocs:
        description: More about EPC Interbank Structured Address Structure
        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
    ClientRequest:
      required:
      - name
      type: object
      properties:
        name:
          type: string
          description: Client name
          example: Client A
        identifiers:
          $ref: '#/components/schemas/JsonBMap'
        addresses:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SepaStructuredAddress'
          description: Addresses
          example:
            main:
              streetName: Nitzsche Lodge
              house: '80728'
              postalCode: '3110'
              city: Fernandahaven
              country: Belgium
              countryCode: BE
              postBox: PO123
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/ContactRequest'
        syncPlatforms:
          type: array
          items:
            type: string
            description: List of sync platforms
            example: '["Google Drive","Yuki"]'
    ContactRequest:
      type: object
      properties:
        firstName:
          type: string
          description: First name
          example: John
        lastName:
          type: string
          description: Last name
          example: D.
        mobile:
          type: string
          description: 'The contact mobile. Expecting E.164 international phone number
            format : +[country code][area code][local phone number]'
          example: '+32497666003'
        email:
          type: string
          description: Email
          example: john.d@example.com
        language:
          type: string
          description: Language
          example: en
      description: List of contacts
    ClientResultList:
      type: object
      properties:
        clients:
          type: array
          items:
            $ref: '#/components/schemas/ClientResult'
        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
    PermissionListItem:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the permission.
        scope:
          type: string
          description: The scope name associated with the permission.
          example: client_read
        granted:
          type: boolean
          description: Indicates whether the permission is granted or not (true/false).
      description: the list of permissions
    PermissionListResult:
      required:
      - permissions
      - requester
      type: object
      properties:
        requester:
          type: string
          description: the requester
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/PermissionListItem'
      description: List of permissions
    PermissionsWrapperResult:
      required:
      - subjects
      type: object
      properties:
        subjects:
          type: array
          items:
            $ref: '#/components/schemas/PermissionListResult'
    PermissionResult:
      type: object
      properties:
        requester:
          type: string
          description: The identifier of the requester who is requesting the permission.
        id:
          type: string
          description: The unique identifier for the permission.
        scope:
          type: string
          description: The scope name associated with the permission.
          example: entity_read
        granted:
          type: boolean
          description: Indicates whether the permission is granted or not (true/false).
    PermissionRequest:
      type: object
      properties:
        requester:
          type: string
          description: OIDC subject that identifies the user or service account for
            which the permission is granted.
        permission:
          type: string
          description: The permission to be granted
    AllExtensionResult:
      type: object
      properties:
        extensions:
          type: array
          items:
            $ref: '#/components/schemas/ExtensionResult'
        totalElements:
          type: integer
          format: int64
        currentPage:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
    ExtensionAccessManagement:
      type: object
      properties:
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/ExtensionPermission'
        customResources:
          type: array
          items:
            type: object
        permissionRoles:
          type: array
          items:
            type: object
        roleGroups:
          type: array
          items:
            type: string
        defaultGroups:
          type: array
          items:
            type: string
    ExtensionPermission:
      type: object
      properties:
        resource:
          type: string
          enum:
          - entity
          - space
          - client
        scope:
          type: string
    ExtensionResult:
      type: object
      properties:
        extensionId:
          type: string
          format: uuid
        version:
          type: string
        namespace:
          type: string
        name:
          type: string
        category:
          type: string
          enum:
          - APPLICATION
          - CONNECTOR
          - SERVICE
        status:
          type: string
          enum:
          - ACTIVE
          - INACTIVE
          - PENDING
          - ERROR
        settings:
          type: object
          additionalProperties:
            type: object
        pluginExtensions:
          type: array
          items:
            type: object
            additionalProperties:
              type: object
        additionalScopes:
          type: object
          additionalProperties:
            type: object
        dependencies:
          type: array
          items:
            type: object
            additionalProperties:
              type: object
        frontendModules:
          type: array
          items:
            type: object
        minAssuranceLevels:
          type: object
          additionalProperties:
            type: string
            enum:
            - urn:btx:L1
            - urn:btx:L2
            - urn:btx:L3
            - urn:btx:L50
            - urn:btx:L100
        appCallbacks:
          type: object
          additionalProperties:
            type: object
        serviceAccount:
          type: string
        supportClients:
          type: boolean
        accessManagement:
          $ref: '#/components/schemas/ExtensionAccessManagement'
        clientConfigurations:
          type: object
          additionalProperties:
            type: object
        errorReason:
          type: string
        hasNewVersion:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/ExtensionPermission'
        tings:
          $ref: '#/components/schemas/ExtensionResult'
    UpdateClientRequest:
      type: object
      properties:
        name:
          type: string
          description: Client name
          example: Client A
        identifiers:
          $ref: '#/components/schemas/JsonBMap'
        addresses:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SepaStructuredAddress'
          description: Addresses
          example:
            main:
              streetName: Nitzsche Lodge
              house: '80728'
              postalCode: '3110'
              city: Fernandahaven
              country: Belgium
              countryCode: BE
              postBox: PO123
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/UpdateContactRequest'
        syncPlatforms:
          type: array
          items:
            type: string
            description: List of sync platforms
            example: '["Google Drive","Yuki"]'
        status:
          type: string
        clientSpaceUrl:
          type: string
          description: URL to the BTX Space endpoint of this client
          example: 
            https://api.dev.btx.eu.banqup.com/entitystore/v1/directory/entities/00000001-0000-0000-0000-000000000000/spaces/00000001-0000-0000-0000-000000000000
    UpdateContactRequest:
      type: object
      properties:
        firstName:
          type: string
          description: First name
          example: John
        lastName:
          type: string
          description: Last name
          example: D.
        mobile:
          type: string
          description: 'The contact mobile. Expecting E.164 international phone number
            format : +[country code][area code][local phone number]'
          example: '+32497666003'
        email:
          type: string
          description: Email
          example: john.d@example.com
        language:
          type: string
          description: Language
          example: en
      description: List of contacts
    AllEventResult:
      required:
      - currentPage
      - pageSize
      type: object
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/EventResult'
        totalElements:
          type: integer
          format: int64
        currentPage:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
    EventResult:
      type: object
      properties:
        id:
          type: string
          format: uuid
        level:
          type: string
          enum:
          - INFO
          - WARN
          - ERROR
        subjectId:
          type: string
          format: uuid
        subjectType:
          type: string
        ownerId:
          type: string
          format: uuid
        ownerType:
          type: string
          enum:
          - SPACE
          - ENTITY
          - PAYMENT_ACCOUNT
        body:
          type: string
        category:
          type: string
        subcategory:
          type: string
        metadata:
          type: object
          additionalProperties:
            type: object
        properties:
          type: object
          additionalProperties:
            type: object
        createdAt:
          type: string
          format: date-time
    DocumentV2:
      required:
      - category
      - folder
      - id
      - metadata
      - retentionTime
      - spaceId
      - status
      type: object
      properties:
        timestamps:
          $ref: '#/components/schemas/Timestamps'
        lines:
          $ref: '#/components/schemas/JsonNullableListLineItemV2'
        tasks:
          $ref: '#/components/schemas/JsonNullableListTaskV2'
        customCategories:
          type: object
          additionalProperties:
            uniqueItems: true
            type: array
            items:
              type: string
        connections:
          $ref: '#/components/schemas/JsonNullableListDocumentConnectionData'
        id:
          type: string
          format: uuid
        spaceId:
          type: string
          format: uuid
        description:
          type: string
        source:
          type: string
        folder:
          type: string
          enum:
          - PURCHASES
          - SALES
          - DRAFTS
          - INBOX
          - STATEMENTS
          - FILES
        status:
          type: object
          additionalProperties:
            type: object
        category:
          type: string
          enum:
          - PURCHASE_ORDER
          - ORDER_CONFIRMATION
          - DELIVERY_NOTE
          - GOODS_RECEIVED_NOTE
          - INVOICE
          - INVOICE_REMINDER
          - CREDIT_NOTE
          - RECEIPT
          - STATEMENT
          - FILE
          - QUOTE
          - CREDITCARD_STATEMENT
          - OTHER
        metadata:
          type: object
          additionalProperties:
            type: object
        tags:
          type: array
          items:
            type: string
        retentionTime:
          type: string
          format: date-time
        processingData:
          type: object
          additionalProperties:
            type: object
        validationData:
          type: object
          additionalProperties:
            type: object
        rawLinesData:
          type: object
          additionalProperties:
            type: object
        rawData:
          type: object
          additionalProperties:
            type: object
    JsonNullableListDocumentConnectionData:
      type: object
      properties:
        present:
          type: boolean
    JsonNullableListLineItemV2:
      type: object
      properties:
        present:
          type: boolean
    JsonNullableListTaskV2:
      type: object
      properties:
        present:
          type: boolean
    Timestamps:
      type: object
      properties:
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ConnectionRelationType:
      type: string
      description: Connection relation type
      example: CUSTOMER
      enum:
      - CUSTOMER
      - SUPPLIER
      - ACCOUNTANT
      - PARTNER
      - GROUP
    DocumentCategory:
      type: string
      description: Document category
      example: PURCHASE_ORDER
      enum:
      - PURCHASE_ORDER
      - ORDER_CONFIRMATION
      - DELIVERY_NOTE
      - GOODS_RECEIVED_NOTE
      - INVOICE
      - INVOICE_REMINDER
      - CREDIT_NOTE
      - RECEIPT
      - STATEMENT
      - FILE
      - QUOTE
      - CREDITCARD_STATEMENT
      - OTHER
    DocumentConnectionRequest:
      required:
      - id
      - relationType
      type: object
      properties:
        id:
          type: string
          description: Relation ID of the connection to be saved as document connection.
            Must exist.
          format: uuid
          example: 4c32d3fb-0023-470c-ae21-105274a94706
        relationType:
          $ref: '#/components/schemas/ConnectionRelationType'
    DocumentRequestV2:
      required:
      - category
      - retentionTime
      - status
      type: object
      properties:
        waitForComplete:
          type: boolean
          description: Whether the document needs to wait for call to /complete endpoint,
            after representations have been uploaded
          example: true
        description:
          type: string
          description: Description of the document.
          example: This is the invoice for your new phone
        source:
          type: string
          description: Source of the document.
          example: choruspro
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        tags:
          type: array
          description: Document tags
          example:
          - expensive
          items:
            type: string
            description: Document tags
            example: '["expensive"]'
        retentionTime:
          type: string
          description: Expiry datetime for the document
        connections:
          type: array
          description: List of connection information
          nullable: true
          items:
            $ref: '#/components/schemas/DocumentConnectionRequest'
        status:
          $ref: '#/components/schemas/JsonBMap'
        category:
          $ref: '#/components/schemas/DocumentCategory'
        folder:
          $ref: '#/components/schemas/FolderV2'
        lines:
          type: array
          items:
            $ref: '#/components/schemas/JsonBMap'
        customCategories:
          type: object
          additionalProperties:
            uniqueItems: true
            type: array
            description: Document's custom categories
            example:
              purchases:
              - fuel
              - restaurant
            items:
              type: string
              description: Document's custom categories
              example: '{"purchases":["fuel","restaurant"]}'
          description: Document's custom categories
          example:
            purchases:
            - fuel
            - restaurant
    FolderV2:
      type: string
      description: Document folder v2
      example: INBOX
      enum:
      - PURCHASES
      - SALES
      - DRAFTS
      - INBOX
      - STATEMENTS
      - FILES
    LineItemData:
      $ref: '#/components/schemas/JsonBMap'
    ListDocumentsResponseV2:
      type: object
      properties:
        documents:
          type: array
          items:
            $ref: '#/components/schemas/DocumentV2'
        totalElements:
          type: integer
          format: int64
        currentPage:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
    ListDocumentsQueryParamsSingle:
      type: object
      properties:
        category:
          type: string
          description: Document category to filter. Can be multiple values separated
            by comma, or just one value
          example: PURCHASE_ORDER,RECEIPT
        connectionName[istart]:
          type: string
          description: Value for filtering by connection name having a specific prefix
          example: UNI
        connectionName[icont]:
          type: string
          description: Value for filtering by connection name containing a specific
            string anywhere in the string value
          example: nif
        documentNumber[istart]:
          type: string
          description: Value for filtering by documentNumber property having a specific
            prefix
          example: NR
        documentNumber[icont]:
          type: string
          description: Value for filtering by documentNumber property containing a
            specific string anywhere in the string value
          example: NR
        status[ql]:
          type: string
          description: Status query language DSL
          example: (document=FULLY_APPROVED OR document=SENT) AND (pay=FULLY_PAID
            OR pay=PARTIALLY_PAID)
        customCategories[ql]:
          type: string
          description: Custom categories language DSL
          example: (purchases=fuel AND purchases=restaurant AND purchases=groceries)
            OR purchases=books
        processingData:
          type: string
          description: processingData query param
          example: 
            processingData=spaceExtensions/com.unifiedpost.btx.connectors/peppol/sbdhInstanceIdentifiers[any]=12345_118e3040-51d2-11e3-8f96-0800200c9a66,92345_118e3040-51d2-11e3-8f96-0800200c9a66
        folder:
          $ref: '#/components/schemas/FolderV2'
        source:
          type: string
          description: Document source.
          example: documentCreator
        createdAt[eq]:
          type: string
          description: Created at equals specific timestamp, iso datetime format
          format: date-time
        createdAt[ne]:
          type: string
          description: Created at does not equal specific timestamp, iso datetime
            format
          format: date-time
        createdAt[lt]:
          type: string
          description: Created is less than specific timestamp, iso datetime format
          format: date-time
        createdAt[lte]:
          type: string
          description: Created is less or equal than specific timestamp, iso datetime
            format
          format: date-time
        createdAt[gt]:
          type: string
          description: Created is greater than specific timestamp, iso datetime format
          format: date-time
        createdAt[gte]:
          type: string
          description: Created is greater than specific timestamp, iso datetime format
          format: date-time
        dueDate[eq]:
          type: string
          description: Due date date equals, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        dueDate[ne]:
          type: string
          description: Due date not equals to specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        dueDate[gt]:
          type: string
          description: Due date greater than specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        dueDate[gte]:
          type: string
          description: Due date greater or equal to a specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        dueDate[lt]:
          type: string
          description: Due date less than a specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        dueDate[lte]:
          type: string
          description: Due date less than or equal to a specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[eq]:
          type: string
          description: Issue date date equals, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[ne]:
          type: string
          description: Issue date not equals to specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[gt]:
          type: string
          description: Issue date greater than specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[gte]:
          type: string
          description: Issue date greater or equal to a specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[lt]:
          type: string
          description: Issue date less than a specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[lte]:
          type: string
          description: Issue date less than or equal to a specific date, in format
            yyyy-MM-dd
          format: date
          example: 2024-04-15
        grossAmount[eq]:
          type: number
          description: Gross amount equal to
          example: 12.25
        grossAmount[ne]:
          type: number
          description: Gross amount not equal
          example: 12.25
        grossAmount[gt]:
          type: number
          description: Gross amount greater than
          example: 12.25
        grossAmount[gte]:
          type: number
          description: Gross amount greater than or equal to
          example: 12.25
        grossAmount[lt]:
          type: number
          description: Gross amount less than
          example: 12.25
        grossAmount[lte]:
          type: number
          description: Gross amount less than or equal to
          example: 12.25
        payableAmount[eq]:
          type: number
          description: Payable amount equal to
          example: 12.25
        payableAmount[ne]:
          type: number
          description: Payable amount not equal
          example: 12.25
        payableAmount[gt]:
          type: number
          description: Payable amount greater than
          example: 12.25
        payableAmount[gte]:
          type: number
          description: Payable amount greater than or equal to
          example: 12.25
        payableAmount[lt]:
          type: number
          description: Payable amount less than
          example: 12.25
        payableAmount[lte]:
          type: number
          description: Payable amount less than or equal to
          example: 12.25
    DocumentInclude:
      type: string
      description: The possible linked resources to include
      example: lines
      enum:
      - lines
      - tasks
      - connections
      - timestamps
      - rawData
      - rawLines
      - processingData
      - validationData
      - customCategories
    DocumentPatchRequestV2:
      type: object
      properties:
        description:
          type: string
          description: Description of the document.
          nullable: true
          example: This is the invoice for your new phone
        source:
          type: string
          description: Source of the document.
          nullable: true
          example: choruspro
        metadata:
          $ref: '#/components/schemas/JsonBMapNullable'
        tags:
          type: array
          description: Document tags
          nullable: true
          example:
          - expensive
          items:
            type: string
        retentionTime:
          type: string
          description: Expiry datetime for the document
          nullable: true
        status:
          $ref: '#/components/schemas/JsonBMapNullable'
        folder:
          $ref: '#/components/schemas/FolderV2'
        category:
          $ref: '#/components/schemas/DocumentCategory'
        lines:
          type: array
          description: List of line data
          nullable: true
          items:
            $ref: '#/components/schemas/JsonBMap'
        connections:
          type: array
          description: List of connection data
          nullable: true
          items:
            $ref: '#/components/schemas/DocumentConnectionRequest'
        customCategories:
          type: object
          additionalProperties:
            uniqueItems: true
            type: array
            description: Custom categories to replace
            nullable: true
            example:
              purchases:
              - fuel
              - restaurant
            items:
              type: string
              description: Custom categories to replace
              nullable: true
              example: '{"purchases":["fuel","restaurant"]}'
          description: Custom categories to replace
          nullable: true
          example:
            purchases:
            - fuel
            - restaurant
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.btx.fr.banqup.com/oauth2/client_credential/gettoken
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
        authorizationCode:
          authorizationUrl: https://api.btx.fr.banqup.com/oauth2/auth
          tokenUrl: https://api.btx.fr.banqup.com/oauth2/token
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
