openapi: 3.0.1
info:
  title: workspace_partner API
  description: Merged OpenAPI spec for workspace_partner domain
  version: 1.0.0
servers:
- url: https://api.btx.fr.banqup.com/workspace/partner
paths:
  /v1/spaces/{spaceId}/extensions/{extensionId}/clients:
    get:
      tags:
      - Spaces
      summary: Get extension 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 all extension clients of space <br/> Scope: space_read'
      operationId: getAllExtensionClients
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: extensionId
        in: path
        description: The extension's app ID
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: query
        description: The client’s identifier
        schema:
          type: string
          format: uuid
        example: 209f5481-58ca-4bd6-b56a-b7ad7abce548
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllExtensionClientResult'
              example: "{\n   clients: [\n\t\t{\n\t\t   \"id\": \"209f5481-58ca-4bd6-b56a-b7ad7abce548\"\
                ,\n\t\t   \"appCallbacks\": {\n\t\t\t \"activationUrl\": \"https://api.test.btx.eu.banqup.com/entitycallback/v1/spaces/32026548-88a8-40bb-9e23-64dc2691cb2d/extensions/0ca2797b-6365-4bf2-a490-247075e3cede/clients/abbf9959-c5aa-49ac-9032-f417c636fc5d/activate\"\
                ,\n\t\t\t \"deactivationUrl\": \"https://api.test.btx.eu.banqup.com/entitycallback/v1/spaces/32026548-88a8-40bb-9e23-64dc2691cb2d/extensions/0ca2797b-6365-4bf2-a490-247075e3cede/clients/abbf9959-c5aa-49ac-9032-f417c636fc5d/deactivate\"\
                ,\n\t\t\t \"configureUrl\": \"https://api.test.btx.eu.banqup.com/entitycallback/v1/spaces/32026548-88a8-40bb-9e23-64dc2691cb2d/extensions/0ca2797b-6365-4bf2-a490-247075e3cede/clients/abbf9959-c5aa-49ac-9032-f417c636fc5d/configure\"\
                \n\t\t   },\n\t\t   \"settings\": {\n\t\t\t \"email\": \"example@chorus.com\"\
                ,\n\t\t\t \"locale\": \"en\"\n\t\t   },\n\t\t   \"status\": \"ACTIVE\"\
                \n\t\t}\n\t],\n\t\"totalElements\": 100,\n    \"currentPage\": 0,\n\
                \    \"pageSize\": 10\n}"
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
    post:
      tags:
      - Spaces
      summary: Active client's extension
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Activate extension for client of a partner space <br/> Scope: space_write'
      operationId: activateClientExtension
      parameters:
      - name: spaceId
        in: path
        description: The partner space's identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: extensionId
        in: path
        description: The partner extension's app ID
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Client's data for extension activation
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtensionClientRequest'
            example:
              clientId: 00000001-0001-0000-0000-000000000000
              clientSpaceUrl: https://api.dev.btx.eu.banqup.com/entitystore/v1/directory/entities/00000001-0000-0000-0000-000000000000/spaces/00000002-0001-0000-0000-000000000000
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtensionClientResponse'
              example: "\t\t{\n\t\t  \"clientId\": \"209f5481-58ca-4bd6-b56a-b7ad7abce548\"\
                ,\n\t\t  \"appCallbacks\": {\n\t\t    \"activationUrl\": \"https://api.test.btx.eu.banqup.com/entitycallback/v1/spaces/{partnerSpaceId}/extensions/{extensionId}/clients/{clientId}/activate\"\
                ,  // return if status != ACTIVE\n\t\t    \"deactivationUrl\": \"\
                https://api.test.btx.eu.banqup.com/entitycallback/v1/spaces/{partnerSpaceId}/extensions/{extensionId}/clients/{clientId}/deactivate\"\
                , // return if status == ACTIVE\n\t\t    \"configureUrl\": \"https://api.test.btx.eu.banqup.com/entitycallback/v1/spaces/{partnerSpaceId}/extensions/{extensionId}/clients/{clientId}/configure\"\
                \  // always return\n\t\t  },\n\t\t  \"settings\": {\n\t\t    \"email\"\
                : \"example@chorus.com\",\n\t\t    \"locale\": \"en\"\n\t\t  },\n\t\
                \t  \"status\": \"ACTIVE\"\n\t\t}\n"
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /v1/spaces/{spaceId}/extensions/{extensionId}/clients/{clientId}:
    get:
      tags:
      - Spaces
      summary: Get extension 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/> Get extension client details <br/> Scope: space_read'
      operationId: getExtensionClient
      parameters:
      - name: spaceId
        in: path
        description: The partner space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: extensionId
        in: path
        description: The partner's extension identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: Client's unique identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtensionClientResult'
              examples:
                Active extension client:
                  description: Active extension client
                  value:
                    id: 00000001-0001-0000-0000-000000000000
                    appCallbacks:
                      deactivationUrl: https://api.btx.banqup.com/entitycallback/v1/spaces/{partnerSpaceId}/extensions/{extensionId}/clients/{clientId}/deactivate
                      configureUrl: https://api.btx.banqup.com/entitycallback/v1/spaces/{partnerSpaceId}/extensions/{extensionId}/clients/{clientId}/configure
                    settings:
                      email: example@chorus.com
                      locale: en
                    status: ACTIVE
                Inactive extension client:
                  description: Inactive extension client
                  value:
                    id: 00000001-0001-0000-0000-000000000000
                    appCallbacks:
                      activationUrl: https://api.btx.banqup.com/entitycallback/v1/spaces/{partnerSpaceId}/extensions/{extensionId}/clients/{clientId}/activate
                      configureUrl: https://api.btx.banqup.com/entitycallback/v1/spaces/{partnerSpaceId}/extensions/{extensionId}/clients/{clientId}/configure
                    settings:
                      email: example@chorus.com
                      locale: en
                    status: INACTIVE
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
    delete:
      tags:
      - Spaces
      summary: Delete client extension
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Delete client extension with ID <br/> Scope: space_write'
      operationId: deleteClientExtension
      parameters:
      - name: spaceId
        in: path
        description: The partner space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: extensionId
        in: path
        description: The partner's extension identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: Client's unique identifier
        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-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_write
  /v1/spaces/{spaceId}/extensions/{extensionId}/clients/{clientId}/settings:
    patch:
      tags:
      - Spaces
      summary: Update settings for the extension 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 settings for the extension client via JSON patch <br/> Scope:
        extension_config'
      operationId: patchExtensionClientSettings
      parameters:
      - name: spaceId
        in: path
        description: The space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: extensionId
        in: path
        description: The extension's app identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The client identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Json patch operations to be applied to the settings
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: replace
              path: /email
              value: user@extension.com
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              example:
                email: user@extension.com
                iban: '12345'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - extension_config
  /v1/spaces/{spaceId}/extensions/{extensionId}/clients/{clientId}:updateStatus:
    put:
      tags:
      - Spaces
      summary: Update client extension's status
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update extension status for a client <br/> Scope: extension_config'
      operationId: updateClientExtensionStatus
      parameters:
      - name: spaceId
        in: path
        description: The partner space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: extensionId
        in: path
        description: The partner's extension identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: Client's unique identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Status to change
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtensionStatusDto'
            example:
              status: ACTIVE
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtensionStatusDto'
              example:
                status: ACTIVE
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - extension_config
  /v1/entities/{entityId}/taxRegistrations/{taxRegistrationId}:assignSpaces:
    post:
      tags:
      - Entities
      summary: Assign one ore more spaces to a taxRegistration
      description: 'Assign one ore more spaces to a taxRegistration <br/> Scope: entity_write'
      operationId: taxRegistrationAssignSpaces
      parameters:
      - name: entityId
        in: path
        description: The entity uuid identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: taxRegistrationId
        in: path
        description: The tax registration uuid identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: List of space ids to assign
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpacesList'
            example:
              spaces:
              - 00000001-0000-0000-0000-000000000000
        required: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaxRegistrationResult'
              example:
                id: 1fa85f24-5717-4562-b3fc-2c963f66afa6
                taxId: DE44444444
                country: US
                type: Corporate
                voluntaryTax: true
                oss: false
                startDate: 2024-01-23
                endDate: 2025-01-23
                vatGroup:
                  name: Retail company 1
                  startDate: 2024-01-23
                  endDate: 2025-01-23
                spaces:
                - id: 00000001-0000-0000-0000-000000000000
                  name: Business space
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2:
        - entity_write
  /v1/entities/{entityId}/taxRegistrations/{taxRegistrationId}:unassignSpaces:
    post:
      tags:
      - Entities
      summary: Unassign one or more spaces from a taxRegistration
      description: 'Unassign one or more spaces from a taxRegistration <br/> Scope:
        entity_write'
      operationId: taxRegistrationUnassignSpaces
      parameters:
      - name: entityId
        in: path
        description: The entity uuid identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: taxRegistrationId
        in: path
        description: The tax registration uuid identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: List of space ids to unassign
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpacesList'
            example:
              spaces:
              - 00000001-0000-0000-0000-000000000000
        required: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaxRegistrationResult'
              example:
                id: 1fa85f24-5717-4562-b3fc-2c963f66afa6
                taxId: DE44444444
                country: US
                type: Corporate
                voluntaryTax: true
                oss: false
                startDate: 2024-01-23
                endDate: 2025-01-23
                vatGroup:
                  name: Retail company 1
                  startDate: 2024-01-23
                  endDate: 2025-01-23
                spaces:
                - id: 00000001-0000-0000-0000-000000000000
                  name: Business space
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2:
        - entity_write
  /v1/spaces/{partnerSpaceId}/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: partnerSpaceId
        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: mainRepresentation
        in: query
        description: Whether the document is main or not
        schema:
          type: boolean
      - name: original
        in: query
        description: Whether the document is original or not
        schema:
          type: boolean
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllDocumentRepresentationResult'
              example:
                document_representations:
                - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                  documentId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                  retentionTime: 2024-08-12 09:26:51.434000+00:00
                  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-12 09:26:51.434000+00:00
                  updatedAt: 2024-08-12 09:26:51.434000+00:00
                totalElements: 1
                currentPage: 0
                pageSize: 20
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      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: partnerSpaceId
        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 representation data to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentRepresentationRequest'
            example:
              fileSize: 10
              retentionTime: 2023-10-04 14:20:31.502921+00:00
              type: legal_xml
              filename: legal_xml.xml
              contentType: application/xml
              main: false
              md5Hash: 938c2cc0dcc05f2b68c4287040cfcf71
        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-12 09:26:51.434000+00:00
                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-12 09:26:51.434000+00:00
                updatedAt: 2024-08-12 09:26:51.434000+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2:
        - client_write
  /v1/spaces/{partnerSpaceId}/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: partnerSpaceId
        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
        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-12 09:26:51.434000+00:00
                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-12 09:26:51.434000+00:00
                updatedAt: 2024-08-12 09:26:51.434000+00:00
        '404':
          description: Not Found. Document uuid must be invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      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: partnerSpaceId
        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-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2:
        - client_write
  /v1/spaces/{partnerSpaceId}/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: partnerSpaceId
        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-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2:
        - client_read
  /v1/spaces/{partnerSpaceId}/clients/{clientId}/documents/{documentId}:
    get:
      tags:
      - Documents
      summary: ⚠️Get document info in folder
      description: Get document information by its ID in the given folder
      operationId: getClientDocument
      parameters:
      - name: partnerSpaceId
        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: 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-04 14:20:31.502921+00:00
                    createdAt: 2023-10-04 14:20:31.502921+00:00
                    updatedAt: 2023-10-04 14:20:31.502921+00:00
                Document 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-04 14:20:31.502921+00:00
                    lines:
                    - id: 7a1cf570-db5c-4e41-992e-9890532212ae
                      sequence: 1
                      identifier: identifier 1
                      description: Line item 1
                      itemId: item1
                      itemCategory: category
                      productIdentifiers:
                        commodityCode: '123456'
                      quantity: 2
                      unit: PCS
                      startDate: 2024-01-23
                      endDate: 2024-06-23
                      discounts:
                        value: '20.0'
                      charges:
                        value: '76.67'
                      unitPrice: '40.278192'
                      netAmount: '80.56'
                      grossAmount: '96.67'
                      vatAmount: '16.11'
                      currency: USD
                      vatRate: '0.2'
                      vatCode: VAT
                    createdAt: 2023-10-04 14:20:31.502921+00:00
                    updatedAt: 2023-10-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - client_read
    patch:
      tags:
      - Documents
      summary: Update document in folder
      description: Update document by its ID in the given folder by sending json with
        the changes
      operationId: updateDocument
      parameters:
      - name: partnerSpaceId
        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: 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: CREDIT_CARD_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-04 14:20:31.502921+00:00
                  createdAt: 2023-10-04 14:20:31.502921+00:00
                  updatedAt: 2023-10-04 14:20:31.502921+00:00
                totalElements: 100
                currentPage: 2
                pageSize: 2
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space UUID, Folder or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - client_write
  /v1/spaces/{partnerSpaceId}/clients/{clientId}/documents:
    get:
      tags:
      - Documents
      summary: ⚠️Get list of documents on client's business space
      description: 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.
      operationId: getClientDocuments
      parameters:
      - name: partnerSpaceId
        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
        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
          - PROFORMA_INVOICE
          - INVOICE
          - INVOICE_REMINDER
          - CREDIT_NOTE
          - RECEIPT
          - STATEMENT
          - FILE
          - QUOTE
          - CREDIT_CARD_STATEMENT
          - THIRD_PARTY_STATEMENT
          - SELF_BILLED_INVOICE
          - SELF_BILLED_CREDIT_NOTE
          - OTHER
        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:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        schema:
          type: string
          enum:
          - createdAt
          - createdAt.asc
          - createdAt.desc
        example: createdAt.asc
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllDocumentResult'
              example:
                documents:
                - id: 0ca2797b-6365-4bf2-a490-247075e3cede
                  spaceId: 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-04 14:20:31.502921+00:00
                  createdAt: 2023-10-04 14:20:31.502921+00:00
                  updatedAt: 2023-10-04 14:20:31.502921+00:00
                totalElements: 100
                currentPage: 2
                pageSize: 2
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - client_read
  /v1/spaces/{partnerSpaceId}/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: partnerSpaceId
        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: 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-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
  /v1/spaces/{partnerSpaceId}/clients/{clientId}/documents/{documentId}:jsonpatch:
    patch:
      tags:
      - Documents
      summary: ⚠️Json patch document in folder
      description: Update document by its ID in the given folder by sending JSON patch
      operationId: jsonpatchDocument
      parameters:
      - name: partnerSpaceId
        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: 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-04 14:20:31.502921+00:00
                  createdAt: 2023-10-04 14:20:31.502921+00:00
                  updatedAt: 2023-10-04 14:20:31.502921+00:00
                totalElements: 100
                currentPage: 2
                pageSize: 2
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space UUID, Folder or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      deprecated: true
      security:
      - oauth2:
        - client_write
  /v1/spaces/{partnerSpaceId}/clients/{clientId}/files:
    get:
      tags:
      - Files
      summary: Get all files in a 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/> Get all files in a client space <br/> Scope: client_read'
      operationId: getClientFiles
      parameters:
      - name: filter
        in: query
        schema:
          $ref: '#/components/schemas/FileSingleParams'
      - name: partnerSpaceId
        in: path
        description: The partner space 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: metadata
        in: query
        description: File metadata key value
        schema:
          type: array
          items:
            type: string
        example: metadata=key=value&metadata=key1=value1
      - name: tags
        in: query
        description: Filter by tags
        schema:
          type: array
          items:
            type: string
        example:
        - first_tag
        - second_tag,third_tag
      - name: ql
        in: query
        description: BTX Query Language filter expression.
        schema:
          type: string
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        schema:
          type: string
          enum:
          - createdAt
          - createdAt.asc
          - createdAt.desc
          - updatedAt
          - updatedAt.asc
          - updatedAt.desc
          - filename
          - filename.asc
          - filename.desc
          - creatorType
          - creatorType.asc
          - creatorType.desc
          - status
          - status.asc
          - status.desc
          - fileType
          - fileType.asc
          - fileType.desc
          - metadata.folder
          - metadata.folder.asc
          - metadata.folder.desc
          - metadata.documentCategory
          - metadata.documentCategory.asc
          - metadata.documentCategory.desc
        example: createdAt.asc
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllFilesResult'
              example:
                files:
                - id: 00000003-0000-0000-0000-000000000000
                  filename: legal_xml.xml
                  description: the file for document DOC-1
                  creatorSubject: 00000001-0001-0001-0001-000000000000
                  creatorType: user
                  retentionTime: 2029-01-14 19:58:47+00:00
                  status: PROCESSING
                  fileSize: 1024
                  fileType: xml
                  contentType: application/xml
                  uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=
                  source: com.unifiedpost.btx.connectors:peppol
                  children: []
                  tags:
                  - tag1
                  - tag2
                  metadata:
                    virus: hidden
                  createdAt: 2024-06-11 10:15:00+00:00
                  updatedAt: 2024-06-11 12:45:00+00:00
                totalElements: 1
                currentPage: 0
                pageSize: 20
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_read
    post:
      tags:
      - Files
      summary: Create file in a 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/> Request to create file in a client space <br/> Scope: client_write'
      operationId: createClientFile
      parameters:
      - name: partnerSpaceId
        in: path
        description: The partner space 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: File data to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileRequest'
            example:
              filename: legal_xml.xml
              description: the file for document DOC-1
              creatorSubject: 00000001-0001-0001-0001-000000000000
              creatorType: user
              retentionTime: 2129-01-14 19:58:47+00:00
              fileSize: 1024
              fileType: xml
              contentType: application/xml
              source: com.unifiedpost.btx.connectors:peppol
              tags:
              - tag1
              - tag2
              metadata:
                virus: hidden
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileResult'
              example:
                id: 00000003-0000-0000-0000-000000000000
                filename: legal_xml.xml
                description: the file for document DOC-1
                creatorSubject: 00000001-0001-0001-0001-000000000000
                creatorType: user
                retentionTime: 2129-01-14 19:58:47+00:00
                status: PROCESSING
                fileSize: 1024
                fileType: xml
                contentType: application/xml
                uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=
                source: com.unifiedpost.btx.connectors:peppol
                children: []
                tags:
                - tag1
                - tag2
                metadata:
                  virus: hidden
                createdAt: 2024-06-11 10:15:00+00:00
                updatedAt: 2024-06-11 12:45:00+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
  /v1/spaces/{partnerSpaceId}/clients/{clientId}/files/{fileId}:
    get:
      tags:
      - Files
      summary: Get file in the 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/> Get file in the client space <br/> Scope: client_read'
      operationId: getClientFile
      parameters:
      - name: partnerSpaceId
        in: path
        description: The partner space 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: fileId
        in: path
        description: The file identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileResult'
              example:
                id: 00000003-0000-0000-0000-000000000000
                filename: legal_xml.xml
                description: the file for document DOC-1
                creatorSubject: 00000001-0001-0001-0001-000000000000
                creatorType: user
                retentionTime: 2129-01-14 19:58:47+00:00
                status: PROCESSING
                fileSize: 1024
                fileType: xml
                contentType: application/xml
                uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=
                source: com.unifiedpost.btx.connectors:peppol
                children: []
                tags:
                - tag1
                - tag2
                metadata:
                  virus: hidden
                createdAt: 2024-06-11 10:15:00+00:00
                updatedAt: 2024-06-11 12:45:00+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_read
    patch:
      tags:
      - Files
      summary: Update file in the 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/> Update file in the client space <br/> Scope: client_write'
      operationId: updateClientFile
      parameters:
      - name: partnerSpaceId
        in: path
        description: The partner space 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: fileId
        in: path
        description: The file identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: File data to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFileRequest'
            example:
              filename: legal_xml.xml
              description: the file for document DOC-1
              creatorSubject: 00000001-0001-0001-0001-000000000000
              creatorType: user
              retentionTime: 2129-01-14 19:58:47+00:00
              status: AWAITING_USER_ACTION
              fileSize: 1024
              fileType: xml
              contentType: application/xml
              source: com.unifiedpost.btx.connectors:peppol
              parentFileId: b8536327-4c29-4280-9da2-aa190e8484b7
              tags:
              - tag1
              - tag2
              metadata:
                virus: hidden
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileResult'
              example:
                id: 00000003-0000-0000-0000-000000000000
                filename: legal_xml.xml
                description: the file for document DOC-1
                creatorSubject: 00000001-0001-0001-0001-000000000000
                creatorType: user
                retentionTime: 2129-01-14 19:58:47+00:00
                status: PROCESSING
                fileSize: 1024
                fileType: xml
                contentType: application/xml
                uploadUrl: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=
                source: com.unifiedpost.btx.connectors:peppol
                children: []
                tags:
                - tag1
                - tag2
                metadata:
                  virus: hidden
                createdAt: 2024-06-11 10:15:00+00:00
                updatedAt: 2024-06-11 12:45:00+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
  /v1/spaces/{partnerSpaceId}/clients/{clientId}/files/{fileId}/content:
    get:
      tags:
      - Files
      summary: Get file content
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get file content in the client''s space <br/> Scope: client_read'
      operationId: getClientFileContent
      parameters:
      - name: partnerSpaceId
        in: path
        description: The partner space 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: fileId
        in: path
        description: The file identifier
        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-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_read
  /v1/spaces/{partnerSpaceId}/clients/{clientId}/files/{fileId}/documents:
    get:
      tags:
      - Files
      summary: Get documents linked to file in client's 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 documents linked to file in the client space <br/> Scope: client_read'
      operationId: getDocumentsLinkedToFile
      parameters:
      - name: partnerSpaceId
        in: path
        description: The partner space 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: fileId
        in: path
        description: The file identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListLinkedDocumentsResult'
              example:
                documents:
                - id: d5330d4e-0d3d-4a32-b256-bdf97f9a68cb
                  description: Sample Document
                - id: 40af7dca-5556-4cf2-8aed-20a165e3071f
                  description: Another sample document
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_read
    post:
      tags:
      - Files
      summary: Link documents to file
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Link documents to file in the client space <br/> Scope: client_write'
      operationId: linkDocumentsToFile
      parameters:
      - name: partnerSpaceId
        in: path
        description: The partner space 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: fileId
        in: path
        description: The file identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: List of document IDs to be linked
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentList'
            example:
              documents:
              - 1853a6f9-24f4-4bbc-b743-02453a3949b8
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentList'
              example:
                documents:
                - 1853a6f9-24f4-4bbc-b743-02453a3949b8
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
  /v1/spaces/{partnerSpaceId}/connectors/peppol:acceptDesignationPdp:
    post:
      tags:
      - Clients
      summary: Accept Peppol PDP designation
      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/> Accept designation for Partner Data Provider (PDP) role in Peppol connector
        <br/> Scope: space_client_manage'
      operationId: acceptPeppolPdpDesignation
      parameters:
      - name: partnerSpaceId
        in: path
        description: The partner space's identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Request body with clients and their Peppol identifiers
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AcceptPeppolDesignationRequest'
            example:
              clients:
              - clientId: 550e8400-e29b-41d4-a716-446655440000
                identifiers:
                - 0255:123456789
                - 0208:987654321
              - clientId: 660e8400-e29b-41d4-a716-446655440001
                identifiers:
                - 0255:111111111
        required: true
      responses:
        '204':
          description: No Content. PDP designation accepted successfully
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_client_manage
  /v1/spaces/{partnerSpaceId}/clients:bulkUpdate:
    patch:
      tags:
      - Clients
      summary: Bulk update 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/> Bulk update clients <br/> Scope: client_write, space_client_manage'
      operationId: bulkPatchClients
      parameters:
      - name: partnerSpaceId
        in: path
        description: The partner space's identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/BulkUpdateClientRequest'
        required: true
      responses:
        '200':
          description: All updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkClientResult'
              examples:
                Full response:
                  description: Full response
                  value:
                    type: full
                    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
                          postBox: PO123
                      contacts:
                      - id: 1bee5b5c-3c20-4dbf-91c5-1498ac130abc
                        firstName: First
                        lastName: Last
                        email: clienta@example.com
                        language: en
                      metadata:
                        eInvoicingMandated: true
                        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: ACTIVE
                      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
                Only ids in response:
                  description: Only ids in response
                  value:
                    type: ids
                    clients:
                    - 4a0decd0-6094-4785-9c5e-daf25d7588c1
                    - e3937aee-3feb-4def-8d30-4640848eec98
        '400':
          description: Bad Request. One or more clients failed to be updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 409
                error: ABORTED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Conflict
                detail: Specific detail about what could not be done.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
        - space_client_manage
  /v1/spaces/{partnerSpaceId}/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: partnerSpaceId
        in: path
        description: The partner space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: status
        in: query
        description: 'Filter by multiple statuses, which can be separated by comma,
          or just one value.

          The API interprets this as a logical OR.'
        deprecated: true
        schema:
          type: string
        example: DRAFT,INVITED
      - name: name
        in: query
        description: Filter by name
        deprecated: true
        schema:
          type: string
        example: Client A
      - name: spaceExtensions[].name
        in: query
        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.'
        deprecated: true
        schema:
          type: string
        example: Chorus Pro,BTX Extension
      - name: spaceExtensions[].status
        in: query
        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.'
        deprecated: true
        schema:
          type: string
        example: ACTIVE,INACTIVE,PENDING
      - name: spaceExtensions[].category
        in: query
        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.'
        deprecated: true
        schema:
          type: string
        example: APPLICATION,CONNECTOR,SERVICE
      - name: status[ne]
        in: query
        description: Filter the clients that have status not equal to provided statuses
        deprecated: true
        schema:
          type: string
        example: ACTIVE
      - name: spaceExtensionsQl
        in: query
        description: Query language to support query client spaces base on installed
          extensions
        deprecated: true
        schema:
          type: string
        example: '(spaces_extensions[].name[notIn] = peppol,pdp AND spaces_extensions[].category
          = CONNECTOR) OR

          (spaces_extensions[].name[in] = peppol,pdp AND spaces_extensions[].category
          = CONNECTOR AND spaces_extensions[].status = INACTIVE)

          '
      - name: metadata[ql]
        in: query
        description: Filter the clients where metadata.eInvoicingMandated exists
        deprecated: true
        schema:
          type: string
        example: metadata[ql]=eInvoicingMandated[exists]=true
      - name: metadata
        in: query
        description: Filter by metadata key value
        deprecated: true
        schema:
          type: array
          items:
            type: string
        example: metadata=key=value&metadata=key1=value1
      - name: identifierKeyValue
        in: query
        description: Filter by client identifier key-values
        deprecated: true
        schema:
          type: array
          items:
            type: string
        example: be:en=0400282475
      - name: ql
        in: query
        description: 'BTX Query Language filter expression. Supports filtering by
          myPermissions[in]=(scope1,scope2,...).

          The myPermissions[in] filter is only evaluated when include=myPermissions
          is also present in the request.

          If include=myPermissions is absent, the myPermissions[in] filter is ignored.'
        schema:
          type: string
        example: ?ql=myPermissions[in]=("client_read","client_write")
      - name: include
        in: query
        description: Optional fields to include in the response. Use 'myPermissions'
          to include the list of scopes the requesting subject holds on each client
          resource.
        schema:
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/ClientIncludeField'
        example: myPermissions
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        schema:
          type: string
          enum:
          - 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
                  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-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - 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: partnerSpaceId
        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
              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
                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-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_client_manage
  /v1/spaces/{partnerSpaceId}/clients/{clientId}/{subjectType}:
    get:
      tags:
      - Clients
      summary: Get all users in a 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/> Get list of users in a client space <br/> Scope: space_client_manage,
        client_read'
      operationId: listUsersOnClientSpace
      parameters:
      - name: partnerSpaceId
        in: path
        description: The partner space 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: subjectType
        in: path
        description: The subject type
        required: true
        schema:
          type: string
          enum:
          - users
          - applications
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        schema:
          type: string
          enum:
          - createdAt
          - createdAt.asc
          - createdAt.desc
        example: createdAt.asc
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListPermissionSubjectResult'
              example:
                users:
                - subject: e1db2101-3c49-4267-ba6f-c7e6e53cf833
                  type: USER
                  resourceId: 00000001-0000-0000-0000-000000000000
                  resourceType: SPACE
                  partnerIds:
                  - 00000002-0000-0000-0000-000000000000
                  status: ACTIVE
                  name: John Appleseed
                  createdAt: 2025-01-01 15:51:28.071000+00:00
                  updatedAt: 2025-01-01 15:51:28.071000+00:00
                - subject: 49d2e81f-2e81-4323-8041-bd73e9d217d9
                  type: USER
                  resourceId: 00000001-0000-0000-0000-000000000000
                  resourceType: SPACE
                  status: ACTIVE
                  name: John Application
                  createdAt: 2025-01-01 15:51:28.071000+00:00
                  updatedAt: 2025-01-01 15:51:28.071000+00:00
                totalElements: 2
                currentPage: 0
                pageSize: 20
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_client_manage
        - client_read
    post:
      tags:
      - Clients
      summary: Create partner user in the 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/> Create partner user in the client space <br/> Scope: client_write, space_client_manage'
      operationId: createPartnerUser
      parameters:
      - name: partnerSpaceId
        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: subjectType
        in: path
        description: The subject type
        required: true
        schema:
          type: string
          enum:
          - users
          - applications
      requestBody:
        description: Permission subject data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartnerUserRequest'
            example:
              subject: 8e9ad622-4d80-48c6-b860-036d4ff65b15
              name: John Doe
              status: ACTIVE
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerUserResponse'
              example:
                subject: 8e9ad622-4d80-48c6-b860-036d4ff65b15
                type: USER
                resourceId: 00000001-0000-0000-0000-000000000000
                resourceType: SPACE
                partnerIds:
                - 00000002-0000-0000-0000-000000000000
                status: ACTIVE
                name: John Doe
                createdAt: 2026-01-01 09:11:28.071000+00:00
                updatedAt: 2026-01-01 09:11:28.071000+00:00
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
        - space_client_manage
  /v1/spaces/{partnerSpaceId}/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: partnerSpaceId
        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: include
        in: query
        description: Optional fields to include in the response. Use 'myPermissions'
          to include the list of scopes the requesting subject holds on this client
          resource.
        schema:
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/ClientIncludeField'
        example: myPermissions
      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
                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-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - 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: partnerSpaceId
        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-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - 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: partnerSpaceId
        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
              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
                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-27 12:34:50+00:00
                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-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
        - space_client_manage
  /v1/spaces/{partnerSpaceId}/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: partnerSpaceId
        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-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_client_manage
  /v1/spaces/{partnerSpaceId}/clients/{clientId}/{subjectType}/{subject}:
    delete:
      tags:
      - Clients
      summary: Delete partner user
      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 a partner user in a given partner link of a partner space and
        client <br/> Scope: client_write, space_client_manage'
      operationId: deletePartnerUser
      parameters:
      - name: partnerSpaceId
        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: subjectType
        in: path
        description: subject type of user
        required: true
        schema:
          type: string
          enum:
          - users
          - applications
      - name: subject
        in: path
        description: user subject
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: Partner user deleted successfully
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
        - space_client_manage
  /v1/spaces/{partnerSpaceId}/clients/{clientId}/clientSpace:
    get:
      tags:
      - Clients
      summary: Get client space details
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get the details of a client''s space <br/> Scope: client_read'
      operationId: getClientSpace
      parameters:
      - name: partnerSpaceId
        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
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpaceResult'
              example:
                id: 00000001-0000-0000-0000-000000000000
                name: Invoices space
                type: BUSINESS
                segment: SME
                region: eu
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_read
    patch:
      tags:
      - Clients
      summary: Partially updates the 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/> Partially updates the client space <br/> Scope: client_write'
      operationId: patchClientSpace
      parameters:
      - name: partnerSpaceId
        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
      requestBody:
        description: Client space data to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSpaceRequest'
            example:
              name: New name
              globalIdentifiers:
                fr:siren:suffixes:
                - RETAIL-001
                - TRADE-002
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpaceResult'
              example:
                id: 00000001-0000-0000-0000-000000000000
                name: Invoices space
                type: BUSINESS
                segment: SME
                region: eu
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
  /v1/spaces/{partnerSpaceId}/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: partnerSpaceId
        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-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_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: partnerSpaceId
        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: 00000001-0000-0000-0000-000000000000
              permission: client_read
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_client_manage
        - client_write
  /v1/spaces/{partnerSpaceId}/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: partnerSpaceId
        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:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/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-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_read
  /v1/spaces/{partnerSpaceId}/clients/{clientId}/clientEntity/settings:
    patch:
      tags:
      - Clients
      summary: Partially updates the client entity settings
      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/> Partially updates the client entity settings using JSON patch <br/>
        Scope: client_write'
      operationId: patchClientEntitySettings
      parameters:
      - name: partnerSpaceId
        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
      requestBody:
        description: Client entity settings patch request in JSON patch format
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: add
              path: /billingCurrency
              value: USD
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              examples:
                Client entity settings:
                  description: Client entity settings
                  value:
                    billingCurrency: USD
                    vatChargeableMethod: payment_date
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
  /v1/spaces/{partnerSpaceId}/clients/{clientId}/clientSpace/settings:
    patch:
      tags:
      - Clients
      summary: Partially updates the client space settings
      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/> Partially updates the client space settings using JSON patch <br/> Scope:
        client_write'
      operationId: patchClientSpaceSettings
      parameters:
      - name: partnerSpaceId
        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
      requestBody:
        description: Client space settings patch request in JSON patch format
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: replace
              path: /locale
              value: nl-BE
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonBMap'
              examples:
                Client space settings:
                  description: Client space settings
                  value:
                    locale: nl-BE
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
  /v1/spaces/{partnerSpaceId}/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: partnerSpaceId
        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-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 409
                error: ABORTED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Conflict
                detail: Specific detail about what could not be done.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_client_manage
  /v1/spaces/{partnerSpaceId}/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: partnerSpaceId
        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: 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:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: 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/{partnerSpaceId}/clients/{clientId}/{folder}/directories:
    post:
      tags:
      - Documents
      summary: Create directory
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Create a directory in the given folder and client space <br/> Scope:
        client_write'
      operationId: createDirectory
      parameters:
      - name: partnerSpaceId
        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: folder
        in: path
        description: Folder which the directory belongs to (case insensitive)
        required: true
        schema:
          $ref: '#/components/schemas/FolderLowercase'
      requestBody:
        description: Directory to add
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DirectoryRequest'
            example:
              name: Fruits
              parentDirectoryId: 44d929f7-952d-4283-9010-8a63a16831b3
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectoryResponse'
              example:
                id: a00f8ca7-cd3b-4a2a-93c5-919a8c126ce5
                spaceId: f654868c-a30c-4286-b3be-41c58ef220a4
                name: Fruits
                folder: FILES
                parentDirectory:
                  id: 44d929f7-952d-4283-9010-8a63a16831b3
                  name: Plant
                timestamps:
                  createdAt: 2025-07-21 16:08:33+00:00
                  updatedAt: 2025-07-21 16:09:33+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
  /v2/spaces/{partnerSpaceId}/clients/{clientId}/{folder}/directories/{directoryId}:
    get:
      tags:
      - Documents
      summary: Get directory details
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get details of directory on the client space. <br/> Scope: client_read'
      operationId: getDirectoryDetails
      parameters:
      - name: partnerSpaceId
        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: folder
        in: path
        description: Folder which the directory belongs to (case insensitive)
        required: true
        schema:
          $ref: '#/components/schemas/FolderLowercase'
      - name: directoryId
        in: path
        description: The directory identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: include
        in: query
        description: What extra data to include in the response.
        explode: false
        schema:
          type: array
          items:
            type: string
            enum:
            - timestamps
        example: timestamps
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectoryResponse'
              example:
                id: a00f8ca7-cd3b-4a2a-93c5-919a8c126ce5
                spaceId: f654868c-a30c-4286-b3be-41c58ef220a4
                name: Fruits
                folder: FILES
                parentDirectory:
                  id: 44d929f7-952d-4283-9010-8a63a16831b3
                  name: Plant
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_read
    delete:
      tags:
      - Documents
      summary: Delete directory
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Delete the directory in the given folder and client space <br/> Scope:
        client_write'
      operationId: deleteDirectory
      parameters:
      - name: partnerSpaceId
        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: folder
        in: path
        description: Folder which the directory belongs to (case insensitive)
        required: true
        schema:
          $ref: '#/components/schemas/FolderLowercase'
      - name: directoryId
        in: path
        description: The directory identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
    patch:
      tags:
      - Documents
      summary: Update directory
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Update the directory in the given folder and client space <br/> Scope:
        client_write'
      operationId: updateDirectory
      parameters:
      - name: partnerSpaceId
        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: folder
        in: path
        description: Folder which the directory belongs to (case insensitive)
        required: true
        schema:
          $ref: '#/components/schemas/FolderLowercase'
      - name: directoryId
        in: path
        description: The directory identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Directory to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDirectoryRequest'
            example:
              name: Fruits
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectoryResponse'
              example:
                id: a00f8ca7-cd3b-4a2a-93c5-919a8c126ce5
                spaceId: f654868c-a30c-4286-b3be-41c58ef220a4
                name: Fruits
                folder: FILES
                parentDirectory:
                  id: 44d929f7-952d-4283-9010-8a63a16831b3
                  name: Plant
                timestamps:
                  createdAt: 2025-07-21 16:08:33+00:00
                  updatedAt: 2025-07-21 16:09:33+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
  /v2/spaces/{partnerSpaceId}/clients/{clientId}/{folder}/directories/{directoryId}/content:
    get:
      tags:
      - Documents
      summary: Get directory content (child directories and files)
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get directory content of a folder of a given partnerSpaceId and clientId
        <br/> Scope: client_read'
      operationId: listDirectoryContents
      parameters:
      - name: partnerSpaceId
        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: folder
        in: path
        description: Folder which the directory belongs to (case insensitive)
        required: true
        schema:
          $ref: '#/components/schemas/FolderLowercase'
      - name: directoryId
        in: path
        description: The directory identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: include
        in: query
        description: What extra data to include in the response.
        explode: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/FolderItemInclude'
        example: timestamps,metadata
      - name: name[icont]
        in: query
        description: Term used to search by item name (directories) or description
          (documents)
        schema:
          type: string
        example: Sale invoice
      - name: name
        in: query
        description: Exact name match for item name (directories) or description (documents)
        schema:
          type: string
        example: Sale invoice 2
      - name: type
        in: query
        description: 'Filter by item type: either ''DOCUMENT'' or ''DIRECTORY'''
        schema:
          $ref: '#/components/schemas/FolderItemType'
        example: DOCUMENT
      - name: sortBy
        in: query
        description: 'Sort results by field. Supported values: createdAt, createdAt.asc,
          createdAt.desc, updatedAt, updatedAt.asc, updatedAt.desc, name, name.asc,
          name.desc, type, type.asc, type.desc'
        schema:
          type: string
        example: name.asc
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListFolderItemsResponse'
              example:
                items:
                - id: 19510e39-4936-472d-8b20-2ca14bc4edb8
                  name: Sale invoice 2
                  type: document
                  metadata:
                    documentNumber: SALE02
                  timestamps:
                    createdAt: 2025-07-21 16:08:33+00:00
                    updatedAt: 2025-07-21 16:09:33+00:00
                - id: 059c6942-05e6-4844-bb5a-20e110317ba6
                  name: UP Store
                  type: directory
                  timestamps:
                    createdAt: 2025-07-21 15:25:11+00:00
                    updatedAt: 2025-07-21 15:25:11+00:00
                currentPage: 0
                pageSize: 20
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_read
  /v2/spaces/{partnerSpaceId}/clients/{clientId}/{folder}/content:
    get:
      tags:
      - Documents
      summary: Get root directory contents
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Get the top-level (root) directories and documents <br/> Scope: client_read'
      operationId: listRootDirectoryContents
      parameters:
      - name: partnerSpaceId
        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: folder
        in: path
        description: Folder of the root items (case insensitive)
        required: true
        schema:
          $ref: '#/components/schemas/FolderLowercase'
      - name: include
        in: query
        description: What extra data to include in the response.
        explode: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/FolderItemInclude'
        example: timestamps,metadata
      - name: name[icont]
        in: query
        description: Term used to search by item name (directories) or description
          (documents)
        schema:
          type: string
        example: Sale invoice
      - name: name
        in: query
        description: Exact name match for item name (directories) or description (documents)
        schema:
          type: string
        example: Sale invoice 2
      - name: type
        in: query
        description: 'Filter by item type: either ''DOCUMENT'' or ''DIRECTORY'''
        schema:
          $ref: '#/components/schemas/FolderItemType'
        example: DOCUMENT
      - name: sortBy
        in: query
        description: 'Sort results by field. Supported values: createdAt, createdAt.asc,
          createdAt.desc, updatedAt, updatedAt.asc, updatedAt.desc, name, name.asc,
          name.desc, type, type.asc, type.desc'
        schema:
          type: string
        example: name.asc
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListFolderItemsResponse'
              example:
                items:
                - id: 19510e39-4936-472d-8b20-2ca14bc4edb8
                  name: Sale invoice 2
                  type: document
                  metadata:
                    documentNumber: SALE02
                  timestamps:
                    createdAt: 2025-07-21 16:08:33+00:00
                    updatedAt: 2025-07-21 16:09:33+00:00
                - id: 059c6942-05e6-4844-bb5a-20e110317ba6
                  name: UP Store
                  type: directory
                  timestamps:
                    createdAt: 2025-07-21 15:25:11+00:00
                    updatedAt: 2025-07-21 15:25:11+00:00
                currentPage: 0
                pageSize: 20
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_read
  /v2/spaces/{partnerSpaceId}/clients/{clientId}/{folder}/directories/{directoryId}:move:
    post:
      tags:
      - Documents
      summary: Move directory
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Move a directory in another parent directory that belongs to the same
        folder and same client space <br/> Scope: client_write'
      operationId: moveDirectory
      parameters:
      - name: partnerSpaceId
        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: folder
        in: path
        description: Folder which the directory belongs to (case insensitive)
        required: true
        schema:
          $ref: '#/components/schemas/FolderLowercase'
      - name: directoryId
        in: path
        description: The directory identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Parent directory
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MoveDirectoryRequest'
            example:
              parentDirectoryId: 44d929f7-952d-4283-9010-8a63a16831b3
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectoryResponse'
              example:
                id: a00f8ca7-cd3b-4a2a-93c5-919a8c126ce5
                spaceId: f654868c-a30c-4286-b3be-41c58ef220a4
                name: Fruits
                folder: FILES
                parentDirectory:
                  id: 44d929f7-952d-4283-9010-8a63a16831b3
                  name: Plant
                timestamps:
                  createdAt: 2025-07-21 16:08:33+00:00
                  updatedAt: 2025-07-21 16:09:33+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
  /v2/spaces/{partnerSpaceId}/clients/{clientId}/documents:bulkUpdate:
    patch:
      tags:
      - Documents
      summary: Bulk update client documents v2
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Bulk update client documents v2 <br/> Scope: client_write'
      operationId: bulkPatchDocumentsV2
      parameters:
      - name: partnerSpaceId
        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
      requestBody:
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/BulkPatchDocumentsRequest'
        required: true
      responses:
        '200':
          description: All updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkDocumentsResponse'
              examples:
                Full response:
                  description: Full response
                  value:
                    type: full
                    documents:
                    - id: 51673728-4317-49d4-87b9-6ceb6a5ba115
                      spaceId: c37a2321-fa7c-45d3-a895-2c809d42adeb
                      folder: FILES
                      status:
                        accept: UNACCEPTED
                        document: RECEIVED
                      category: FILE
                      metadata:
                        supplier: Jack Doe
                      retentionTime: 2028-01-13 16:08:33+00:00
                    - id: f4c9a3c5-d20d-4698-bb43-40ba3236bfab
                      spaceId: c37a2321-fa7c-45d3-a895-2c809d42adeb
                      folder: SALES
                      status:
                        delivery: RECEIVED
                        pay: PARTIALLY_PAID
                        document: VALIDATED
                      category: INVOICE
                      metadata:
                        supplier: Jack Doe
                      retentionTime: 2028-01-13 16:08:33+00:00
                Only ids in response:
                  description: Only ids in response
                  value:
                    type: ids
                    documents:
                    - 51673728-4317-49d4-87b9-6ceb6a5ba115
                    - f4c9a3c5-d20d-4698-bb43-40ba3236bfab
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space and/or 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-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 409
                error: ABORTED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Conflict
                detail: Specific detail about what could not be done.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
  /v2/spaces/{partnerSpaceId}/clients/documents:count:
    post:
      tags:
      - Documents
      summary: Count documents in the client spaces
      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/> Count documents in the client spaces <br/> Scope: space_read, client_read'
      operationId: countDocuments
      parameters:
      - name: partnerSpaceId
        in: path
        description: The space unique identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        schema:
          type: string
          enum:
          - count
          - count.asc
          - count.desc
        example: count.desc
      requestBody:
        description: Count documents request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CountClientDocumentsRequest'
            example:
              clients:
              - 1f15ad2a-4782-45b4-aedb-6b35d946666c
              - 706300e4-4144-4cff-baaf-25e03c96078e
              ql: folder[in]=('PURCHASES','SALES') AND category[in]=('INVOICE','RECEIPT')
                AND (status.accounting[in]=('READY_TO_SHARE','SHARED') OR status.accounting[exists]=false)
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CountClientDocumentsResponse'
              example:
                results:
                - clientId: b7065e68-a36a-430b-9ef8-3f09cf540b27
                  clientName: ABC Company
                  documents: 5
                currentPage: 0
                pageSize: 20
                totalElements: 1
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_read
        - client_read
  /v2/spaces/{partnerSpaceId}/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: partnerSpaceId
        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"
        deprecated: true
        schema:
          type: array
          items:
            type: string
        example: ?metadata=other.documentReferences[].numbers[].referencedInvoiceNumber=ABC002
      - name: status
        in: query
        deprecated: true
        schema:
          type: array
          items:
            type: string
      - name: include
        in: query
        description: What extra data to include in the response.
        explode: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/DocumentInclude'
        example: lines,connections
      - name: connections[customer].id[in]
        in: query
        description: List of connection IDs with type customer
        deprecated: true
        explode: false
        schema:
          type: array
          items:
            type: string
            format: uuid
        example: ecc46f54-71f8-4951-944e-a87c3fc57c35,da753d31-2068-4584-b91f-ae012f6b7df3
      - name: connections[supplier].id[in]
        in: query
        description: List of connection IDs with type supplier
        deprecated: true
        explode: false
        schema:
          type: array
          items:
            type: string
            format: uuid
        example: ecc46f54-71f8-4951-944e-a87c3fc57c35,da753d31-2068-4584-b91f-ae012f6b7df3
      - name: balanceOffsets.aggregationStatus[in]
        in: query
        description: Any of the given aggregation statuses of associated balanceOffsets
        deprecated: true
        explode: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/AggregationStatus'
        example: USER_CONFIRMED,AUTO_CONFIRMED
      - name: ql
        in: query
        description: BTX Query Language filter expression.
        schema:
          type: string
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        schema:
          type: string
          enum:
          - category
          - category.asc
          - category.desc
          - createdAt
          - createdAt.asc
          - createdAt.desc
          - updatedAt
          - updatedAt.asc
          - updatedAt.desc
          - grossAmount
          - grossAmount.asc
          - grossAmount.desc
          - payableAmount
          - payableAmount.asc
          - payableAmount.desc
          - netAmount
          - netAmount.asc
          - netAmount.desc
          - vatAmount
          - vatAmount.asc
          - vatAmount.desc
          - documentNumber
          - documentNumber.asc
          - documentNumber.desc
          - issueDate
          - issueDate.asc
          - issueDate.desc
          - dueDate
          - dueDate.asc
          - dueDate.desc
          - status.delivery
          - status.delivery.asc
          - status.delivery.desc
          - status.document
          - status.document.asc
          - status.document.desc
          - status.pay
          - status.pay.asc
          - status.pay.desc
          - connections[customer].displayName
          - connections[customer].displayName.asc
          - connections[customer].displayName.desc
          - connections[supplier].displayName
          - connections[supplier].displayName.asc
          - connections[supplier].displayName.desc
          - description
          - description.asc
          - description.desc
          - purchaseOrderReference
          - purchaseOrderReference.asc
          - purchaseOrderReference.desc
          - openBalance
          - openBalance.asc
          - openBalance.desc
        example: createdAt.asc
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListDocumentsResponseV2'
              example:
                documents:
                - id: 0ca2797b-6365-4bf2-a490-247075e3cede
                  spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                  description: Sample Document
                  source: Sample Source
                  status:
                    pay: FULLY_PAID
                  category: INVOICE
                  metadata:
                    documentNumber: ABC002
                    issueDate: 2024-01-31
                    invoiceType: '380'
                    currencyCode: EUR
                    dueDate: 2024-03-30
                    buyerReference: CUST-001
                    contractReference: CONTRACT001
                    purchaseOrderReference: PO123
                    paymentTerms: Net 60
                    notes:
                    - code: AAA
                      text: Goods item description
                    invoiceReferences:
                    - invoiceReference: ABC002
                      issueDate: 2024-01-14
                      invoiceType: '380'
                    supplier:
                      legalName: Monte Carlo Ltd
                      tradeName: Monte Carlo Ltd
                      address:
                        department: Service achat
                        streetName: RUE DES FLEURS
                        buildingNumber: 22BIS
                        floor: Zone industrielle de la Ballastrierre Ouest
                        postBox: BP 40122
                        townName: LIBOURNE CEDEX
                        postCode: '33506'
                        country: FR
                      globalIdentifiers:
                        fr:siren: '349718288'
                        fr:siret: '34971828812345'
                        fr:vat: FR63349718288
                        global:phoneNumber:
                        - '+3221234567'
                        global:email:
                        - contact@supplier.be
                    customer:
                      legalName: Central Argo Trading
                      tradeName: Central Argo Trading
                      address:
                        streetName: Bloemendalelaan
                        buildingNumber: 62/3
                        buildingName: Building West
                        floor: '4'
                        room: '47'
                        townName: Maldegem
                        postCode: '9990'
                        country: BE
                      globalIdentifiers:
                        be:vat: BE0412887923
                        global:phoneNumber:
                        - '+3237890123'
                        global:email:
                        - contact@customer.be
                    delivery:
                      deliveryDate: 2024-01-31
                    prepaid:
                      paymentDate: 2024-08-15
                      code: '55'
                      text: 'Advance payment for order #12345'
                      paymentReference:
                        value: Prepaid invoice ABC002
                        type: UNSTRUCTURED
                    paymentMeans:
                    - code: '42'
                      text: Payment to bank account, Belgian structured reference
                      paymentReference:
                        value: 001/4037/32870
                        type: STRUCTURED
                        scheme: OGM_VCS
                      paymentAccount:
                        identifier: FR3330002005500000157841Z25
                        scheme: IBAN
                        country: FR
                        currency: EUR
                        bank:
                          identifier: CRLYFRPP
                          scheme: BIC
                      paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-...-166eca6e81a7
                    allowances:
                    - netAmount: '150'
                      baseAmount: '1000'
                      percentage: '15'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Discount
                      reasonCode: '95'
                    charges:
                    - netAmount: '200'
                      baseAmount: '1000'
                      percentage: '20'
                      vatCategory: S
                      vatPercentage: '10'
                      description: Advertising
                      reasonCode: AA
                    documentTotals:
                      netAmount: '1000'
                      vatAmount: '100'
                      grossAmount: '1100'
                      prepaidAmount: '500'
                      roundingDifference: '1100'
                      payableAmount: '600'
                      linesNetAmount: '900'
                      allowancesNetAmount: '100'
                      chargesNetAmount: '200'
                    vatDetails:
                    - vatCategory: S
                      vatPercentage: '10'
                      netAmount: '1000'
                      vatAmount: '100'
                      exemptionReason: Medical supplies are exempt from VAT
                      exemptionReasonCode: VATEX-EU-79-C
                    uploadId: '123456789'
                    vatChargeableMethod: payment_date
                    vatAlreadyDeclared: true
                    processControl:
                      businessProcess: goods
                  tags:
                  - new
                  tasks:
                  - extensionName: com.unifiedpost.btx.data:approve
                    status: approve
                  retentionTime: 2023-10-04 14:20:31.502921+00:00
                  customCategories:
                    purchases:
                    - fuel
                    - restaurant
                totalElements: 100
                currentPage: 2
                pageSize: 2
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      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: partnerSpaceId
        in: path
        description: The partner 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-14 19:58:47+02:00
                  status:
                    accept: ACCEPTED
                  category: INVOICE
                  folder: INBOX
                  connections:
                  - id: 00000001-0000-0000-0000-000000000001
                    relationType: SUPPLIER
                  - id: 00000001-0000-0000-0000-000000000002
                    relationType: CUSTOMER
              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-14 19:58:47+02:00
                  status:
                    accept: ACCEPTED
                  category: INVOICE
                  folder: INBOX
                  connections:
                  - id: 00000001-0000-0000-0000-000000000001
                    relationType: SUPPLIER
                  - id: 00000001-0000-0000-0000-000000000002
                    relationType: CUSTOMER
                  lines:
                  - $schema: https://btx.unifiedpost.com/btx/datastore/document/document_line/v1/document-line-schema.json
                    quantity: '2'
                    unit: H87
                    netAmount: '80.56'
                    currency: USD
                    metadata:
                      externalLineId: A
                      notes:
                      - code: AAA
                        text: Goods item description
                      - code: AAB
                        text: Net 60
                      buyerAccountingReference: CUST-001
                      invoiceReferences:
                      - invoiceReference: ABC002
                        invoiceType: '380'
                        issueDate: 2024-01-14
                        invoiceNumber: ABC002
                      delivery:
                        name: xxxxxx
                        address:
                          department: Service achat
                          streetName: RUE DES FLEURS
                          buildingNumber: 22BIS
                          floor: Zone industrielle de la Ballastrierre Ouest
                          postBox: BP 40122
                          townName: LIBOURNE CEDEX
                          postCode: '33506'
                          country: FR
                        deliveryDate: 2024-01-10
                      startDate: 2024-01-23
                      endDate: 2024-06-23
                      allowances:
                      - netAmount: '20.0'
                        baseAmount: '1000'
                        percentage: '15'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Discount
                        reasonCode: '95'
                      charges:
                      - netAmount: '76.67'
                        baseAmount: '1000'
                        percentage: '20'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Advertising
                        reasonCode: AA
                    pricing:
                      itemNetPrice: '80.56'
                      itemGrossPrice: '96.67'
                      itemPriceQuantity: '40.278192'
                      itemPriceDiscount: '10.0'
                    vatDetails:
                      vatCategory: S
                      vatPercentage: '0.2'
                      vatAmount: '16.11'
                    productIdentifiers:
                      itemId: item1
                      itemCategory: Electronics
                      itemDescription: Noise-cancelling wireless headphones with Bluetooth.
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentV2'
              examples:
                Document:
                  description: Document
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    supplier:
                      id: 00000001-0000-0000-0000-000000000001
                    customer:
                      id: 00000001-0000-0000-0000-000000000002
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      virus: hidden
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    retentionTime: 2023-10-04 14:20:31.502921+00:00
                    createdAt: 2023-10-04 14:20:31.502921+00:00
                    updatedAt: 2023-10-04 14:20:31.502921+00:00
                Document containing lines:
                  description: Document containing lines
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    supplier:
                      id: 00000001-0000-0000-0000-000000000001
                    customer:
                      id: 00000001-0000-0000-0000-000000000002
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      virus: hidden
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    retentionTime: 2023-10-04 14:20:31.502921+00:00
                    lines:
                    - id: 7a1cf570-db5c-4e41-992e-9890532212ae
                      sequence: 1
                      identifier: identifier 1
                      description: Line item 1
                      itemId: item1
                      itemCategory: category
                      productIdentifiers:
                        commodityCode: '123456'
                      quantity: 2
                      unit: PCS
                      startDate: 2024-01-23
                      endDate: 2024-06-23
                      discounts:
                        value: '20.0'
                      charges:
                        value: '76.67'
                      unitPrice: '40.278192'
                      netAmount: '80.56'
                      grossAmount: '96.67'
                      vatAmount: '16.11'
                      currency: USD
                      vatRate: '0.2'
                      vatCode: VAT
                    createdAt: 2023-10-04 14:20:31.502921+00:00
                    updatedAt: 2023-10-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
  /v2/spaces/{partnerSpaceId}/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: partnerSpaceId
        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
            - balanceOffsets
        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-04 14:20:31.502921+00:00
                    createdAt: 2023-10-04 14:20:31.502921+00:00
                    updatedAt: 2023-10-04 14:20:31.502921+00:00
                Document containing lines:
                  description: Document containing lines
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    supplier:
                      id: 00000001-0000-0000-0000-000000000001
                    customer:
                      id: 00000001-0000-0000-0000-000000000002
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      virus: hidden
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    retentionTime: 2023-10-04 14:20:31.502921+00:00
                    lines:
                    - id: 7a1cf570-db5c-4e41-992e-9890532212ae
                      sequence: 1
                      identifier: identifier 1
                      description: Line item 1
                      itemId: item1
                      itemCategory: category
                      productIdentifiers:
                        commodityCode: '123456'
                      quantity: 2
                      unit: PCS
                      startDate: 2024-01-23
                      endDate: 2024-06-23
                      discounts:
                        value: '20.0'
                      charges:
                        value: '76.67'
                      unitPrice: '40.278192'
                      netAmount: '80.56'
                      grossAmount: '96.67'
                      vatAmount: '16.11'
                      currency: USD
                      vatRate: '0.2'
                      vatCode: VAT
                    createdAt: 2023-10-04 14:20:31.502921+00:00
                    updatedAt: 2023-10-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - 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: partnerSpaceId
        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-27 12:34:50+00:00
                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: partnerSpaceId
        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-14 19:58:47+02:00
              status:
                accept: UNACCEPTED
              category: INVOICE
              lines:
              - $schema: https://btx.unifiedpost.com/btx/datastore/document/document_line/v1/document-line-schema.json
                quantity: '2'
                unit: H87
                netAmount: '80.56'
                currency: USD
                metadata:
                  externalLineId: A
                  notes:
                  - code: AAA
                    text: Goods item description
                  - code: AAB
                    text: Net 60
                  buyerAccountingReference: CUST-001
                  invoiceReferences:
                  - invoiceReference: ABC002
                    invoiceType: '380'
                    issueDate: 2024-01-14
                    invoiceNumber: ABC002
                  delivery:
                    name: xxxxxx
                    address:
                      department: Service achat
                      streetName: RUE DES FLEURS
                      buildingNumber: 22BIS
                      floor: Zone industrielle de la Ballastrierre Ouest
                      postBox: BP 40122
                      townName: LIBOURNE CEDEX
                      postCode: '33506'
                      country: FR
                    deliveryDate: 2024-01-10
                  startDate: 2024-01-23
                  endDate: 2024-06-23
                  allowances:
                  - netAmount: '20.0'
                    baseAmount: '1000'
                    percentage: '15'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Discount
                    reasonCode: '95'
                  charges:
                  - netAmount: '76.67'
                    baseAmount: '1000'
                    percentage: '20'
                    vatCategory: S
                    vatPercentage: '10'
                    description: Advertising
                    reasonCode: AA
                pricing:
                  itemNetPrice: '80.56'
                  itemGrossPrice: '96.67'
                  itemPriceQuantity: '40.278192'
                  itemPriceDiscount: '10.0'
                vatDetails:
                  vatCategory: S
                  vatPercentage: '0.2'
                  vatAmount: '16.11'
                productIdentifiers:
                  itemId: item1
                  itemCategory: Electronics
                  itemDescription: Noise-cancelling wireless headphones with Bluetooth.
              connections:
              - id: 00000001-0000-0000-0000-000000000001
                relationType: SUPPLIER
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            example:
            - op: replace
              path: /description
              value: patched description
            - op: remove
              path: /foo
        required: true
      responses:
        '200':
          description: 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-04 14:20:31.502921+00:00
                createdAt: 2023-10-04 14:20:31.502921+00:00
                updatedAt: 2023-10-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space and/or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
  /v2/spaces/{partnerSpaceId}/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: partnerSpaceId
        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-04 14:20:31.502921+00:00
                createdAt: 2023-10-04 14:20:31.502921+00:00
                updatedAt: 2023-10-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Space and/or Document UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
  /v2/spaces/{partnerSpaceId}/clients/{clientId}/documents/{documentId}:move:
    post:
      tags:
      - Documents
      summary: Move document to a directory
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Move document on the given client space to a directory <br/> Scope:
        client_write'
      operationId: moveDocumentToDirectory
      parameters:
      - name: partnerSpaceId
        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: Move document request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MoveDocumentToDirectoryRequest'
            examples:
              Move to root directory:
                description: Move to root directory
                value:
                  parentDirectoryId: null
              Move to directory:
                description: Move to directory
                value:
                  parentDirectoryId: 44d929f7-952d-4283-9010-8a63a16831b3
        required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentV2'
              examples:
                Document:
                  description: Document
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: PURCHASES
                    status:
                      pay: FULLY_PAID
                    category: INVOICE
                    metadata:
                      $schema: https://btx.unifiedpost.com/btx/datastore/document/document_metadata/v1/document-metadata-schema.json
                      documentNumber: ABC002
                      issueDate: 2024-01-31
                      invoiceType: '380'
                      currencyCode: EUR
                      dueDate: 2024-03-30
                      buyerReference: CUST-001
                      contractReference: CONTRACT001
                      purchaseOrderReference: PO123
                      paymentTerms: Net 60
                      notes:
                      - code: AAA
                        text: Goods item description
                      invoiceReferences:
                      - invoiceReference: ABC002
                        issueDate: 2024-01-14
                        invoiceType: '380'
                      supplier:
                        legalName: Monte Carlo Ltd
                        tradingName: Monte Carlo Ltd
                        address:
                          streetName: Rue des Fleurs
                          buildingNumber: 22BIS
                          floor: Zone industrielle de la Ballastrierre Ouest
                          postBox: BP 40122
                          department: Service achat
                          city: LIBOURNE CEDEX
                          postalCode: '33506'
                          countryCode: FR
                        globalIdentifiers:
                          fr:siren: '349718288'
                          fr:siret: '34971828812345'
                          fr:vat: FR63349718288
                          global:email:
                          - montecarloltd@example.com
                          global:phoneNumber:
                          - '+1234567890'
                      customer:
                        legalName: Unifiedpost Group
                        tradingName: ?????????
                        address:
                          streetName: Bloemendalelaan
                          buildingNumber: 62/3
                          buildingName: Building West
                          floor: '4'
                          room: '47'
                          city: Maldegem
                          postalCode: '9990'
                          countryCode: BE
                        globalIdentifiers:
                          be:vat: BE0412887923
                          global:email:
                          - john@example.com
                          global:phoneNumber:
                          - '+1234567890'
                      delivery:
                        deliveryDate: 2024-01-31
                      prepaid:
                        paymentDate: 2024-08-15
                        code: '55'
                        text: 'Advance payment for order #12345'
                        paymentReference:
                          value: Prepaid invoice ABC002
                          type: UNSTRUCTURED
                      paymentMeans:
                      - code: '42'
                        text: PPayment to bank account, Belgian structured reference
                        paymentReference:
                          value: 001/4037/32870
                          type: STRUCTURED
                          scheme: OGM_VCS
                        paymentAccount:
                          identifier: FR3330002005500000157841Z25
                          scheme: IBAN
                          country: FR
                          currency: EUR
                          bank:
                            identifier: CRLYFRPP
                            scheme: BIC
                        paymentLink: https://tx.pay-nxt.com/payment-items/807594ae-...-166eca6e81a7
                        paymentMandate:
                          identifier: MANDATE-2026-00045
                          payerFinancialAccount:
                            identifier: FR7630006000011234567890189
                      allowances:
                      - netAmount: '150'
                        baseAmount: '1000'
                        percentage: '15'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Discount
                        reasonCode: '95'
                      charges:
                      - netAmount: '200'
                        baseAmount: '1000'
                        percentage: '20'
                        vatCategory: S
                        vatPercentage: '10'
                        description: Advertising
                        reasonCode: AA
                      documentTotals:
                        netAmount: '1000'
                        vatAmount: '100'
                        grossAmount: '1100'
                        prepaidAmount: '500'
                        roundingDifference: '1100'
                        payableAmount: '600'
                        linesNetAmount: '900'
                        allowancesNetAmount: '100'
                        chargesNetAmount: '200'
                      vatDetails:
                      - vatCategory: S
                        vatPercentage: '10'
                        netAmount: '1000'
                        vatAmount: '100'
                        exemptionReason: Medical supplies are exempt from VAT
                        exemptionReasonCode: VATEX-EU-79-C
                      uploadId: '123456789'
                      vatChargeableMethod: payment_date
                      vatAlreadyDeclared: true
                      processControl:
                        businessProcess: goods
                      profileId: urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
                    tags:
                    - new
                    tasks:
                    - extensionName: com.unifiedpost.btx.data:approve
                      status: approve
                    connections:
                    - id: 00000001-0000-0000-0000-000000000001
                      relationType: SUPPLIER
                    - id: 00000001-0000-0000-0000-000000000002
                      relationType: CUSTOMER
                      displayName: ABC Company
                    retentionTime: 2023-10-04 14:20:31.502921+00:00
                    rawLines:
                      '5':
                        unit:
                          confidence: 0.99
                          value: stuks
                          coordinates: {}
                    rawData:
                      invoiceDate:
                        confidence: 0.99
                        value: 2024-01-01
                        coordinates: {}
                      vatDetails:
                      - vatCode:
                          confidence: 0.99
                          value: ABC
                          coordinates: {}
                    processingData:
                      spaceExtensions:
                        com.unifiedpost.btx.connectors:
                          peppol:
                            sbdhInstanceIdentifiers:
                            - 12345_118e3040-51d2-11e3-8f96-0800200c9a66
                    validationData:
                      spaceExtensions:
                        com.unifiedpost.btx.connectors.validator:
                          dataExtraction:
                            status: COMPLETED
                            validationId: 00000001-0000-0000-0000-000000000000
                            results:
                              ocr.confidence:
                                level: ERROR
                                locations:
                                - type: field
                                  path: dueDate
                                  parameters:
                                    confidence: 0.75
                    customCategories:
                      purchases:
                      - fuel
                      - restaurant
                    timestamps:
                      createdAt: 2025-07-04 14:20:31.502921+00:00
                      updatedAt: 2025-07-04 14:20:31.502921+00:00
                Document with parent directory:
                  description: Document with parent directory
                  value:
                    id: 0ca2797b-6365-4bf2-a490-247075e3cede
                    spaceId: 56079d21-a756-49fb-9286-9859c354aa69
                    description: Sample Document
                    source: Sample Source
                    folder: FILES
                    category: FILE
                    metadata:
                      $schema: https://btx.unifiedpost.com/btx/datastore/document/document_metadata/v1/document-metadata-schema.json
                      documentNumber: ABC002
                    tags:
                    - new
                    retentionTime: 2023-10-04 14:20:31.502921+00:00
                    parentDirectory:
                      id: 44d929f7-952d-4283-9010-8a63a16831b3
                      name: Plant
                    timestamps:
                      createdAt: 2025-07-04 14:20:31.502921+00:00
                      updatedAt: 2025-07-04 14:20:31.502921+00:00
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
  /v2/spaces/{partnerSpaceId}/clients:
    get:
      tags:
      - Clients
      summary: Get list of clients V2
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Retrieve list of clients <br/> Scope: client_read, space_client_manage'
      operationId: getClientsV2
      parameters:
      - name: partnerSpaceId
        in: path
        description: The partner space identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: status
        in: query
        description: 'Filter by multiple statuses, which can be separated by comma,
          or just one value.

          The API interprets this as a logical OR.'
        deprecated: true
        schema:
          type: string
        example: DRAFT,INVITED
      - name: name
        in: query
        description: Filter by name
        deprecated: true
        schema:
          type: string
        example: Client A
      - name: spaceExtensions[].name
        in: query
        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.'
        deprecated: true
        schema:
          type: string
        example: Chorus Pro,BTX Extension
      - name: spaceExtensions[].status
        in: query
        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.'
        deprecated: true
        schema:
          type: string
        example: ACTIVE,INACTIVE,PENDING
      - name: spaceExtensions[].category
        in: query
        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.'
        deprecated: true
        schema:
          type: string
        example: APPLICATION,CONNECTOR,SERVICE
      - name: status[ne]
        in: query
        description: Filter the clients that have status not equal to provided statuses
        deprecated: true
        schema:
          type: string
        example: ACTIVE
      - name: spaceExtensionsQl
        in: query
        description: Query language to support query client spaces base on installed
          extensions
        deprecated: true
        schema:
          type: string
        example: '(spaces_extensions[].name[notIn] = peppol,pdp AND spaces_extensions[].category
          = CONNECTOR) OR

          (spaces_extensions[].name[in] = peppol,pdp AND spaces_extensions[].category
          = CONNECTOR AND spaces_extensions[].status = INACTIVE)

          '
      - name: metadata[ql]
        in: query
        description: Filter the clients where metadata.eInvoicingMandated exists
        deprecated: true
        schema:
          type: string
        example: metadata[ql]=eInvoicingMandated[exists]=true
      - name: metadata
        in: query
        description: Filter by metadata key value
        deprecated: true
        schema:
          type: array
          items:
            type: string
        example: metadata=key=value&metadata=key1=value1
      - name: identifierKeyValue
        in: query
        description: Filter by client identifier key-values
        deprecated: true
        schema:
          type: array
          items:
            type: string
        example: be:en=0400282475
      - name: ql
        in: query
        description: 'BTX Query Language filter expression. Supports filtering by
          myPermissions[in]=(scope1,scope2,...).

          The myPermissions[in] filter is only evaluated when include=myPermissions
          is also present in the request.

          If include=myPermissions is absent, the myPermissions[in] filter is ignored.'
        schema:
          type: string
        example: ?ql=myPermissions[in]=("client_read","client_write")
      - name: include
        in: query
        description: Optional fields to include in the response. Use 'myPermissions'
          to include the list of scopes the requesting subject holds on each client
          resource.
        schema:
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/ClientIncludeField'
        example: myPermissions
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          maximum: 10737418
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 200, default 20'
        schema:
          maximum: 200
          minimum: 1
          type: integer
          format: int32
          default: 20
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: onlyCount
        in: query
        description: Return ONLY the totalElements number of entries in the response.
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sorting criteria
        schema:
          type: string
          enum:
          - name
          - name.asc
          - name.desc
          - status
          - status.asc
          - status.desc
        example: name.asc
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListClientsResponseV2'
              example:
                clients:
                - id: 69f296a5-fb7e-47d8-a1de-bd528f0038b0
                  name: Client A
                  identifiers:
                    internalId: xxxx
                    externalId: yyyy
                    cbeNumber: zzzz
                    vat: '1234567890'
                  addresses:
                    main:
                      addressType: BIZZ
                      streetName: Nitzsche Lodge
                      buildingNumber: '80728'
                      postCode: '3110'
                      townName: Fernandahaven
                      country: BE
                  contacts:
                  - id: 1bee5b5c-3c20-4dbf-91c5-1498ac130abc
                    firstName: First
                    lastName: Last
                    email: clienta@example.com
                    language: en
                  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-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_read
        - space_client_manage
    post:
      tags:
      - Clients
      summary: Create new client 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/> Request to create a client <br/> Scope: space_client_manage'
      operationId: createClientV2
      parameters:
      - name: partnerSpaceId
        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/ClientRequestV2'
            example:
              name: Client A
              identifiers:
                internalId: xxxx
                externalId: yyyy
                cbeNumber: zzzz
                vat: '1234567890'
              addresses:
                main:
                  addressType: BIZZ
                  streetName: Nitzsche Lodge
                  buildingNumber: '80728'
                  postCode: '3100'
                  townName: Fernandahaven
                  country: BE
                  postBox: PO123
              contacts:
              - firstName: First
                lastName: Last
                email: clienta@example.com
                language: en
              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/ClientResultV2'
              example:
                id: 69f296a5-fb7e-47d8-a1de-bd528f0038b0
                name: Client A
                identifiers:
                  internalId: xxxx
                  externalId: yyyy
                  cbeNumber: zzzz
                  vat: '1234567890'
                addresses:
                  main:
                    addressType: BIZZ
                    streetName: Nitzsche Lodge
                    buildingNumber: '80728'
                    postCode: '3110'
                    townName: Fernandahaven
                    country: BE
                    postBox: PO123
                contacts:
                - id: 1bee5b5c-3c20-4dbf-91c5-1498ac130abc
                  firstName: First
                  lastName: Last
                  email: clienta@example.com
                  language: en
                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-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - space_client_manage
  /v2/spaces/{partnerSpaceId}/clients/{clientId}:
    get:
      tags:
      - Clients
      summary: Get client data V2
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Retrieve data of a specific client <br/> Scope: client_read, space_client_manage'
      operationId: getClientV2
      parameters:
      - name: partnerSpaceId
        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: include
        in: query
        description: Optional fields to include in the response. Use 'myPermissions'
          to include the list of scopes the requesting subject holds on this client
          resource.
        schema:
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/ClientIncludeField'
        example: myPermissions
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientResultV2'
              example:
                id: 69f296a5-fb7e-47d8-a1de-bd528f0038b0
                name: Client A
                identifiers:
                  internalId: xxxx
                  externalId: yyyy
                  cbeNumber: zzzz
                  vat: '1234567890'
                addresses:
                  main:
                    addressType: BIZZ
                    streetName: Nitzsche Lodge
                    buildingNumber: '80728'
                    postCode: '3110'
                    townName: Fernandahaven
                    country: BE
                    postBox: PO123
                contacts:
                - id: 1bee5b5c-3c20-4dbf-91c5-1498ac130abc
                  firstName: First
                  lastName: Last
                  email: clienta@example.com
                  language: en
                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-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_read
        - space_client_manage
    patch:
      tags:
      - Clients
      summary: Update client 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 client <br/> Scope: client_write, space_client_manage'
      operationId: updateClientV2
      parameters:
      - name: partnerSpaceId
        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/ClientPatchRequestV2'
            example:
              name: Client A
              identifiers:
                externalId: yyyy
                cbeNumber: zzzz
                vat: '1234567890'
              addresses:
                main:
                  addressType: BIZZ
                  streetName: Nitzsche Lodge
                  buildingNumber: '80728'
                  postCode: '3110'
                  townName: Fernandahaven
                  country: BE
                  postBox: PO123
              contacts:
              - firstName: First
                lastName: Last
                email: clienta@example.com
                language: en
              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/ClientResultV2'
              example:
                id: 69f296a5-fb7e-47d8-a1de-bd528f0038b0
                name: Client A
                identifiers:
                  internalId: xxxx
                  externalId: yyyy
                  cbeNumber: zzzz
                  vat: '1234567890'
                addresses:
                  main:
                    addressType: BIZZ
                    streetName: Nitzsche Lodge
                    buildingNumber: '80728'
                    postCode: '3110'
                    townName: Fernandahaven
                    country: BE
                    postBox: PO123
                contacts:
                - id: 1bee5b5c-3c20-4dbf-91c5-1498ac130abc
                  firstName: First
                  lastName: Last
                  email: clienta@example.com
                  language: en
                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-27 12:34:50+00:00
                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-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_write
        - space_client_manage
  /v2/spaces/{partnerSpaceId}/clients/{clientId}/clientSpace:
    get:
      tags:
      - Clients
      summary: Get client BUSINESS space details
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Retrieve the full BUSINESS space details of a partner''s client <br/>
        Scope: client_read'
      operationId: getClientSpaceV2
      parameters:
      - name: partnerSpaceId
        in: path
        description: The identifier of the partner space
        required: true
        schema:
          type: string
          format: uuid
      - name: clientId
        in: path
        description: The identifier of the partner-client relationship
        required: true
        schema:
          type: string
          format: uuid
      - name: include
        in: query
        description: 'Optional includes. Supported value: timestamps'
        schema:
          type: array
          items:
            type: string
        example: timestamps
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpaceV2'
        '400':
          description: Bad Request - Client is invalid for this operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found - Partner space does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50+00:00
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
        default:
          description: Other error messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      security:
      - oauth2:
        - client_read
  /v1/spaces/{spaceId}/clients:importFromTemplate:
    post:
      tags:
      - Client
      summary: Import list clients from excel file
      description: '<div class=''my-preview''><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Api to import client in bulk <br/> Scope: []'
      operationId: importBulkClient
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClientBulkImportRequest'
        required: true
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientBulkAsyncCreationResponse'
        '400':
          description: Bad request
        '500':
          description: Internal server error
  /v1/clients/importTemplate:create:
    post:
      tags:
      - Client
      summary: Get excel template file for import clients in bulk
      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/> Api generate template file for import clients in bulk <br/> Scope: []'
      operationId: getBulkImportTemplate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClientBulkImportTemplateRequest'
        required: true
      responses:
        '200':
          description: response
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '400':
          description: Bad request
        '500':
          description: Internal server error
  /api/v1/spaces/{spaceId}/clients:bulkInvite:
    post:
      tags:
      - Client
      summary: Bulk invite 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/> Schedules background processing to invite a list clients belongs to
        specific space. Returns immediately with HTTP 202. <br/> Scope: []'
      operationId: bulkInvite
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClientBulkInviteRequest'
        required: true
      responses:
        '202':
          description: Accepted – task has been scheduled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientBulkInviteResponse'
        '400':
          description: Bad request
        '500':
          description: Internal server error
  /api/v1/spaces/{spaceId}/clients:batchAssignExtension:
    post:
      tags:
      - Client
      summary: Batch assign extensions to multiple 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/> Schedules background processing to assign each specified extension to
        each specified client. Returns immediately with HTTP 202. <br/> Scope: []'
      operationId: batchAssignExtension
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchAssignExtensionRequest'
        required: true
      responses:
        '202':
          description: Accepted – task has been scheduled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchAssignExtensionResponse'
        '400':
          description: Bad request
        '500':
          description: Internal server error
  /api/v1/spaces/{spaceId}/clients:batchAddTeamMember:
    post:
      tags:
      - Client
      summary: Batch add a team member to multiple 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/> Schedules background processing to add a team member to each specified
        client. Returns immediately with HTTP 202. <br/> Scope: []'
      operationId: batchAddTeamMember
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchAddTeamMemberRequest'
        required: true
      responses:
        '202':
          description: Accepted – task has been scheduled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchAddTeamMemberResponse'
        '400':
          description: Bad request
        '500':
          description: Internal server error
  /api/v1/spaces/{spaceId}/clients/settings:markTemplateAsDefault:
    post:
      tags:
      - Extension
      summary: Mark a template as default
      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/> Api to set template for default usage <br/> Scope: []'
      operationId: markTemplateSettingAsDefault
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarkSpaceExtensionTemplateSettingAsDefaultRequest'
        required: true
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarkSpaceExtensionTemplateSettingAsDefaultRequest'
        '400':
          description: Bad request
        '500':
          description: Internal server error
  /api/v1/spaces/{spaceId}/clients/settings:addTemplate:
    post:
      tags:
      - Extension
      summary: Add extension template settings
      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/> Api to add extension template settings <br/> Scope: []'
      operationId: addSpaceExtensionTemplateSettings
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddSpaceExtensionSettingRequest'
        required: true
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddSpaceExtensionSettingRequest'
        '400':
          description: Bad request
        '500':
          description: Internal server error
  /api/v1/spaces/{spaceId}/clientPeppolExtension:backgroundActivate:
    post:
      tags:
      - Client
      summary: Perform activate extension for clients
      description: 'Activate eInvoicing(Peppol) for clients <br/> Scope: []'
      operationId: bulkActivateClientsExtension
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkActivateClientExtensionRequest'
        required: true
      responses:
        '200':
          description: Request call successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkActivateClientExtensionResponse'
        '400':
          description: Bad request
        '500':
          description: Internal server error
  /api/v1/spaces/peppol:retryActivation:
    post:
      tags:
      - Extension
      summary: Retry to activate Peppol extensions for clients in multiple partner
        spaces
      description: 'For each provided partnerSpaceId, schedules background job to
        fetch all clients in that space, filtering ACTIVE client with TRUE mandate,
        and retry to activate peppol for them <br/> Scope: []'
      operationId: retryPeppolActivation
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RetryPendingExtensionsRequest'
        required: true
      responses:
        '202':
          description: Accepted - background job is scheduled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetryPendingExtensionsResponse'
        '400':
          description: Bad request
        '500':
          description: Internal server error
  /api/v1/spaces/clients:retryPendingExtensions:
    post:
      tags:
      - Extension
      summary: Retry pending/inactive extensions for multiple partner spaces
      description: 'For each provided partnerSpaceId, schedules a background task
        that fetches all clients in the space, identifies those with PENDING or INACTIVE
        extensions, and retries extension activation. Returns immediately with HTTP
        202. <br/> Scope: []'
      operationId: retryPendingExtensions
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RetryPendingExtensionsRequest'
        required: true
      responses:
        '202':
          description: Accepted – tasks have been scheduled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetryPendingExtensionsResponse'
        '400':
          description: Bad request
        '500':
          description: Internal server error
  /api/v1/spaces/clients:retryEvaluateMetadata:
    post:
      tags:
      - Metadata
      summary: Retry evaluate metadata for client
      description: 'Re-evaluate clients and correct inactive client''s data. <br/>
        Scope: []'
      operationId: retryEvaluateMetadata
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RetryEvaluateMetadataRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetryEvaluateMetadataResponse'
        '400':
          description: Bad request
        '500':
          description: Internal server error
  /v1/spaces/{spaceId}/clients/settings/billingDefaults:
    patch:
      tags:
      - Extension
      summary: Update extension setting
      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/> Api update extension setting <br/> Scope: []'
      operationId: updateExtensionSetting
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DefaultBillingRequest'
        required: true
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultBillingRequest'
        '400':
          description: Bad request
        '500':
          description: Internal server error
  /api/v1/spaces/{spaceId}/clients/settings/template/{templateName}:
    delete:
      tags:
      - Extension
      summary: Delete specific template settings
      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/> Api to delete specific template settings <br/> Scope: []'
      operationId: deleteSpaceExtensionTemplateSettings
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
      - name: templateName
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: response
        '400':
          description: Bad request
        '500':
          description: Internal server error
    patch:
      tags:
      - Extension
      summary: Update specific template settings
      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/> Api to update specific template settings <br/> Scope: []'
      operationId: updateSpaceExtensionTemplateSettings
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
      - name: templateName
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSpaceExtensionTemplateSettingRequest'
        required: true
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateSpaceExtensionTemplateSettingRequest'
        '400':
          description: Bad request
        '500':
          description: Internal server error
  /v1/spaces/{spaceId}/clients:delete:
    delete:
      tags:
      - Client
      summary: Perform bulk delete 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/> Api to perform bulk delete clients <br/> Scope: []'
      operationId: deleteBulkClients
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClientBulkDeleteRequest'
        required: true
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientBulkAsyncDeleteResponse'
        '400':
          description: Bad request
        '500':
          description: Internal server error
  /partner/v1/spaces/{spaceId}/clients/{clientId}:invite:
    post:
      description: ' Invite a client to onboard their own company onto the platform.
        <br/> Scope: space_read'
      operationId: inviteClientOnboarding
      parameters:
      - in: path
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: clientId
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClientSpaceInvitationRequest'
        required: true
      responses:
        '202':
          description: Invitation was initiated successfully
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: The partner could not be found or the user has no write access
            on the space
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
          description: Client has already done onboarding a business space through
            the invitation link
      security:
      - oauth2:
        - space_read
      summary: Invite client
      tags:
      - Space Clients
components:
  schemas:
    JsonBMap:
      type: object
      additionalProperties: 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
    ExtensionClientResponse:
      type: object
      properties:
        clientId:
          type: string
          description: The client's ID
          format: uuid
          example: 00000001-0001-0000-0000-000000000000
        appCallbacks:
          $ref: '#/components/schemas/JsonBMap'
        status:
          $ref: '#/components/schemas/ExtensionStatus'
        settings:
          $ref: '#/components/schemas/JsonBMap'
    ExtensionStatus:
      type: string
      description: Extension's functional statuses
      example: INACTIVE
      enum:
      - ACTIVE
      - INACTIVE
      - PENDING
      - ERROR
    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
    ExtensionClientRequest:
      type: object
      properties:
        clientId:
          type: string
          description: The client's ID
          format: uuid
          example: 00000001-0001-0000-0000-000000000000
        clientSpaceUrl:
          type: string
          description: URL to the client's space in entity store
    AllExtensionClientResult:
      type: object
      properties:
        clients:
          type: array
          description: List of space’s extension clients
          items:
            $ref: '#/components/schemas/ExtensionClientResult'
        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
    ExtensionClientResult:
      type: object
      properties:
        id:
          type: string
          description: The extension client ID.
          format: uuid
          example: 00000001-0001-0000-0000-000000000000
        appCallbacks:
          $ref: '#/components/schemas/JsonBMap'
        settings:
          $ref: '#/components/schemas/JsonBMap'
        status:
          $ref: '#/components/schemas/ExtensionStatus'
    JsonPatch:
      type: object
    ExtensionStatusDto:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/ExtensionStatus'
    TaxRegistrationResult:
      type: object
      properties:
        id:
          type: string
          description: Tax Registration ID
        taxId:
          type: string
          description: Tax ID
        country:
          type: string
          description: Country
        type:
          type: string
          description: Tax type
        voluntaryTax:
          type: boolean
          description: Is voluntary tax?
        oss:
          type: boolean
          description: OSS?
        startDate:
          type: string
          description: Start Date
          format: date
        endDate:
          type: string
          description: End Date
          format: date
        vatGroup:
          $ref: '#/components/schemas/VatGroup'
        spaces:
          type: array
          description: List of associated spaces
          items:
            $ref: '#/components/schemas/TaxRegistrationSpaceDetails'
    TaxRegistrationSpaceDetails:
      type: object
      properties:
        id:
          type: string
          description: Space ID
          format: uuid
        name:
          type: string
          description: Space name
      description: List of associated spaces
    VatGroup:
      type: object
      properties:
        name:
          type: string
        startDate:
          type: string
          format: date
        endDate:
          type: string
          format: date
      description: VAT group
    SpacesList:
      type: object
      properties:
        spaces:
          type: array
          description: List of spaces ids
          items:
            type: string
            description: List of spaces ids
    JsonBMapNullable:
      type: object
      additionalProperties: true
      nullable: true
    DocumentRepresentationResult:
      required:
      - main
      type: object
      properties:
        id:
          type: string
          description: id of document representation
          format: uuid
        documentId:
          type: string
          description: id of document
          format: uuid
        retentionTime:
          type: string
          description: retention time of content
          format: date-time
        type:
          type: string
          description: type of the document representation
          example: legal_xml
        filename:
          type: string
          description: filename of the document representation
          example: legal_xml.xml
        contentType:
          type: string
          description: content_type of the document representation
          example: application/xml
        size:
          type: number
          description: size of the document representation content
          example: 20
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        status:
          $ref: '#/components/schemas/RepresentationStatus'
        main:
          type: boolean
          description: whether this is the main representation of a document
        uploadUrl:
          type: string
          description: short lived url where upload can be performed to
          example: http://path/to/file.xml
        md5Hash:
          type: string
          description: md5 hashing
          example: 938c2cc0dcc05f2b68c4287040cfcf71
        createdAt:
          type: string
          description: creation datetime
          format: date-time
        updatedAt:
          type: string
          description: updated datetime
          format: date-time
        original:
          type: boolean
          description: 'True: The representation was originally uploaded by the client
            or received from a connector;False: The representation was generated based
            on the JSON representation of the document'
    RepresentationStatus:
      type: string
      description: status of representation
      example: AWAITING_UPLOAD
      enum:
      - AWAITING_UPLOAD
      - VIRUS_SCANNING
      - VIRUS_SCANNED
      - VIRUS_ERROR
      - PROCESSING
      - AWAITING_USER_ACTION
      - PROCESSED
      - REJECTED
      - ERROR
    DocumentRepresentationRequest:
      required:
      - contentType
      - filename
      - type
      type: object
      properties:
        fileSize:
          type: integer
          description: size of file in bytes
          format: int32
        retentionTime:
          type: string
          description: retention time of content
          format: date-time
        type:
          type: string
          description: type of the document representation
          example: legal_xml
        filename:
          type: string
          description: filename of the document representation
          example: legal_xml.xml
        contentType:
          type: string
          description: content_type of the document representation
          example: application/xml
        main:
          type: boolean
          description: whether this is the main representation of a document
        md5Hash:
          type: string
          description: md5 hash of a document
        original:
          type: boolean
          description: 'True: The representation was originally uploaded by the client
            or received from a connector;False: The representation was generated based
            on the JSON representation of the document'
        metadata:
          $ref: '#/components/schemas/JsonBMap'
    AllDocumentRepresentationResult:
      type: object
      properties:
        document_representations:
          type: array
          description: List of document_representations
          items:
            $ref: '#/components/schemas/DocumentRepresentationResult'
        totalElements:
          type: integer
          description: Total number of items in the database that correspond to this
            search criteria
          format: int64
        currentPage:
          type: integer
          description: Current page
          format: int32
        pageSize:
          type: integer
          description: Response page size
          format: int32
    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
        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:
      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
        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
        characterEncoding:
          type: string
        contentLengthLong:
          type: integer
          format: int64
          writeOnly: true
        bufferSize:
          type: integer
          format: int32
        committed:
          type: boolean
        writer:
          type: object
        contentType:
          type: string
        outputStream:
          $ref: '#/components/schemas/ServletOutputStream'
        contentLength:
          type: integer
          format: int32
          writeOnly: true
    ServletOutputStream:
      type: object
      properties:
        writeListener:
          $ref: '#/components/schemas/WriteListener'
        ready:
          type: boolean
    WriteListener:
      type: object
    GetOrCreateRepresentationRequest:
      type: object
      properties:
        documentType:
          type: string
    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
          - PROFORMA_INVOICE
          - INVOICE
          - INVOICE_REMINDER
          - CREDIT_NOTE
          - RECEIPT
          - STATEMENT
          - FILE
          - QUOTE
          - CREDIT_CARD_STATEMENT
          - THIRD_PARTY_STATEMENT
          - SELF_BILLED_INVOICE
          - SELF_BILLED_CREDIT_NOTE
          - OTHER
    FileResult:
      type: object
      properties:
        id:
          type: string
          description: file identifier
          example: 00000003-0000-0000-0000-000000000000
        filename:
          type: string
          description: file name
          example: legal_xml.xml
        description:
          type: string
          description: description
          example: The file for document DOC-1
        creatorSubject:
          type: string
          description: creator subject
          example: 00000001-0001-0001-0001-000000000000
        creatorType:
          type: string
          description: creator type
          example: user
        retentionTime:
          type: string
          description: retention time
          format: date-time
          example: 2129-01-14 19:58:47+00:00
        status:
          $ref: '#/components/schemas/FileStatus'
        fileSize:
          type: integer
          description: file size
          format: int32
          example: 1024
        fileType:
          type: string
          description: file type
          example: xml
        contentType:
          type: string
          description: content type
          example: application/xml
        uploadUrl:
          type: string
          description: upload URL
          example: https://storage.googleapis.com/this-bucket/this-object?X-Goog-Algorithm=
        source:
          type: string
          description: source
          example: com.unifiedpost.btx.connectors:peppol
        parentFileId:
          type: string
          description: parent file id
          format: uuid
          example: b8536327-4c29-4280-9da2-aa190e8484b7
        children:
          type: array
          description: List of child files
          items:
            $ref: '#/components/schemas/FileResult'
        tags:
          type: array
          description: tags
          example:
          - tag1
          - tag2
          items:
            type: string
            description: tags
            example: '["tag1","tag2"]'
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        createdAt:
          type: string
          description: creation datetime
          format: date-time
        updatedAt:
          type: string
          description: updated datetime
          format: date-time
    FileStatus:
      type: string
      description: File status
      example: PROCESSING
      enum:
      - AWAITING_UPLOAD
      - AWAITING_USER_ACTION
      - VIRUS_SCANNING
      - VIRUS_SCANNED
      - VIRUS_ERROR
      - PROCESSING
      - PROCESSED
      - REJECTED
      - ERROR
      - REPROCESSED
    FileRequest:
      required:
      - contentType
      - fileType
      - filename
      type: object
      properties:
        filename:
          type: string
          description: file name
          example: legal_xml.xml
        description:
          type: string
          description: description
          example: The file for document DOC-1
        creatorSubject:
          type: string
          description: creator subject. It is required if creator type is provided
          example: 00000001-0001-0001-0001-000000000000
        creatorType:
          type: string
          description: creator type. It is required if creator subject is provided
          example: user
        retentionTime:
          type: string
          description: retention time
          format: date-time
          example: 2129-01-14 19:58:47+00:00
        fileSize:
          type: integer
          description: file size
          format: int32
          example: 1024
        fileType:
          type: string
          description: file type
          example: xml
        contentType:
          type: string
          description: content type
          example: application/xml
        source:
          type: string
          description: source
          example: com.unifiedpost.btx.connectors:peppol
        parentFileId:
          type: string
          description: parent file id
          format: uuid
          example: b8536327-4c29-4280-9da2-aa190e8484b7
        tags:
          type: array
          description: tags
          example:
          - tag1
          - tag2
          items:
            type: string
            description: tags
            example: '["tag1","tag2"]'
        metadata:
          $ref: '#/components/schemas/JsonBMap'
    AllFilesResult:
      type: object
      properties:
        files:
          type: array
          description: List of files
          items:
            $ref: '#/components/schemas/FileResult'
        totalElements:
          type: integer
          description: Total number of items in the database that correspond to this
            search criteria
          format: int64
        currentPage:
          type: integer
          description: Current page
          format: int32
        pageSize:
          type: integer
          description: Response page size
          format: int32
    FileSingleParams:
      type: object
      properties:
        hasDocuments:
          type: boolean
          description: Filter files which linked to document or not
          example: true
        creatorSubject:
          type: string
          description: Filter by subject who created the files
          example: 00000001-0001-0001-0001-000000000000
        creatorType:
          type: string
          description: Return the files that have creator type
          example: user
        status:
          $ref: '#/components/schemas/FileStatus'
        fileType:
          type: string
          description: Return the files that have file type
          example: pdf
        filename:
          type: string
          description: Return files having the name partially matching the given filename
          example: Doc-file-1
        source:
          type: string
          description: Return files having the source field equal to the given search
            term
          example: com.unifiedpost.btx.connectors:peppol
        createdAt[eq]:
          type: string
          description: Created at equals, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        createdAt[ne]:
          type: string
          description: Created at not equals, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        createdAt[gt]:
          type: string
          description: Created at greater than, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        createdAt[gte]:
          type: string
          description: Created at greater than or equal, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        createdAt[lt]:
          type: string
          description: Created at less than, in the format yyyy-MM-dd
          format: date
          example: 2024-04-15
        createdAt[lte]:
          type: string
          description: Created at less than or equal, in the format yyyy-MM-dd
          format: date
          example: 2024-04-15
        parentFileId:
          type: string
          description: Filter by parent file ID. If null, top-level files are returned.
          format: uuid
          example: b8536327-4c29-4280-9da2-aa190e8484b7
        include:
          type: string
          description: What extra data to include in the response.
          example: children
    ANTLRErrorListener:
      type: object
    ATN:
      type: object
      properties:
        states:
          type: array
          items:
            $ref: '#/components/schemas/ATNState'
        decisionToState:
          type: array
          items:
            $ref: '#/components/schemas/DecisionState'
        ruleToStartState:
          type: array
          items:
            $ref: '#/components/schemas/RuleStartState'
        ruleToStopState:
          type: array
          items:
            $ref: '#/components/schemas/RuleStopState'
        modeNameToStartState:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/TokensStartState'
        grammarType:
          type: string
          enum:
          - LEXER
          - PARSER
        maxTokenType:
          type: integer
          format: int32
        ruleToTokenType:
          type: array
          items:
            type: integer
            format: int32
        lexerActions:
          type: array
          items:
            $ref: '#/components/schemas/LexerAction'
        modeToStartState:
          type: array
          items:
            $ref: '#/components/schemas/TokensStartState'
        numberOfDecisions:
          type: integer
          format: int32
    ATNConfig:
      type: object
      properties:
        state:
          $ref: '#/components/schemas/ATNState'
        alt:
          type: integer
          format: int32
        context:
          $ref: '#/components/schemas/PredictionContext'
        reachesIntoOuterContext:
          type: integer
          format: int32
        semanticContext:
          $ref: '#/components/schemas/SemanticContext'
        precedenceFilterSuppressed:
          type: boolean
        outerContextDepth:
          type: integer
          format: int32
    ATNConfigSet:
      uniqueItems: true
      type: array
      properties:
        readonly:
          type: boolean
        configLookup:
          type: array
          properties:
            empty:
              type: boolean
          items:
            $ref: '#/components/schemas/ATNConfig'
        configs:
          type: array
          items:
            $ref: '#/components/schemas/ATNConfig'
        uniqueAlt:
          type: integer
          format: int32
        hasSemanticContext:
          type: boolean
        dipsIntoOuterContext:
          type: boolean
        fullCtx:
          type: boolean
        empty:
          type: boolean
        alts:
          type: object
          properties:
            empty:
              type: boolean
        states:
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/ATNState'
        predicates:
          type: array
          items:
            $ref: '#/components/schemas/SemanticContext'
      items:
        $ref: '#/components/schemas/ATNConfig'
    ATNState:
      type: object
      properties:
        atn:
          $ref: '#/components/schemas/ATN'
        stateNumber:
          type: integer
          format: int32
        ruleIndex:
          type: integer
          format: int32
        epsilonOnlyTransitions:
          type: boolean
        transitions:
          type: array
          items:
            $ref: '#/components/schemas/Transition'
        nextTokenWithinRule:
          $ref: '#/components/schemas/IntervalSet'
        nonGreedyExitState:
          type: boolean
        numberOfTransitions:
          type: integer
          format: int32
        stateType:
          type: integer
          format: int32
    AbstractConfigHashSet:
      type: array
      properties:
        empty:
          type: boolean
      items:
        $ref: '#/components/schemas/ATNConfig'
    AmbiguityInfo:
      type: object
      properties:
        decision:
          type: integer
          format: int32
        configs:
          uniqueItems: true
          type: array
          properties:
            readonly:
              type: boolean
            configLookup:
              type: array
              properties:
                empty:
                  type: boolean
              items:
                $ref: '#/components/schemas/ATNConfig'
            configs:
              type: array
              items:
                $ref: '#/components/schemas/ATNConfig'
            uniqueAlt:
              type: integer
              format: int32
            hasSemanticContext:
              type: boolean
            dipsIntoOuterContext:
              type: boolean
            fullCtx:
              type: boolean
            empty:
              type: boolean
            alts:
              type: object
              properties:
                empty:
                  type: boolean
            states:
              uniqueItems: true
              type: array
              items:
                $ref: '#/components/schemas/ATNState'
            predicates:
              type: array
              items:
                $ref: '#/components/schemas/SemanticContext'
          items:
            $ref: '#/components/schemas/ATNConfig'
        input:
          $ref: '#/components/schemas/TokenStream'
        startIndex:
          type: integer
          format: int32
        stopIndex:
          type: integer
          format: int32
        fullCtx:
          type: boolean
        ambigAlts:
          type: object
          properties:
            empty:
              type: boolean
    CharStream:
      type: object
      properties:
        sourceName:
          type: string
    ContextSensitivityInfo:
      type: object
      properties:
        decision:
          type: integer
          format: int32
        configs:
          uniqueItems: true
          type: array
          properties:
            readonly:
              type: boolean
            configLookup:
              type: array
              properties:
                empty:
                  type: boolean
              items:
                $ref: '#/components/schemas/ATNConfig'
            configs:
              type: array
              items:
                $ref: '#/components/schemas/ATNConfig'
            uniqueAlt:
              type: integer
              format: int32
            hasSemanticContext:
              type: boolean
            dipsIntoOuterContext:
              type: boolean
            fullCtx:
              type: boolean
            empty:
              type: boolean
            alts:
              type: object
              properties:
                empty:
                  type: boolean
            states:
              uniqueItems: true
              type: array
              items:
                $ref: '#/components/schemas/ATNState'
            predicates:
              type: array
              items:
                $ref: '#/components/schemas/SemanticContext'
          items:
            $ref: '#/components/schemas/ATNConfig'
        input:
          $ref: '#/components/schemas/TokenStream'
        startIndex:
          type: integer
          format: int32
        stopIndex:
          type: integer
          format: int32
        fullCtx:
          type: boolean
    DecisionInfo:
      type: object
      properties:
        decision:
          type: integer
          format: int32
        invocations:
          type: integer
          format: int64
        timeInPrediction:
          type: integer
          format: int64
        SLL_TotalLook:
          type: integer
          format: int64
        SLL_MinLook:
          type: integer
          format: int64
        SLL_MaxLook:
          type: integer
          format: int64
        SLL_MaxLookEvent:
          $ref: '#/components/schemas/LookaheadEventInfo'
        LL_TotalLook:
          type: integer
          format: int64
        LL_MinLook:
          type: integer
          format: int64
        LL_MaxLook:
          type: integer
          format: int64
        LL_MaxLookEvent:
          $ref: '#/components/schemas/LookaheadEventInfo'
        contextSensitivities:
          type: array
          items:
            $ref: '#/components/schemas/ContextSensitivityInfo'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorInfo'
        ambiguities:
          type: array
          items:
            $ref: '#/components/schemas/AmbiguityInfo'
        predicateEvals:
          type: array
          items:
            $ref: '#/components/schemas/PredicateEvalInfo'
        SLL_ATNTransitions:
          type: integer
          format: int64
        SLL_DFATransitions:
          type: integer
          format: int64
        LL_Fallback:
          type: integer
          format: int64
        LL_ATNTransitions:
          type: integer
          format: int64
        LL_DFATransitions:
          type: integer
          format: int64
    DecisionState:
      type: object
      properties:
        atn:
          $ref: '#/components/schemas/ATN'
        stateNumber:
          type: integer
          format: int32
        ruleIndex:
          type: integer
          format: int32
        epsilonOnlyTransitions:
          type: boolean
        transitions:
          type: array
          items:
            $ref: '#/components/schemas/Transition'
        nextTokenWithinRule:
          $ref: '#/components/schemas/IntervalSet'
        decision:
          type: integer
          format: int32
        nonGreedy:
          type: boolean
        nonGreedyExitState:
          type: boolean
        numberOfTransitions:
          type: integer
          format: int32
        stateType:
          type: integer
          format: int32
    ErrorInfo:
      type: object
      properties:
        decision:
          type: integer
          format: int32
        configs:
          uniqueItems: true
          type: array
          properties:
            readonly:
              type: boolean
            configLookup:
              type: array
              properties:
                empty:
                  type: boolean
              items:
                $ref: '#/components/schemas/ATNConfig'
            configs:
              type: array
              items:
                $ref: '#/components/schemas/ATNConfig'
            uniqueAlt:
              type: integer
              format: int32
            hasSemanticContext:
              type: boolean
            dipsIntoOuterContext:
              type: boolean
            fullCtx:
              type: boolean
            empty:
              type: boolean
            alts:
              type: object
              properties:
                empty:
                  type: boolean
            states:
              uniqueItems: true
              type: array
              items:
                $ref: '#/components/schemas/ATNState'
            predicates:
              type: array
              items:
                $ref: '#/components/schemas/SemanticContext'
          items:
            $ref: '#/components/schemas/ATNConfig'
        input:
          $ref: '#/components/schemas/TokenStream'
        startIndex:
          type: integer
          format: int32
        stopIndex:
          type: integer
          format: int32
        fullCtx:
          type: boolean
    IntStream:
      type: object
      properties:
        sourceName:
          type: string
    Interval:
      type: object
      properties:
        a:
          type: integer
          format: int32
        b:
          type: integer
          format: int32
    IntervalSet:
      type: object
      properties:
        intervals:
          type: array
          items:
            $ref: '#/components/schemas/Interval'
        readonly:
          type: boolean
        nil:
          type: boolean
        maxElement:
          type: integer
          format: int32
        minElement:
          type: integer
          format: int32
    LexerAction:
      type: object
      properties:
        positionDependent:
          type: boolean
        actionType:
          type: string
          enum:
          - CHANNEL
          - CUSTOM
          - MODE
          - MORE
          - POP_MODE
          - PUSH_MODE
          - SKIP
          - TYPE
    LookaheadEventInfo:
      type: object
      properties:
        decision:
          type: integer
          format: int32
        configs:
          uniqueItems: true
          type: array
          properties:
            readonly:
              type: boolean
            configLookup:
              type: array
              properties:
                empty:
                  type: boolean
              items:
                $ref: '#/components/schemas/ATNConfig'
            configs:
              type: array
              items:
                $ref: '#/components/schemas/ATNConfig'
            uniqueAlt:
              type: integer
              format: int32
            hasSemanticContext:
              type: boolean
            dipsIntoOuterContext:
              type: boolean
            fullCtx:
              type: boolean
            empty:
              type: boolean
            alts:
              type: object
              properties:
                empty:
                  type: boolean
            states:
              uniqueItems: true
              type: array
              items:
                $ref: '#/components/schemas/ATNState'
            predicates:
              type: array
              items:
                $ref: '#/components/schemas/SemanticContext'
          items:
            $ref: '#/components/schemas/ATNConfig'
        input:
          $ref: '#/components/schemas/TokenStream'
        startIndex:
          type: integer
          format: int32
        stopIndex:
          type: integer
          format: int32
        fullCtx:
          type: boolean
        predictedAlt:
          type: integer
          format: int32
    ParseInfo:
      type: object
      properties:
        totalLLATNLookaheadOps:
          type: integer
          format: int64
        totalATNLookaheadOps:
          type: integer
          format: int64
        decisionInfo:
          type: array
          items:
            $ref: '#/components/schemas/DecisionInfo'
        lldecisions:
          type: array
          items:
            type: integer
            format: int32
        dfasize:
          type: integer
          format: int32
        totalTimeInPrediction:
          type: integer
          format: int64
        totalSLLLookaheadOps:
          type: integer
          format: int64
        totalLLLookaheadOps:
          type: integer
          format: int64
        totalSLLATNLookaheadOps:
          type: integer
          format: int64
    ParseTree:
      type: object
      properties:
        parent:
          $ref: '#/components/schemas/ParseTree'
        text:
          type: string
        sourceInterval:
          $ref: '#/components/schemas/Interval'
        payload:
          type: object
        childCount:
          type: integer
          format: int32
    ParserRuleContext:
      type: object
      properties:
        parent:
          $ref: '#/components/schemas/ParserRuleContext'
        invokingState:
          type: integer
          format: int32
        children:
          type: array
          items:
            $ref: '#/components/schemas/ParseTree'
        start:
          $ref: '#/components/schemas/Token'
        stop:
          $ref: '#/components/schemas/Token'
        exception:
          $ref: '#/components/schemas/RecognitionException'
        childCount:
          type: integer
          format: int32
        sourceInterval:
          $ref: '#/components/schemas/Interval'
        empty:
          type: boolean
        payload:
          $ref: '#/components/schemas/RuleContext'
        text:
          type: string
        ruleContext:
          $ref: '#/components/schemas/RuleContext'
        ruleIndex:
          type: integer
          format: int32
        altNumber:
          type: integer
          format: int32
    PredicateEvalInfo:
      type: object
      properties:
        decision:
          type: integer
          format: int32
        configs:
          uniqueItems: true
          type: array
          properties:
            readonly:
              type: boolean
            configLookup:
              type: array
              properties:
                empty:
                  type: boolean
              items:
                $ref: '#/components/schemas/ATNConfig'
            configs:
              type: array
              items:
                $ref: '#/components/schemas/ATNConfig'
            uniqueAlt:
              type: integer
              format: int32
            hasSemanticContext:
              type: boolean
            dipsIntoOuterContext:
              type: boolean
            fullCtx:
              type: boolean
            empty:
              type: boolean
            alts:
              type: object
              properties:
                empty:
                  type: boolean
            states:
              uniqueItems: true
              type: array
              items:
                $ref: '#/components/schemas/ATNState'
            predicates:
              type: array
              items:
                $ref: '#/components/schemas/SemanticContext'
          items:
            $ref: '#/components/schemas/ATNConfig'
        input:
          $ref: '#/components/schemas/TokenStream'
        startIndex:
          type: integer
          format: int32
        stopIndex:
          type: integer
          format: int32
        fullCtx:
          type: boolean
        semctx:
          $ref: '#/components/schemas/SemanticContext'
        predictedAlt:
          type: integer
          format: int32
        evalResult:
          type: boolean
    PredictionContext:
      type: object
      properties:
        id:
          type: integer
          format: int32
        cachedHashCode:
          type: integer
          format: int32
        empty:
          type: boolean
    QueryContext:
      type: object
      properties:
        parent:
          $ref: '#/components/schemas/ParserRuleContext'
        invokingState:
          type: integer
          format: int32
        children:
          type: array
          items:
            $ref: '#/components/schemas/ParseTree'
        start:
          $ref: '#/components/schemas/Token'
        stop:
          $ref: '#/components/schemas/Token'
        exception:
          $ref: '#/components/schemas/RecognitionException'
        ruleIndex:
          type: integer
          format: int32
        childCount:
          type: integer
          format: int32
        sourceInterval:
          $ref: '#/components/schemas/Interval'
        empty:
          type: boolean
        payload:
          $ref: '#/components/schemas/RuleContext'
        text:
          type: string
        ruleContext:
          $ref: '#/components/schemas/RuleContext'
        altNumber:
          type: integer
          format: int32
    RecognitionException:
      type: object
      properties:
        cause:
          type: object
          properties:
            stackTrace:
              type: array
              items:
                type: object
                properties:
                  classLoaderName:
                    type: string
                  moduleName:
                    type: string
                  moduleVersion:
                    type: string
                  methodName:
                    type: string
                  fileName:
                    type: string
                  lineNumber:
                    type: integer
                    format: int32
                  className:
                    type: string
                  nativeMethod:
                    type: boolean
            message:
              type: string
            suppressed:
              type: array
              items:
                type: object
                properties:
                  stackTrace:
                    type: array
                    items:
                      type: object
                      properties:
                        classLoaderName:
                          type: string
                        moduleName:
                          type: string
                        moduleVersion:
                          type: string
                        methodName:
                          type: string
                        fileName:
                          type: string
                        lineNumber:
                          type: integer
                          format: int32
                        className:
                          type: string
                        nativeMethod:
                          type: boolean
                  message:
                    type: string
                  localizedMessage:
                    type: string
            localizedMessage:
              type: string
        stackTrace:
          type: array
          items:
            type: object
            properties:
              classLoaderName:
                type: string
              moduleName:
                type: string
              moduleVersion:
                type: string
              methodName:
                type: string
              fileName:
                type: string
              lineNumber:
                type: integer
                format: int32
              className:
                type: string
              nativeMethod:
                type: boolean
        recognizer:
          $ref: '#/components/schemas/RecognizerObjectObject'
        ctx:
          $ref: '#/components/schemas/RuleContext'
        offendingToken:
          $ref: '#/components/schemas/Token'
        offendingState:
          type: integer
          format: int32
        inputStream:
          $ref: '#/components/schemas/IntStream'
        expectedTokens:
          $ref: '#/components/schemas/IntervalSet'
        message:
          type: string
        suppressed:
          type: array
          items:
            type: object
            properties:
              stackTrace:
                type: array
                items:
                  type: object
                  properties:
                    classLoaderName:
                      type: string
                    moduleName:
                      type: string
                    moduleVersion:
                      type: string
                    methodName:
                      type: string
                    fileName:
                      type: string
                    lineNumber:
                      type: integer
                      format: int32
                    className:
                      type: string
                    nativeMethod:
                      type: boolean
              message:
                type: string
              localizedMessage:
                type: string
        localizedMessage:
          type: string
    RecognizerObjectObject:
      type: object
      properties:
        state:
          type: integer
          format: int32
        inputStream:
          $ref: '#/components/schemas/IntStream'
        atn:
          $ref: '#/components/schemas/ATN'
        tokenFactory:
          $ref: '#/components/schemas/TokenFactoryObject'
        parseInfo:
          $ref: '#/components/schemas/ParseInfo'
        ruleIndexMap:
          type: object
          additionalProperties:
            type: integer
            format: int32
        interpreter:
          type: object
        tokenTypeMap:
          type: object
          additionalProperties:
            type: integer
            format: int32
        errorListeners:
          type: array
          items:
            $ref: '#/components/schemas/ANTLRErrorListener'
        ruleNames:
          type: array
          items:
            type: string
        tokenNames:
          type: array
          items:
            type: string
        vocabulary:
          $ref: '#/components/schemas/Vocabulary'
        grammarFileName:
          type: string
        serializedATN:
          type: string
        errorListenerDispatch:
          $ref: '#/components/schemas/ANTLRErrorListener'
    RuleContext:
      type: object
      properties:
        parent:
          $ref: '#/components/schemas/RuleContext'
        invokingState:
          type: integer
          format: int32
        empty:
          type: boolean
        payload:
          $ref: '#/components/schemas/RuleContext'
        text:
          type: string
        childCount:
          type: integer
          format: int32
        ruleContext:
          $ref: '#/components/schemas/RuleContext'
        ruleIndex:
          type: integer
          format: int32
        sourceInterval:
          $ref: '#/components/schemas/Interval'
        altNumber:
          type: integer
          format: int32
    RuleStartState:
      type: object
      properties:
        atn:
          $ref: '#/components/schemas/ATN'
        stateNumber:
          type: integer
          format: int32
        ruleIndex:
          type: integer
          format: int32
        epsilonOnlyTransitions:
          type: boolean
        transitions:
          type: array
          items:
            $ref: '#/components/schemas/Transition'
        nextTokenWithinRule:
          $ref: '#/components/schemas/IntervalSet'
        stopState:
          $ref: '#/components/schemas/RuleStopState'
        isLeftRecursiveRule:
          type: boolean
        stateType:
          type: integer
          format: int32
        nonGreedyExitState:
          type: boolean
        numberOfTransitions:
          type: integer
          format: int32
    RuleStopState:
      type: object
      properties:
        atn:
          $ref: '#/components/schemas/ATN'
        stateNumber:
          type: integer
          format: int32
        ruleIndex:
          type: integer
          format: int32
        epsilonOnlyTransitions:
          type: boolean
        transitions:
          type: array
          items:
            $ref: '#/components/schemas/Transition'
        nextTokenWithinRule:
          $ref: '#/components/schemas/IntervalSet'
        stateType:
          type: integer
          format: int32
        nonGreedyExitState:
          type: boolean
        numberOfTransitions:
          type: integer
          format: int32
    SemanticContext:
      type: object
    Token:
      type: object
      properties:
        type:
          type: integer
          format: int32
        inputStream:
          $ref: '#/components/schemas/CharStream'
        channel:
          type: integer
          format: int32
        text:
          type: string
        tokenSource:
          $ref: '#/components/schemas/TokenSource'
        startIndex:
          type: integer
          format: int32
        stopIndex:
          type: integer
          format: int32
        tokenIndex:
          type: integer
          format: int32
        charPositionInLine:
          type: integer
          format: int32
        line:
          type: integer
          format: int32
    TokenFactoryObject:
      type: object
    TokenSource:
      type: object
      properties:
        inputStream:
          $ref: '#/components/schemas/CharStream'
        tokenFactory:
          $ref: '#/components/schemas/TokenFactoryObject'
        charPositionInLine:
          type: integer
          format: int32
        sourceName:
          type: string
        line:
          type: integer
          format: int32
    TokenStream:
      type: object
      properties:
        text:
          type: string
        tokenSource:
          $ref: '#/components/schemas/TokenSource'
        sourceName:
          type: string
    TokensStartState:
      type: object
      properties:
        atn:
          $ref: '#/components/schemas/ATN'
        stateNumber:
          type: integer
          format: int32
        ruleIndex:
          type: integer
          format: int32
        epsilonOnlyTransitions:
          type: boolean
        transitions:
          type: array
          items:
            $ref: '#/components/schemas/Transition'
        nextTokenWithinRule:
          $ref: '#/components/schemas/IntervalSet'
        decision:
          type: integer
          format: int32
        nonGreedy:
          type: boolean
        stateType:
          type: integer
          format: int32
        nonGreedyExitState:
          type: boolean
        numberOfTransitions:
          type: integer
          format: int32
    Transition:
      type: object
      properties:
        target:
          $ref: '#/components/schemas/ATNState'
        epsilon:
          type: boolean
        serializationType:
          type: integer
          format: int32
    Vocabulary:
      type: object
      properties:
        maxTokenType:
          type: integer
          format: int32
    LinkedDocumentResult:
      type: object
      properties:
        id:
          type: string
          description: Id of document
          format: uuid
        description:
          type: string
          description: Description of document
    ListLinkedDocumentsResult:
      type: object
      properties:
        documents:
          type: array
          description: List of documents
          items:
            $ref: '#/components/schemas/LinkedDocumentResult'
    DocumentList:
      type: object
      properties:
        documents:
          type: array
          description: List of document ids
          items:
            type: string
            description: List of document ids
    UpdateFileRequest:
      type: object
      properties:
        filename:
          type: string
          description: file name
          example: legal_xml.xml
        description:
          type: string
          description: description
          example: The file for document DOC-1
        creatorSubject:
          type: string
          description: creator subject
          example: 00000001-0001-0001-0001-000000000000
        creatorType:
          type: string
          description: creator type
          example: user
        retentionTime:
          type: string
          description: retention time
          format: date-time
          example: 2129-01-14 19:58:47+00:00
        status:
          $ref: '#/components/schemas/FileStatus'
        fileSize:
          type: integer
          description: file size
          format: int32
          example: 1024
        fileType:
          type: string
          description: file type
          example: xml
        contentType:
          type: string
          description: content type
          example: application/xml
        source:
          type: string
          description: source
          example: com.unifiedpost.btx.connectors:peppol
        tags:
          type: array
          description: tags
          example:
          - tag1
          - tag2
          items:
            type: string
            description: tags
            example: '["tag1","tag2"]'
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        parentFileId:
          type: string
          description: parent file id
          format: uuid
          example: b8536327-4c29-4280-9da2-aa190e8484b7
    Data:
      type: object
      properties:
        spaceId:
          type: string
        partnerId:
          type: string
        clientId:
          type: string
    ExtensionCreatedMessage:
      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:
      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:
      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:
      type: object
      properties:
        resourceId:
          type: string
        scope:
          type: string
        category:
          type: string
        type:
          type: string
        orderGroup:
          type: string
        data:
          $ref: '#/components/schemas/Data'
    AcceptPeppolDesignationRequest:
      type: object
      properties:
        clients:
          type: array
          description: List of clients with their Peppol identifiers
          items:
            $ref: '#/components/schemas/PeppolClientIdentifierRequest'
    PeppolClientIdentifierRequest:
      type: object
      properties:
        clientId:
          type: string
          description: Client identifier
          format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
        identifiers:
          type: array
          description: List of Peppol identifiers for the client
          example:
          - 0255:123456789
          - 0208:987654321
          items:
            type: string
            description: List of Peppol identifiers for the client
            example: '["0255:123456789","0208:987654321"]'
    BulkClientFullResult:
      type: object
      allOf:
      - $ref: '#/components/schemas/BulkClientResult'
      - type: object
        properties:
          clients:
            type: array
            description: List of clients
            items:
              $ref: '#/components/schemas/ClientResult'
    BulkClientIdsResult:
      type: object
      allOf:
      - $ref: '#/components/schemas/BulkClientResult'
      - type: object
        properties:
          clients:
            type: array
            items:
              type: string
              format: uuid
    BulkClientResult:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/BulkResponseType'
      discriminator:
        propertyName: type
        mapping:
          ids: '#/components/schemas/BulkClientIdsResult'
          full: '#/components/schemas/BulkClientFullResult'
    BulkResponseType:
      type: string
      description: Bulk response type
      example: full
      enum:
      - full
      - ids
    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
          description: List of contacts
          items:
            $ref: '#/components/schemas/ContactResult'
        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:
            $ref: '#/components/schemas/JsonBMap'
        myPermissions:
          type: array
          description: List of scopes the requesting subject has on this client resource
            (e.g. client_read, client_write)
          items:
            type: string
            example: client_read
    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
    SepaStructuredAddress:
      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
    BulkResponseOptions:
      type: object
      properties:
        full:
          type: boolean
          description: 'Flag to indicate whether to return a detailed response.

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

            '
          example: true
          default: false
      description: Response options
    BulkUpdateClientRequest:
      type: object
      properties:
        responseOptions:
          $ref: '#/components/schemas/BulkResponseOptions'
        clients:
          type: array
          description: List of clients to update
          items:
            $ref: '#/components/schemas/BulkUpdateClientRequestItem'
    BulkUpdateClientRequestItem:
      type: object
      properties:
        id:
          type: string
        operations:
          $ref: '#/components/schemas/JsonPatch'
    ConfigureRequest:
      required:
      - settings
      type: object
      properties:
        settings:
          type: object
          additionalProperties:
            type: object
        tings:
          $ref: '#/components/schemas/ConfigureRequest'
    ClientRequest:
      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
          description: List of contacts
          items:
            $ref: '#/components/schemas/ContactRequest'
    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
    PartnerUserResponse:
      type: object
      properties:
        subject:
          type: string
          description: Identifier of subject
          example: 8e9ad622-4d80-48c6-b860-036d4ff65b15
        type:
          $ref: '#/components/schemas/SpaceSubjectType'
        resourceId:
          type: string
          description: Identifier of resource
          example: 00000001-0000-0000-0000-000000000000
        resourceType:
          $ref: '#/components/schemas/ResourceType'
        partnerIds:
          type: array
          description: Partner identifiers of user
          items:
            type: string
            format: uuid
        name:
          type: string
          description: Name of subject
          example: John Doe
        status:
          $ref: '#/components/schemas/PermissionSubjectStatus'
        createdAt:
          type: string
          description: Date & time of user creation
          format: date-time
        updatedAt:
          type: string
          description: Date & time of when user was last updated
          format: date-time
    PermissionSubjectStatus:
      type: string
      description: Permission subject's statuses
      example: INACTIVE
      default: ACTIVE
      enum:
      - ACTIVE
      - INACTIVE
    ResourceType:
      type: string
      description: Resource type
      example: SPACE
      enum:
      - SPACE
      - ENTITY
    SpaceSubjectType:
      type: string
      description: The type of space subject
      example: USER
      enum:
      - USER
      - APPLICATION
      - EXTENSION
      - CORE
      - PARTNER_SPACE
    PartnerUserRequest:
      type: object
      properties:
        subject:
          type: string
          description: Identifier of subject
          example: 8e9ad622-4d80-48c6-b860-036d4ff65b15
        name:
          type: string
          description: Name of subject
          example: John Appleseed
        status:
          $ref: '#/components/schemas/PermissionSubjectStatus'
    ClientIncludeField:
      type: string
      description: Optional fields to include in client responses
      enum:
      - myPermissions
    ClientResultList:
      type: object
      properties:
        clients:
          type: array
          description: List of clients
          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
    SpaceResult:
      type: object
      properties:
        id:
          type: string
          description: Space ID
          format: uuid
        name:
          type: string
          description: The name of the space
        type:
          $ref: '#/components/schemas/SpaceType'
        segment:
          $ref: '#/components/schemas/SpaceSegment'
        region:
          type: string
          description: The region of the space
          example: eu
    SpaceSegment:
      type: string
      description: 'The segment of the space, depending on the type. Allowed values:
        PERSONAL -> CONSUMER, CARETAKER_CLIENT; BUSINESS -> SME, CORPORATE; PARTNER
        -> ACCOUNTING, RESELLER, CARETAKER, REFERRAL, SYSTEM_INTEGRATOR; APPLICATION
        -> null.'
      example: CONSUMER
      enum:
      - CONSUMER
      - CARETAKER_CLIENT
      - SME
      - CORPORATE
      - ACCOUNTING
      - RESELLER
      - CARETAKER
      - REFERRAL
      - SYSTEM_INTEGRATOR
    SpaceType:
      type: string
      description: The type of the space
      example: BUSINESS
      enum:
      - APPLICATION
      - BUSINESS
      - PERSONAL
      - PARTNER
    ListPermissionSubjectResult:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/PermissionSubjectResult'
        totalElements:
          type: integer
          format: int64
        currentPage:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
    PermissionSubjectResult:
      type: object
      properties:
        subject:
          type: string
        resourceId:
          type: string
          format: uuid
        resourceType:
          type: string
          enum:
          - SPACE
          - ENTITY
        name:
          type: string
        type:
          type: string
          enum:
          - USER
          - APPLICATION
          - EXTENSION
          - CORE
          - PARTNER_SPACE
        partnerIds:
          type: array
          items:
            type: string
            format: uuid
        status:
          type: string
          enum:
          - ACTIVE
          - INACTIVE
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    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).
    PermissionListResult:
      required:
      - requester
      type: object
      properties:
        requester:
          type: string
          description: the requester
        permissions:
          type: array
          description: the list of permissions
          items:
            $ref: '#/components/schemas/PermissionListItem'
    PermissionsWrapperResult:
      type: object
      properties:
        subjects:
          type: array
          description: List of permissions
          items:
            $ref: '#/components/schemas/PermissionListResult'
    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
        plugins:
          type: array
          items:
            $ref: '#/components/schemas/PluginDefinition'
        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
        tings:
          $ref: '#/components/schemas/ExtensionResult'
    Plugin:
      type: object
      properties:
        namespace:
          type: string
        name:
          type: string
    PluginDefinition:
      type: object
      properties:
        pluginInterface:
          $ref: '#/components/schemas/PluginInterface'
        plugins:
          type: array
          items:
            $ref: '#/components/schemas/Plugin'
    PluginInterface:
      type: object
      properties:
        name:
          type: string
        namespace:
          type: string
        version:
          type: string
    UpdateSpaceRequest:
      type: object
      properties:
        name:
          type: string
          description: Name of space
        segment:
          $ref: '#/components/schemas/SpaceSegment'
        description:
          type: string
          description: Description of space
        isDefault:
          type: boolean
          description: Default space?
        context:
          type: object
          additionalProperties:
            type: object
            description: Space context. The context modules will be ignored.
            example:
              brand: Banqup
          description: Space context. The context modules will be ignored.
          example:
            brand: Banqup
        globalIdentifiers:
          $ref: '#/components/schemas/JsonBMap'
    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
          description: List of contacts
          items:
            $ref: '#/components/schemas/UpdateContactRequest'
        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
    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
    DirectoryIdentifierDto:
      required:
      - id
      - name
      type: object
      properties:
        id:
          type: string
          description: Directory id
          format: uuid
        name:
          type: string
          description: Name of the directory
      description: Document's parent directory
      example:
        id: 44d929f7-952d-4283-9010-8a63a16831b3
        name: Plant
    DirectoryResponse:
      required:
      - folder
      - id
      - name
      - spaceId
      type: object
      properties:
        id:
          type: string
          description: Directory id
          format: uuid
        spaceId:
          type: string
          description: Space id
          format: uuid
        name:
          type: string
          description: Name of the directory
        folder:
          $ref: '#/components/schemas/FolderV2'
        parentDirectory:
          $ref: '#/components/schemas/DirectoryIdentifierDto'
        timestamps:
          $ref: '#/components/schemas/Timestamps'
    FolderV2:
      type: string
      description: Document folder v2
      example: INBOX
      enum:
      - PURCHASES
      - SALES
      - DRAFTS
      - INBOX
      - STATEMENTS
      - FILES
    Timestamps:
      type: object
      properties:
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    FolderLowercase:
      type: string
      description: Document folder lowercase
      example: inbox
      enum:
      - purchases
      - sales
      - drafts
      - inbox
      - statements
      - files
    DirectoryRequest:
      required:
      - name
      type: object
      properties:
        name:
          type: string
          description: Name of the directory.
          example: Fruits
        parentDirectoryId:
          type: string
          description: Optional parent directory. Must exist if not null. Null means
            top-level (root) directory in that folder.
          format: uuid
          example: 44d929f7-952d-4283-9010-8a63a16831b3
    FolderItemResponse:
      required:
      - id
      - name
      type: object
      properties:
        id:
          type: string
          description: Item identifier
          format: uuid
        name:
          type: string
          description: Item name
        type:
          $ref: '#/components/schemas/FolderItemType'
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        timestamps:
          $ref: '#/components/schemas/Timestamps'
    FolderItemType:
      type: string
      description: Folder item type
      example: DIRECTORY
      enum:
      - DIRECTORY
      - DOCUMENT
    ListFolderItemsResponse:
      type: object
      properties:
        items:
          type: array
          description: List of folder items
          items:
            $ref: '#/components/schemas/FolderItemResponse'
        totalElements:
          type: integer
          description: Total number of items in the database that correspond to this
            search criteria
          format: int64
        currentPage:
          type: integer
          description: Current page
          format: int32
        pageSize:
          type: integer
          description: Response page size
          format: int32
    FolderItemInclude:
      type: string
      description: The possible linked resources to include
      example: metadata
      enum:
      - timestamps
      - metadata
    MoveDirectoryRequest:
      type: object
      properties:
        parentDirectoryId:
          type: string
          description: Optional parent directory. Must exist if not null. Null means
            top-level (root) directory in that folder.
          format: uuid
          example: 44d929f7-952d-4283-9010-8a63a16831b3
    UpdateDirectoryRequest:
      required:
      - name
      type: object
      properties:
        name:
          type: string
          description: Name of the directory.
    AggregationStatus:
      type: string
      description: Status determined by aggregation
      example: AUTO_CONFIRMED
      enum:
      - PROPOSED
      - AUTO_CONFIRMED
      - USER_CONFIRMED
      - REJECTED
    AmountDto:
      type: object
      properties:
        value:
          type: string
          description: Amount value with a maximum of 14 integer digits and 2 fractional
            digits
          example: '10.05'
        currency:
          pattern: '[A-Z]{3}'
          type: string
          description: International code of the currency used
          example: EUR
    BalanceOffsetPayableType:
      type: string
      description: Discriminator to determine the payable type.
      example: document
      enum:
      - document
      - note
      - payment
    BalanceOffsetResult:
      required:
      - aggregationStatus
      - offsetType
      - paymentId
      type: object
      properties:
        payableType:
          $ref: '#/components/schemas/BalanceOffsetPayableType'
        id:
          type: string
          description: id of balance offset
          format: uuid
        spaceId:
          type: string
          description: Space id
          format: uuid
        paymentId:
          type: string
          description: Payment id
          format: uuid
        amount:
          $ref: '#/components/schemas/AmountDto'
        offsetType:
          $ref: '#/components/schemas/BalanceOffsetType'
        aggregationStatus:
          $ref: '#/components/schemas/AggregationStatus'
        createdAt:
          type: string
          description: creation datetime
          format: date-time
        updatedAt:
          type: string
          description: updated datetime
          format: date-time
        metadata:
          $ref: '#/components/schemas/JsonBMap'
      discriminator:
        propertyName: payableType
        mapping:
          document: '#/components/schemas/DocumentBalanceOffsetResult'
          note: '#/components/schemas/NoteBalanceOffsetResult'
          payment: '#/components/schemas/PaymentBalanceOffsetResult'
    BalanceOffsetType:
      type: string
      description: Type of balance offset
      example: PARTIAL
      enum:
      - FULL
      - PARTIAL
      - DISCOUNT
      - REFUND
      - TIP
      - UNDERPAYMENT
      - OVERPAYMENT
      - FEE
    BulkDocumentFullResponse:
      type: object
      allOf:
      - $ref: '#/components/schemas/BulkDocumentsResponse'
      - type: object
        properties:
          documents:
            type: array
            items:
              $ref: '#/components/schemas/DocumentV2'
    BulkDocumentIdsResponse:
      type: object
      allOf:
      - $ref: '#/components/schemas/BulkDocumentsResponse'
      - type: object
        properties:
          documents:
            type: array
            items:
              type: string
              format: uuid
    BulkDocumentsResponse:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/BulkResponseType'
      discriminator:
        propertyName: type
        mapping:
          ids: '#/components/schemas/BulkDocumentIdsResponse'
          full: '#/components/schemas/BulkDocumentFullResponse'
    ConnectionRelationType:
      type: string
      description: Connection relation type
      example: CUSTOMER
      enum:
      - CUSTOMER
      - SUPPLIER
      - ACCOUNTANT
      - PARTNER
      - GROUP
    DocumentBalanceOffsetResult:
      required:
      - aggregationStatus
      - documentId
      - offsetType
      - paymentId
      type: object
      allOf:
      - $ref: '#/components/schemas/BalanceOffsetResult'
      - type: object
        properties:
          documentId:
            type: string
            description: Document id
            format: uuid
    DocumentConnectionData:
      type: object
      properties:
        displayName:
          type: string
          description: display name of supplier/customer
        relationType:
          $ref: '#/components/schemas/ConnectionRelationType'
        id:
          type: string
          description: id of supplier/customer
          format: uuid
    DocumentProcessingData:
      $ref: '#/components/schemas/JsonBMap'
    DocumentRawData:
      $ref: '#/components/schemas/JsonBMap'
    DocumentV2:
      required:
      - category
      - folder
      - id
      - metadata
      - retentionTime
      - spaceId
      - status
      type: object
      properties:
        timestamps:
          $ref: '#/components/schemas/Timestamps'
        lines:
          type: array
          description: List of line items
          nullable: true
          items:
            $ref: '#/components/schemas/LineItemV2'
        tasks:
          type: array
          description: List of document tasks
          nullable: true
          items:
            $ref: '#/components/schemas/TaskV2'
        parentDirectory:
          $ref: '#/components/schemas/DirectoryIdentifierDto'
        customCategories:
          type: object
          additionalProperties:
            uniqueItems: true
            type: array
            description: Document's custom categories
            example:
              purchases:
              - fuel
              - restaurant
            items:
              type: string
              description: Document's custom categories
              example: '{"purchases":["fuel","restaurant"]}'
          description: Document's custom categories
          example:
            purchases:
            - fuel
            - restaurant
        connections:
          type: array
          description: Connections of document
          nullable: true
          items:
            $ref: '#/components/schemas/DocumentConnectionData'
        id:
          type: string
          description: id of document
          format: uuid
        spaceId:
          type: string
          description: Space id
          format: uuid
        description:
          type: string
          description: description of document
        source:
          type: string
          description: source of document
        folder:
          $ref: '#/components/schemas/FolderV2'
        status:
          $ref: '#/components/schemas/JsonBMap'
        category:
          type: string
          description: 'Document category, current known values are :  PURCHASE_ORDER,
            ORDER_CONFIRMATION, DELIVERY_NOTE, GOODS_RECEIVED_NOTE, PROFORMA_INVOICE,
            INVOICE, INVOICE_REMINDER, CREDIT_NOTE, RECEIPT, STATEMENT, FILE, QUOTE,
            CREDIT_CARD_STATEMENT, THIRD_PARTY_STATEMENT, SELF_BILLED_INVOICE, SELF_BILLED_CREDIT_NOTE,
            OTHER. Future releases might contain additional new values.'
          example: INVOICE
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        tags:
          type: array
          description: tags
          items:
            type: string
            description: tags
        retentionTime:
          type: string
          description: datetime of document expiry
          format: date-time
        processingData:
          $ref: '#/components/schemas/JsonBMap'
        validationData:
          $ref: '#/components/schemas/JsonBMap'
        rawLinesData:
          $ref: '#/components/schemas/JsonBMap'
        rawData:
          $ref: '#/components/schemas/JsonBMap'
        balanceOffsets:
          type: array
          description: List of document balance offsets
          nullable: true
          items:
            $ref: '#/components/schemas/DocumentBalanceOffsetResult'
    DocumentValidationData:
      $ref: '#/components/schemas/JsonBMap'
    LineItemData:
      $ref: '#/components/schemas/JsonBMap'
    LineItemV2:
      type: object
      properties:
        id:
          type: string
          description: Line item id
          format: uuid
        sequence:
          type: integer
          description: Sequence
          format: int32
          example: 1
        data:
          $ref: '#/components/schemas/JsonBMap'
    NoteBalanceOffsetResult:
      required:
      - aggregationStatus
      - offsetType
      - paymentId
      type: object
      allOf:
      - $ref: '#/components/schemas/BalanceOffsetResult'
      - type: object
        properties:
          comment:
            type: string
            description: Comment on the note balance offset.
    PaymentBalanceOffsetResult:
      required:
      - aggregationStatus
      - counterpartyPaymentId
      - offsetType
      - paymentId
      type: object
      allOf:
      - $ref: '#/components/schemas/BalanceOffsetResult'
      - type: object
        properties:
          counterpartyPaymentId:
            type: string
            description: Counterparty payment id
            format: uuid
    TaskV2:
      type: object
      properties:
        extensionName:
          type: string
          description: extension name
          example: com.unifiedpost.btx.data:approve
        status:
          type: string
          description: extension status
          example: approve
        context:
          $ref: '#/components/schemas/JsonBMap'
    BulkPatchDocumentRequestItem:
      type: object
      properties:
        id:
          type: string
        operations:
          $ref: '#/components/schemas/JsonPatch'
    BulkPatchDocumentsRequest:
      type: object
      properties:
        responseOptions:
          $ref: '#/components/schemas/BulkResponseOptions'
        documents:
          type: array
          description: List of documents to update
          items:
            $ref: '#/components/schemas/BulkPatchDocumentRequestItem'
    ClientDocumentCountResponse:
      required:
      - clientId
      - clientName
      - documents
      type: object
      properties:
        clientId:
          type: string
          description: Client unique identifier
          format: uuid
        clientName:
          type: string
          description: Client name
        documents:
          type: integer
          description: Count of documents in the client space which matched the filters
          format: int64
    CountClientDocumentsResponse:
      type: object
      properties:
        totalElements:
          type: integer
          description: Total number of items in the database that correspond to this
            search criteria
          format: int64
        currentPage:
          type: integer
          description: Current page
          format: int32
        pageSize:
          type: integer
          description: Response page size
          format: int32
        results:
          type: array
          description: List of document counts
          items:
            $ref: '#/components/schemas/ClientDocumentCountResponse'
    CountClientDocumentsRequest:
      required:
      - ql
      type: object
      properties:
        clients:
          type: array
          description: 'List of client IDs to count documents for.

            - If null or omitted: documents will be counted for all clients the user
            has CLIENT_READ permission on within the partner space.

            - If provided: user must have CLIENT_READ permission on each specified
            client (validated as partnerSpaceId + ''_'' + clientId).

            Authorization will fail if any client ID in the list is not accessible
            to the user.

            '
          items:
            type: string
            format: uuid
        ql:
          type: string
          description: BTX Query Language filter expression.
    DocumentCategory:
      type: string
      description: Document category
      example: PURCHASE_ORDER
      enum:
      - PURCHASE_ORDER
      - ORDER_CONFIRMATION
      - DELIVERY_NOTE
      - GOODS_RECEIVED_NOTE
      - PROFORMA_INVOICE
      - INVOICE
      - INVOICE_REMINDER
      - CREDIT_NOTE
      - RECEIPT
      - STATEMENT
      - FILE
      - QUOTE
      - CREDIT_CARD_STATEMENT
      - THIRD_PARTY_STATEMENT
      - SELF_BILLED_INVOICE
      - SELF_BILLED_CREDIT_NOTE
      - OTHER
    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
      - status
      type: object
      properties:
        waitForComplete:
          type: boolean
          description: Whether the document needs to wait for call to /complete endpoint,
            after representations have been uploaded
          example: true
        description:
          type: string
          description: Description of the document.
          example: This is the invoice for your new phone
        source:
          type: string
          description: Source of the document.
          example: choruspro
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        tags:
          type: array
          description: Document tags
          example:
          - expensive
          items:
            type: string
            description: Document tags
            example: '["expensive"]'
        retentionTime:
          type: string
          description: Expiry datetime for the document
        connections:
          type: array
          description: List of connection information
          nullable: true
          items:
            $ref: '#/components/schemas/DocumentConnectionRequest'
        status:
          $ref: '#/components/schemas/JsonBMap'
        category:
          $ref: '#/components/schemas/DocumentCategory'
        folder:
          $ref: '#/components/schemas/FolderV2'
        lines:
          type: array
          items:
            $ref: '#/components/schemas/JsonBMap'
        parentDirectoryId:
          type: string
          description: Parent directory id
          format: uuid
          example: 4c32d3fb-0023-470c-ae21-105274a94706
        customCategories:
          type: object
          additionalProperties:
            uniqueItems: true
            type: array
            description: Document's custom categories
            example:
              purchases:
              - fuel
              - restaurant
            items:
              type: string
              description: Document's custom categories
              example: '{"purchases":["fuel","restaurant"]}'
          description: Document's custom categories
          example:
            purchases:
            - fuel
            - restaurant
        createdAt:
          type: string
          description: Date and time of the document creation, usable only for migration
            tools (with migration_service scope) to keep original creation time during
            data migration
          format: date-time
    ListDocumentsResponseV2:
      type: object
      properties:
        documents:
          type: array
          description: List of documents
          items:
            $ref: '#/components/schemas/DocumentV2'
        totalElements:
          type: integer
          description: Total number of items in the database that correspond to this
            search criteria
          format: int64
        currentPage:
          type: integer
          description: Current page
          format: int32
        pageSize:
          type: integer
          description: Response page size
          format: int32
    ListDocumentsQueryParamsSingle:
      type: object
      properties:
        category:
          type: string
          description: Document category to filter. Can be multiple values separated
            by comma, or just one value
          example: PURCHASE_ORDER,RECEIPT
        connectionName[istart]:
          type: string
          description: Value for filtering by connection name having a specific prefix
          example: UNI
        connectionName[icont]:
          type: string
          description: Value for filtering by connection name containing a specific
            string anywhere in the string value
          example: nif
        documentNumber[istart]:
          type: string
          description: Value for filtering by documentNumber property having a specific
            prefix
          example: NR
        documentNumber[icont]:
          type: string
          description: Value for filtering by documentNumber property containing a
            specific string anywhere in the string value
          example: NR
        status[ql]:
          type: string
          description: Status query language DSL
          example: (document=FULLY_APPROVED OR document=SENT) AND (pay=FULLY_PAID
            OR pay=PARTIALLY_PAID)
        customCategories[ql]:
          type: string
          description: Custom categories language DSL
          example: (purchases=fuel AND purchases=restaurant AND purchases=groceries)
            OR purchases=books
        processingData:
          type: string
          description: processingData query param
          example: processingData=spaceExtensions/com.unifiedpost.btx.connectors/peppol/sbdhInstanceIdentifiers[any]=12345_118e3040-51d2-11e3-8f96-0800200c9a66,92345_118e3040-51d2-11e3-8f96-0800200c9a66
        folder:
          type: string
          description: Document folder to filter. Can be multiple values separated
            by comma, or just one value
          example: PURCHASES,STATEMENTS
        source:
          type: string
          description: Document source.
          example: documentCreator
        createdAt[eq]:
          type: string
          description: Created at equals specific timestamp, iso datetime format
          format: date-time
        createdAt[ne]:
          type: string
          description: Created at does not equal specific timestamp, iso datetime
            format
          format: date-time
        createdAt[lt]:
          type: string
          description: Created at is less than specific timestamp, iso datetime format
          format: date-time
        createdAt[lte]:
          type: string
          description: Created at is less or equal than specific timestamp, iso datetime
            format
          format: date-time
        createdAt[gt]:
          type: string
          description: Created at is greater than specific timestamp, iso datetime
            format
          format: date-time
        createdAt[gte]:
          type: string
          description: Created at is greater than specific timestamp, iso datetime
            format
          format: date-time
        dueDate[eq]:
          type: string
          description: Due date date equals, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        dueDate[ne]:
          type: string
          description: Due date not equals to specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        dueDate[gt]:
          type: string
          description: Due date greater than specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        dueDate[gte]:
          type: string
          description: Due date greater or equal to a specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        dueDate[lt]:
          type: string
          description: Due date less than a specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        dueDate[lte]:
          type: string
          description: Due date less than or equal to a specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[eq]:
          type: string
          description: Issue date date equals, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[ne]:
          type: string
          description: Issue date not equals to specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[gt]:
          type: string
          description: Issue date greater than specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[gte]:
          type: string
          description: Issue date greater or equal to a specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[lt]:
          type: string
          description: Issue date less than a specific date, in format yyyy-MM-dd
          format: date
          example: 2024-04-15
        issueDate[lte]:
          type: string
          description: Issue date less than or equal to a specific date, in format
            yyyy-MM-dd
          format: date
          example: 2024-04-15
        grossAmount[eq]:
          type: number
          description: Gross amount equal to
          example: 12.25
        grossAmount[ne]:
          type: number
          description: Gross amount not equal
          example: 12.25
        grossAmount[gt]:
          type: number
          description: Gross amount greater than
          example: 12.25
        grossAmount[gte]:
          type: number
          description: Gross amount greater than or equal to
          example: 12.25
        grossAmount[lt]:
          type: number
          description: Gross amount less than
          example: 12.25
        grossAmount[lte]:
          type: number
          description: Gross amount less than or equal to
          example: 12.25
        payableAmount[eq]:
          type: number
          description: Payable amount equal to
          example: 12.25
        payableAmount[ne]:
          type: number
          description: Payable amount not equal
          example: 12.25
        payableAmount[gt]:
          type: number
          description: Payable amount greater than
          example: 12.25
        payableAmount[gte]:
          type: number
          description: Payable amount greater than or equal to
          example: 12.25
        payableAmount[lt]:
          type: number
          description: Payable amount less than
          example: 12.25
        payableAmount[lte]:
          type: number
          description: Payable amount less than or equal to
          example: 12.25
        netAmount[eq]:
          type: number
          description: Net amount equal to
          example: 12.25
        netAmount[ne]:
          type: number
          description: Net amount not equal
          example: 12.25
        netAmount[gt]:
          type: number
          description: Net amount greater than
          example: 12.25
        netAmount[gte]:
          type: number
          description: Net amount greater than or equal to
          example: 12.25
        netAmount[lt]:
          type: number
          description: Net amount less than
          example: 12.25
        netAmount[lte]:
          type: number
          description: Net amount less than or equal to
          example: 12.25
        vatAmount[eq]:
          type: number
          description: VAT amount equal to
          example: 12.25
        vatAmount[ne]:
          type: number
          description: VAT amount not equal
          example: 12.25
        vatAmount[gt]:
          type: number
          description: VAT amount greater than
          example: 12.25
        vatAmount[gte]:
          type: number
          description: VAT amount greater than or equal to
          example: 12.25
        vatAmount[lt]:
          type: number
          description: VAT amount less than
          example: 12.25
        vatAmount[lte]:
          type: number
          description: VAT amount less than or equal to
          example: 12.25
        tags[in]:
          type: string
          description: Filter documents that contain any of the specified comma-separated
            tags
          example: tag1,tag2
        tags[notIn]:
          type: string
          description: Exclude documents that contain any of the specified comma-separated
            tags
          example: tag1,tag2
        balanceOffsets.aggregationStatus:
          $ref: '#/components/schemas/AggregationStatus'
        description:
          type: string
          description: Description of document
          example: My invoice
        updatedAt[eq]:
          type: string
          description: Updated at equals specific timestamp, iso datetime format
          format: date-time
        updatedAt[ne]:
          type: string
          description: Updated at does not equal specific timestamp, iso datetime
            format
          format: date-time
        updatedAt[lt]:
          type: string
          description: Updated at is less than specific timestamp, iso datetime format
          format: date-time
        updatedAt[lte]:
          type: string
          description: Updated at is less or equal than specific timestamp, iso datetime
            format
          format: date-time
        updatedAt[gt]:
          type: string
          description: Updated at is greater than specific timestamp, iso datetime
            format
          format: date-time
        updatedAt[gte]:
          type: string
          description: Updated at is greater than specific timestamp, iso datetime
            format
          format: date-time
        addIncomplete:
          type: boolean
          description: Flag to include documents with status wait_for_complete in
            response. Default is that documents with wait_for_complete are excluded.
    DocumentInclude:
      type: string
      description: The possible linked resources to include
      example: lines
      enum:
      - lines
      - tasks
      - connections
      - timestamps
      - rawData
      - rawLines
      - processingData
      - validationData
      - customCategories
      - balanceOffsets
    MoveDocumentToDirectoryRequest:
      type: object
      properties:
        parentDirectoryId:
          type: string
          description: Parent directory identifier
          format: uuid
          example: 44d929f7-952d-4283-9010-8a63a16831b3
    DocumentPatchRequestV2:
      type: object
      properties:
        description:
          type: string
          description: Description of the document.
          nullable: true
          example: This is the invoice for your new phone
        source:
          type: string
          description: Source of the document.
          nullable: true
          example: choruspro
        metadata:
          $ref: '#/components/schemas/JsonBMapNullable'
        tags:
          type: array
          description: Document tags
          nullable: true
          example:
          - expensive
          items:
            type: string
        retentionTime:
          type: string
          description: Expiry datetime for the document
          nullable: true
        status:
          $ref: '#/components/schemas/JsonBMapNullable'
        folder:
          $ref: '#/components/schemas/FolderV2'
        category:
          $ref: '#/components/schemas/DocumentCategory'
        lines:
          type: array
          description: List of line data
          nullable: true
          items:
            $ref: '#/components/schemas/JsonBMap'
        connections:
          type: array
          description: List of connection data
          nullable: true
          items:
            $ref: '#/components/schemas/DocumentConnectionRequest'
        customCategories:
          type: object
          additionalProperties:
            uniqueItems: true
            type: array
            description: Custom categories to replace
            nullable: true
            example:
              purchases:
              - fuel
              - restaurant
            items:
              type: string
              description: Custom categories to replace
              nullable: true
              example: '{"purchases":["fuel","restaurant"]}'
          description: Custom categories to replace
          nullable: true
          example:
            purchases:
            - fuel
            - restaurant
        createdAt:
          type: string
          description: Date and time of the document creation, usable only for migration
            tools (with migration_service scope) to keep original creation time during
            data migration
          format: date-time
    ClientResultV2:
      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/Iso20022StructuredAddress'
          description: Addresses
          example:
            main:
              addressType: BIZZ
              streetName: Nitzsche Lodge
              buildingNumber: '80728'
              postCode: '3110'
              townName: Fernandahaven
              country: BE
              postBox: PO123
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        contacts:
          type: array
          description: List of contacts
          items:
            $ref: '#/components/schemas/ContactResult'
        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:
            $ref: '#/components/schemas/JsonBMap'
        myPermissions:
          type: array
          description: List of scopes the requesting subject has on this client resource
            (e.g. client_read, client_write)
          items:
            type: string
            example: client_read
    Iso20022StructuredAddress:
      type: object
      properties:
        country:
          type: string
          description: Nation with its own government, expressed as a two letter ISO
            3166 code (alpha-2) of the country. The country code is written in upper
            case.
          example: BE
        townName:
          type: string
          description: Name of a built-up area, with defined boundaries, and a local
            government.
          example: La Hulpe
        addressType:
          type: string
          description: Identifies the nature of the postal address.
          example: ADDR
          enum:
          - ADDR
          - PBOX
          - HOME
          - BIZZ
          - MLTO
          - DLVY
        streetName:
          maxLength: 140
          type: string
          description: Name of a street or thoroughfare.
          example: Avenue Reine Astrid
        buildingNumber:
          maxLength: 16
          type: string
          description: A unique number assigned to the building in the street or area
            //Number that identifies the position of a building on a street.
          example: '40'
        careOf:
          maxLength: 140
          type: string
          description: Identifies an addressee that is accepting the correspondence
            for the intended recipient. Using care of ensures the correspondence reaches
            the right recipient rather than getting returned to the sender.
          example: Finance
        department:
          maxLength: 70
          type: string
          description: Identification of a division of a large organisation or building.
          example: Finance
        subDepartment:
          maxLength: 70
          type: string
          description: Identification of a sub-division of a large organisation or
            building.
          example: Accounting
        buildingName:
          maxLength: 140
          type: string
          description: Name of the building or house.
          example: Empire State Building
        floor:
          maxLength: 70
          type: string
          description: Floor or storey within a building.
          example: ground
        unitNumber:
          maxLength: 16
          type: string
          description: Identifies a flat or dwelling within the building.
          example: '2'
        postBox:
          maxLength: 16
          type: string
          description: Numbered box in a post office, assigned to a person or organisation,
            where letters are kept until called for.
          example: '1003'
        room:
          maxLength: 70
          type: string
          description: Building room number.
          example: '2.22'
        postCode:
          maxLength: 16
          type: string
          description: Identifier consisting of a group of letters and/or numbers
            that is added to a postal address to assist the sorting of mail.
          example: '1310'
        townLocationName:
          maxLength: 140
          type: string
          description: Specific location name within the town. eg Borough (USA), Village
            (GB).
          example: Miami Beach
        districtName:
          maxLength: 140
          type: string
          description: Identifies a subdivision within a country sub-division eg County
            (USA), Landkreis (DE).
          example: Miami-Dade, Coburg
        countrySubDivision:
          maxLength: 35
          type: string
          description: Identifies a subdivision of a country such as state (USA),
            Bundesland (DE), region, province,....
          example: Florida, Bayern, Wallonia, Hainaut
      description: Information that locates and identifies a specific address, as
        defined by postal services
      example:
        main:
          addressType: BIZZ
          streetName: Nitzsche Lodge
          buildingNumber: '80728'
          postCode: '3110'
          townName: Fernandahaven
          country: BE
          postBox: PO123
      externalDocs:
        description: More about EPC Interbank Structured Address Structure; see also
          PostalAddress27 type in https://www.iso20022.org/message/22905/download
        url: https://www.europeanpaymentscouncil.eu/sites/default/files/kb/file/2022-10/EPC153-22%20EPC%20guidance%20document%20-%20Use%20of%20Structured%20Address%20under%20the%20SEPA%20Payment%20Schemes%20as%20of%20Nov%202025.pdf
    ClientRequestV2:
      type: object
      properties:
        name:
          type: string
          description: Client name
          example: Client A
        identifiers:
          $ref: '#/components/schemas/JsonBMap'
        addresses:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Iso20022StructuredAddress'
          description: Addresses
          example:
            main:
              addressType: BIZZ
              streetName: Nitzsche Lodge
              buildingNumber: '80728'
              postCode: '3110'
              townName: Fernandahaven
              country: BE
              postBox: PO123
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        contacts:
          type: array
          description: List of contacts
          items:
            $ref: '#/components/schemas/ContactRequest'
    ListClientsResponseV2:
      type: object
      properties:
        clients:
          type: array
          description: List of clients
          items:
            $ref: '#/components/schemas/ClientResultV2'
        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
    EntityForSpaceResultV2:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        countryCode:
          type: string
        description:
          type: string
        verified:
          type: boolean
        locale:
          type: string
        globalIdentifiers:
          type: object
          additionalProperties:
            type: object
        addresses:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Iso20022StructuredAddress'
        metadata:
          type: object
          additionalProperties:
            type: object
        settings:
          type: object
          additionalProperties:
            type: object
        tings:
          $ref: '#/components/schemas/EntityForSpaceResultV2'
    SpaceCommunicationDataDto:
      type: object
      properties:
        mobile:
          type: string
        email:
          type: string
        deviceId:
          type: string
        locale:
          type: string
    SpaceV2:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        type:
          type: string
          enum:
          - APPLICATION
          - BUSINESS
          - PERSONAL
          - PARTNER
        segment:
          type: string
          enum:
          - CONSUMER
          - CARETAKER_CLIENT
          - SME
          - CORPORATE
          - ACCOUNTING
          - RESELLER
          - CARETAKER
          - REFERRAL
          - SYSTEM_INTEGRATOR
        region:
          type: string
        description:
          type: string
        isDefault:
          type: boolean
        globalIdentifiers:
          type: object
          additionalProperties:
            type: object
        addresses:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Iso20022StructuredAddress'
        timestamps:
          $ref: '#/components/schemas/Timestamps'
        communicationData:
          $ref: '#/components/schemas/SpaceCommunicationDataDto'
        entity:
          $ref: '#/components/schemas/EntityForSpaceResultV2'
        paymentMetaData:
          type: object
          additionalProperties:
            type: object
    ClientPatchRequestV2:
      type: object
      properties:
        name:
          type: string
          description: Client name
          example: Client A
        identifiers:
          $ref: '#/components/schemas/JsonBMap'
        addresses:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Iso20022StructuredAddress'
          description: Addresses
          example:
            main:
              addressType: BIZZ
              streetName: Nitzsche Lodge
              buildingNumber: '80728'
              postCode: '3110'
              townName: Fernandahaven
              country: BE
              postBox: PO123
        metadata:
          $ref: '#/components/schemas/JsonBMap'
        contacts:
          type: array
          description: List of contacts
          items:
            $ref: '#/components/schemas/UpdateContactRequest'
        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
    ClientBulkAsyncCreationResponse:
      required:
      - clientRowResponses
      - total
      type: object
      properties:
        total:
          type: integer
          description: Number of clients
          format: int32
          example: 3
        clientRowResponses:
          type: array
          description: Client row imports list
          items:
            $ref: '#/components/schemas/ClientRowResponse'
    ClientRowResponse:
      required:
      - clientName
      - row
      type: object
      properties:
        row:
          type: string
          description: Client Row
          example: '1'
        clientName:
          type: string
          description: Client Name
          example: CLI-001
    ClientBulkImportRequest:
      required:
      - fileId
      - segment
      type: object
      properties:
        fileId:
          type: string
          description: The file identifier
          format: uuid
          example: 69f296a5-fb7e-47d8-a1de-bd528f0038b0
        rows:
          type: array
          description: Client rows import
          example:
          - '1'
          - '2'
          - '3'
          items:
            type: string
            description: Client rows import
            example: '["1","2","3"]'
        billing:
          type: object
          additionalProperties:
            type: object
            description: Default billing subscription
            example:
              plans: ''
              ownerSpaceId: d6a1eeef-882a-4595-9f6e-b97f90796ad9
              payForClients: ''
              customerGroups: ''
              partnerSpaceId: ''
              periodQuantity: 1
          description: Default billing subscription
          example:
            plans: ''
            ownerSpaceId: d6a1eeef-882a-4595-9f6e-b97f90796ad9
            payForClients: ''
            customerGroups: ''
            partnerSpaceId: ''
            periodQuantity: 1
        segment:
          type: string
          description: 'Space segment like CONSUMER, ACCOUNTING, RESELLER, REFERRAL,... '
          example: ACCOUNTING
    ClientBulkImportTemplateRequest:
      required:
      - segment
      type: object
      properties:
        country:
          type: string
          description: Space's country code
          example: BE
        segment:
          type: string
          description: 'Space segment like CONSUMER, ACCOUNTING, RESELLER, REFERRAL,... '
          example: ACCOUNTING
        locale:
          type: string
          description: Locale to request template excel file in user's language
          example: fr-BE
          default: en-GB
    ClientBulkInviteResponse:
      type: object
      properties:
        taskId:
          type: string
          description: Unique identifier for this scheduled task instance
          example: a71f1a08-a917-4715-b0c2-6179bbd36668
        total:
          type: integer
          description: Number of clients that will be processed asynchronously
          format: int32
          example: 5
    ClientBulkInviteRequest:
      required:
      - clientIds
      - invitationMessage
      type: object
      properties:
        sessionId:
          type: string
          description: Session ID of the user initiating the request
          example: sess-abc123
        clientIds:
          minItems: 1
          type: array
          description: List of client IDs to invite
          example:
          - f4c61a46-46c5-43a6-b8d0-014389bd8448
          items:
            type: string
            description: List of client IDs to invite
            example: '["f4c61a46-46c5-43a6-b8d0-014389bd8448"]'
        invitationMessage:
          minLength: 1
          type: string
          description: Message for bulk invitation
          example: I'd like to invite you to join Banqup
    BatchAssignExtensionResponse:
      type: object
      properties:
        taskId:
          type: string
          description: Unique identifier for this scheduled task instance
          example: a71f1a08-a917-4715-b0c2-6179bbd36668
        total:
          type: integer
          description: Number of clients that will be processed asynchronously
          format: int32
          example: 5
    BatchAssignExtensionRequest:
      required:
      - clientIds
      - extensionIds
      type: object
      properties:
        sessionId:
          type: string
          description: Session ID of the user initiating the request
          example: sess-abc123
        extensionIds:
          minItems: 1
          type: array
          description: List of extension IDs to assign to each client
          example:
          - f4c61a46-46c5-43a6-b8d0-014389bd8448
          items:
            type: string
            description: List of extension IDs to assign to each client
            example: '["f4c61a46-46c5-43a6-b8d0-014389bd8448"]'
        clientIds:
          minItems: 1
          type: array
          description: List of client IDs to assign the extensions to
          example:
          - 62df1ac3-dabe-4bbc-9642-58f72bb12ec6
          items:
            type: string
            description: List of client IDs to assign the extensions to
            example: '["62df1ac3-dabe-4bbc-9642-58f72bb12ec6"]'
    BatchAddTeamMemberResponse:
      type: object
      properties:
        taskId:
          type: string
          description: Unique identifier for this scheduled task instance
          example: a71f1a08-a917-4715-b0c2-6179bbd36668
        total:
          type: integer
          description: Number of clients that will be processed asynchronously
          format: int32
          example: 5
    BatchAddTeamMemberRequest:
      required:
      - clientIds
      - userIds
      type: object
      properties:
        clientIds:
          minItems: 1
          type: array
          description: List of client IDs to add the team members to
          example:
          - f4c61a46-46c5-43a6-b8d0-014389bd8448
          items:
            type: string
            description: List of client IDs to add the team members to
            example: '["f4c61a46-46c5-43a6-b8d0-014389bd8448"]'
        userIds:
          minItems: 1
          type: array
          description: List of user IDs to add as team members on each client
          example:
          - 62df1ac3-dabe-4bbc-9642-58f72bb12ec6
          items:
            type: string
            description: List of user IDs to add as team members on each client
            example: '["62df1ac3-dabe-4bbc-9642-58f72bb12ec6"]'
        sessionId:
          type: string
          description: Session ID of the user initiating the request
          example: sess-abc123
    MarkSpaceExtensionTemplateSettingAsDefaultRequest:
      type: object
      properties:
        name:
          type: string
          description: Name of template to be set as default
          example: template_A
    AddSpaceExtensionSettingRequest:
      type: object
      properties:
        name:
          type: string
          description: Template name
          example: Template A
        description:
          type: string
          description: Description of template
          example: A template use for...
        isDefaultTemplate:
          type: boolean
          description: Is default template
          example: true
          default: false
        value:
          $ref: '#/components/schemas/TemplateSetting'
    DefaultBillingSetting:
      type: object
      properties:
        plans:
          type: array
          description: Billing plans
          example:
          - plan1
          - plan2
          items:
            type: string
            description: Billing plans
            example: '["plan1","plan2"]'
        ownerSpaceId:
          type: string
          description: Owner spaceId
          example: b073a960-e85b-4400-af22-42ec5b15ed4d
        payForClients:
          type: boolean
          description: Is accountant pay for their client subscription
          example: true
        customerGroups:
          type: array
          description: Customer group
          example:
          - customer1
          - customer2
          items:
            type: string
            description: Customer group
            example: '["customer1","customer2"]'
        periodQuantity:
          type: integer
          description: Period quantity
          format: int32
          example: 3
        partnerSpaceId:
          type: string
          description: partner spaceId
          example: b073a960-e85b-4400-af22-42ec5b15ed4d
        promoCodes:
          type: array
          description: Promotion code
          example:
          - promoCode1
          - promoCode2
          items:
            type: string
            description: Promotion code
            example: '["promoCode1","promoCode2"]'
    TemplateSetting:
      type: object
      properties:
        accountingIntegrations:
          type: array
          description: Accounting integrations
          example:
          - f28494d1-579e-4371-be1c-b63926f943de
          - f28493d2-579e-4371-be1c-b63926f943de
          items:
            type: string
            description: Accounting integrations
            example: '["f28494d1-579e-4371-be1c-b63926f943de","f28493d2-579e-4371-be1c-b63926f943de"]'
        teamMembers:
          type: array
          description: Team members
          example:
          - f28494d1-579e-4371-be1c-b63926f943de
          - f28493d2-579e-4371-be1c-b63926f943de
          items:
            type: string
            description: Team members
            format: uuid
        billing:
          $ref: '#/components/schemas/DefaultBillingSetting'
        invitationMessage:
          pattern: ^[^<>]*$
          type: string
          description: Invitation message for client
          nullable: true
    BulkActivateClientExtensionResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Status of activate client extensions
          example: true
        message:
          type: string
          description: Error message in case create message for process activate client
            failed
          example: ''
    BulkActivateClientExtensionRequest:
      type: object
      properties:
        sessionId:
          pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
          description: The UX/UI session identifier. (A UUID specified by RFC4122)
          format: uuid
          example: 6ade8441-d9a8-4347-b6cd-2a8edd5ecf2c
        clientIds:
          type: array
          description: Client ids need to activate
          example:
          - 6ade8441-d9a8-4347-b6cd-2a8edd5ecf2c
          - 6ade8441-d9a8-4347-b6cd-2a8edd5ecf2c
          items:
            type: string
            description: Client ids need to activate
            format: uuid
    RetryPendingExtensionsResponse:
      type: object
      properties:
        tasks:
          type: array
          description: Scheduled task details per partner space
          items:
            $ref: '#/components/schemas/SpaceTaskResult'
        total:
          type: integer
          description: Total number of spaces scheduled for processing
          format: int32
          example: 3
    SpaceTaskResult:
      type: object
      properties:
        spaceId:
          type: string
          description: Partner space ID
          example: f4c61a46-46c5-43a6-b8d0-014389bd8448
        taskId:
          type: string
          description: Unique identifier for the scheduled task instance
          example: a71f1a08-a917-4715-b0c2-6179bbd36668
      description: Scheduled task details per partner space
    RetryPendingExtensionsRequest:
      required:
      - partnerSpaceIds
      type: object
      properties:
        partnerSpaceIds:
          minItems: 1
          type: array
          description: List of partner space IDs to process
          example:
          - f4c61a46-46c5-43a6-b8d0-014389bd8448
          items:
            type: string
            description: List of partner space IDs to process
            example: '["f4c61a46-46c5-43a6-b8d0-014389bd8448"]'
        delayBetweenClientsInSeconds:
          maximum: 15
          minimum: 0
          type: integer
          description: Optional delay in seconds between processing each client. Defaults
            to 6 seconds if omitted.
          format: int32
          example: 5
          default: 6
    RetryEvaluateMetadataResponse:
      type: object
      properties:
        status:
          type: string
          description: Status of execution
        summary:
          $ref: '#/components/schemas/RetryEvaluateMetadataSummaryResponse'
        failedClients:
          type: array
          description: List of clientId that failed
          items:
            type: string
            description: List of clientId that failed
    RetryEvaluateMetadataSummaryResponse:
      type: object
      properties:
        totalProcessed:
          type: integer
          description: Total client process
          format: int32
        successfulCount:
          type: integer
          description: Number client success
          format: int32
        failedCount:
          type: integer
          description: Number client failed
          format: int32
      description: Summary of execution
    RetryEvaluateDataRequest:
      type: object
      properties:
        spaceId:
          type: string
          description: Space id
          example: f4c61a46-46c5-43a6-b8d0-014389bd8448
        clientIds:
          type: array
          description: List of client IDs to re-evaluate
          example:
          - f4c61a46-46c5-43a6-b8d0-014389bd8448
          items:
            type: string
            description: List of client IDs to re-evaluate
            example: '["f4c61a46-46c5-43a6-b8d0-014389bd8448"]'
      description: List of data include spaceId and clientId need to be re-evaluate
    RetryEvaluateMetadataRequest:
      type: object
      properties:
        data:
          type: array
          description: List of data include spaceId and clientId need to be re-evaluate
          items:
            $ref: '#/components/schemas/RetryEvaluateDataRequest'
    DefaultBillingRequest:
      type: object
      properties:
        plans:
          type: array
          description: Billing plans
          example:
          - plan1
          - plan2
          items:
            type: string
            description: Billing plans
            example: '["plan1","plan2"]'
        ownerSpaceId:
          type: string
          description: Owner spaceId
          example: b073a960-e85b-4400-af22-42ec5b15ed4d
        payForClients:
          type: boolean
          description: Is accountant pay for their client subscription
          example: true
        customerGroups:
          type: array
          description: Customer group
          example:
          - customer1
          - customer2
          items:
            type: string
            description: Customer group
            example: '["customer1","customer2"]'
        periodQuantity:
          type: integer
          description: Period quantity
          format: int32
          example: 3
        partnerSpaceId:
          type: string
          description: partner spaceId
          example: b073a960-e85b-4400-af22-42ec5b15ed4d
    UpdateSpaceExtensionTemplateSettingRequest:
      type: object
      properties:
        name:
          type: string
          description: Template name
          example: Template A
        description:
          type: string
          description: Description of template
          example: A template use for...
        isDefaultTemplate:
          type: boolean
          description: Is default template
          example: true
          default: false
        value:
          $ref: '#/components/schemas/TemplateSetting'
    ClientBulkAsyncDeleteResponse:
      required:
      - bulkClientsDeleteGroupId
      - clientDeleteResponses
      - total
      type: object
      properties:
        bulkClientsDeleteGroupId:
          type: string
          description: A group id of bulk clients delete that is unique value for
            each bulk delete submit
          format: uuid
          example: a71f1a08-a917-4715-b0c2-6179bbd36668
        total:
          type: integer
          description: Total of clients
          format: int32
          example: 3
        clientDeleteResponses:
          type: array
          description: Bulk delete clients data response asynchronously
          items:
            $ref: '#/components/schemas/ClientDeleteResponse'
    ClientDeleteResponse:
      required:
      - clientName
      - ordinalNumber
      type: object
      properties:
        clientName:
          type: string
          description: Client Name
          example: CLI-001
        ordinalNumber:
          type: string
          description: Client Ordinal Number
          example: '1'
    ClientBulkDeleteRequest:
      required:
      - bulkDeleteClients
      type: object
      properties:
        bulkDeleteClients:
          uniqueItems: true
          type: array
          description: bulkDeleteClients is a set of bulk clients data that request
            to delete in bulk asynchronously.
          example:
            bulkDeleteClients:
            - clientId: f4c61a46-46c5-43a6-b8d0-014389bd8448
              clientName: Client DevTest1
              ordinalNumber: '1'
            - clientId: 3ec68398-a06e-48c3-99a6-ac7c84b0b571
              clientName: Client DevTest2
              ordinalNumber: '2'
          items:
            $ref: '#/components/schemas/ClientDeleteRequest'
    ClientDeleteRequest:
      required:
      - clientId
      - clientName
      - ordinalNumber
      type: object
      properties:
        clientId:
          type: string
          description: Client Id in UUID string format
          example: b85ad874-16b3-4565-be2f-4fd4ed7c8c72
        clientName:
          type: string
          description: Client Name
          example: CLI-001
        ordinalNumber:
          type: string
          description: Client Ordinal Number
          example: '1'
      description: bulkDeleteClients is a set of bulk clients data that request to
        delete in bulk asynchronously.
      example:
        bulkDeleteClients:
        - clientId: f4c61a46-46c5-43a6-b8d0-014389bd8448
          clientName: Client DevTest1
          ordinalNumber: '1'
        - clientId: 3ec68398-a06e-48c3-99a6-ac7c84b0b571
          clientName: Client DevTest2
          ordinalNumber: '2'
    ClientSpaceInvitationRequest:
      type: object
      properties:
        email:
          type: string
          minLength: 1
        firstName:
          type: string
          minLength: 1
        lastName:
          type: string
          minLength: 1
        locale:
          type: string
          minLength: 1
        message:
          type: string
          minLength: 1
        phoneNumber:
          type: string
      required:
      - email
      - firstName
      - lastName
      - locale
      - message
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.btx.fr.banqup.com/oauth2/client_credential/gettoken
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
        authorizationCode:
          authorizationUrl: https://api.btx.fr.banqup.com/oauth2/auth
          tokenUrl: https://api.btx.fr.banqup.com/oauth2/token
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
tags:
- name: Entities
  description: 'Entities are legal organizations (companies) or natural persons (private
    individuals)  that become part of the Banqup platform upon successful onboarding.

    Every entity in Banqup has a unique identifier, which will be needed to perform
    a number of API calls on the Banqup Developer Portal.'
  x-BTX:
    unDocumented: 'false'
    internal: 'false'
- name: Spaces
  description: "During the onboarding process of a Banqup entity, a first space is\
    \ created.  Spaces are virtual environments (work spaces) where all relevant resources\
    \ of an entity are managed.  Spaces can also facilitate document exchange and\
    \ communication among entities, depending on the space type.\nThe role of spaces\
    \ is to gather all relevant data of an entity into one accessible setting.  Such\
    \ data can include: invoices, connections, cards, clients, payments, users, installed\
    \ apps etc.  The capabilities offered by a space depends on the space type and\
    \ the active subscription. \nEvery space in Banqup has a unique identifier that\
    \ is needed when performing certain API calls on that space."
  x-BTX:
    unDocumented: 'false'
    internal: 'false'
- name: Public Directory
  description: "A Public Directory of all Entities registered on the BTX network.\
    \ \nThis set of APIs allows application to search for a company or his space and\
    \ get public available information."
  x-BTX:
    unDocumented: 'false'
    internal: 'false'
- name: Internal Onboarding
  description: 'This is a set of internal API call only intended to be used by BTX
    Onboarding service. They are restricted to ensure only verified information is
    stored on entities.

    The higher level public APIs create and update entities are provided by the BTX
    Onboarding service.'
  x-BTX:
    unDocumented: 'false'
    internal: 'true'
- name: Internal Billing
  description: 'This is a set of internal API call only intended to be used by BTX
    Billing service. They are restricted to ensure all subscription changes go through
    the BTX Billing service.

    The higher level public APIs for changing billing information are provided by
    the BTX Billing service.'
  x-BTX:
    unDocumented: 'false'
    internal: 'true'
- name: Internal Payments
  description: 'This is a set of internal API call only intended to be used by BTX
    Payments service. They are restricted to ensure all payment account operations
    go through the BTX Payments service.

    The higher level public APIs for add/changing payment accounts are provided by
    the BTX Payments service.'
  x-BTX:
    unDocumented: 'false'
    internal: 'true'
- name: Internal Banqup Store
  description: 'This is a set of internal API call only intended to be used by BTX
    Banqup Store service. They are restricted to ensure operations related to adding
    or changing space extensions go through the BTX Banqup Store services.

    The higher level public APIs for add/changing space extensions are provided by
    the BTX Banqup Store service.'
  x-BTX:
    unDocumented: 'false'
    internal: 'true'
- name: Internal Notification Service
  description: "This is a set of internal API call only intended to be used by BTX\
    \ Notification Service. They are restricted to ensure access to communication\
    \ data is limited to Notification Service. \nThe higher level public APIs for\
    \ notifying owners of space/entity will be provided by the BTX Notification service."
  x-BTX:
    unDocumented: 'false'
    internal: 'true'
- name: Internal
  description: This is a set of pure internal API.  It contains for example callback
    endpoints that get registered to receive messages.
  x-BTX:
    unDocumented: 'true'
    internal: 'true'
- name: Client
  description: Client APIs
- name: Extension
  description: Extension APIs
- name: Metadata
  description: Metadata APIs
security:
- oauth2: []
