openapi: 3.0.1
info:
  description: The KSeF Connector API
  title: KSeF Connector API
  version: 1.6.0-SNAPSHOT
servers:
- description: Generated server url
  url: https://api.cve.btx.eu.banqup.com/connectors/ksef
security:
- oauth2: []
paths:
  /ksef/v1/spaces/connectors/ksef/documents:processFeedback:
    post:
      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/> Accepts raw XML content containing UPD feedback (either Delivery Feedback
        or Batch Feedback) and processes it. <br/> Scope: []<br/> This Endpoint is
        part of: connectors-ksef <br/> Scope: []<br/> This Endpoint is part of: connectors-ksef"
      operationId: processUpdFeedback
      requestBody:
        content:
          application/xml:
            schema:
              type: string
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeppolMessageResult'
          description: Accepted - The feedback received and is being processed.
        '400':
          content:
            application/json: {}
          description: Bad Request - Invalid XML format.
        '422':
          content:
            application/json: {}
          description: Unprocessable Entity - Invalid feedback type or content.
      summary: Process UPD feedback
      tags:
      - KSeF Connector API
  /ksef/v1/spaces/connectors/ksef/documents:send:
    post:
      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/> Accepts a request containing a space ID and a list of document IDs for
        processing. Processes each document and returns a response with the status
        of each document processed. <br/> Scope: []<br/> This Endpoint is part of:
        connectors-ksef <br/> Scope: []<br/> This Endpoint is part of: connectors-ksef"
      operationId: sendDocument
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PeppolDocumentSendRequest'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeppolMessageResult'
          description: Accepted - The request has been accepted for processing.
        '400':
          content:
            application/json: {}
          description: Bad Request - Invalid input data.
      summary: Send KSeF documents for processing with UP Delivery
      tags:
      - KSeF Connector API
  /ksef/v1/spaces/connectors/ksef:activate:
    post:
      description: 'Activate an extension <br/> Scope: []<br/> This Endpoint is part
        of: connectors-ksef <br/> Scope: []<br/> This Endpoint is part of: connectors-ksef'
      operationId: activateExtension
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtensionActivateRequest'
        required: true
      responses:
        '200':
          description: Extension activated successfully
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Bad Request - Invalid input data
      summary: Activate extension
      tags:
      - KSeF Connector Extension callbacks
      x-BTX KSeF Connector:
        unDocumented: 'true'
  /ksef/v1/spaces/connectors/ksef:add:
    post:
      description: 'Add a new extension <br/> Scope: []<br/> This Endpoint is part
        of: connectors-ksef <br/> Scope: []<br/> This Endpoint is part of: connectors-ksef'
      operationId: addExtension
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtensionAddRequest'
        required: true
      responses:
        '200':
          description: OK
      summary: Add extension
      tags:
      - KSeF Connector Extension callbacks
      x-BTX KSeF Connector:
        internal: 'true'
        unDocumented: 'true'
  /ksef/v1/spaces/connectors/ksef:configure:
    post:
      description: 'Configure extension <br/> Scope: []<br/> This Endpoint is part
        of: connectors-ksef <br/> Scope: []<br/> This Endpoint is part of: connectors-ksef'
      operationId: configureExtension
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfigureExtensionRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtensionUpdateConfigureResult'
          description: OK
      summary: Configure extension
      tags:
      - KSeF Connector Extension callbacks
      x-BTX KSeF Connector:
        internal: 'true'
        unDocumented: 'true'
  /ksef/v1/spaces/connectors/ksef:deactivate:
    post:
      description: 'Deactivate an extension <br/> Scope: []<br/> This Endpoint is
        part of: connectors-ksef <br/> Scope: []<br/> This Endpoint is part of: connectors-ksef'
      operationId: deactivateExtension
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtensionDeactivateRequest'
        required: true
      responses:
        '200':
          description: Extension deactivated successfully
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Bad Request - Invalid input data
      summary: Deactivate extension
      tags:
      - KSeF Connector Extension callbacks
      x-BTX KSeF Connector:
        internal: 'true'
        unDocumented: 'true'
  /ksef/v1/spaces/connectors/ksef:directorySearch:
    post:
      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/> Return search result from KSeF Connector <br/> Scope: space_read<br/>
        This Endpoint is part of: connectors-ksef <br/> Scope: space_read<br/> This
        Endpoint is part of: connectors-ksef"
      operationId: directorySearch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KSeFDirectorySearchRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PeppolSearchResponse'
          description: Accepted - The request has been accepted for processing.
        '400':
          content:
            application/json: {}
          description: Bad Request - Invalid input data.
      security:
      - oauth2:
        - space_read
      summary: KSeF Connector Directory Search
      tags:
      - KSeF Connector API
  /ksef/v1/spaces/connectors/ksef:remove:
    post:
      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 an extension <br/> Scope: []<br/> This Endpoint is part of: connectors-ksef
        <br/> Scope: []<br/> This Endpoint is part of: connectors-ksef"
      operationId: deleteExtension
      responses:
        '200':
          description: OK
      summary: Delete extension
      tags:
      - KSeF Connector Extension callbacks
components:
  schemas:
    ConfigureExtensionRequest:
      type: object
      properties:
        entityId:
          type: string
          format: uuid
        extensionId:
          type: string
          format: uuid
        name:
          type: string
        namespace:
          type: string
        settings:
          $ref: '#/components/schemas/ConnectorConfigurationSettings'
        spaceId:
          type: string
          format: uuid
      required:
      - entityId
      - extensionId
      - name
      - namespace
      - spaceId
    ConnectorConfigurationSettings:
      type: object
    ExtensionActivateRequest:
      type: object
      properties:
        entityId:
          type: string
          format: uuid
        extensionId:
          type: string
          format: uuid
        name:
          type: string
        namespace:
          type: string
        spaceId:
          type: string
          format: uuid
      required:
      - entityId
      - extensionId
      - name
      - namespace
      - spaceId
    ExtensionAddRequest:
      type: object
      properties:
        entityId:
          type: string
          format: uuid
        extensionId:
          type: string
          format: uuid
        spaceId:
          type: string
          format: uuid
      required:
      - entityId
      - extensionId
      - spaceId
    ExtensionDeactivateRequest:
      type: object
      properties:
        entityId:
          type: string
          format: uuid
        extensionId:
          type: string
          format: uuid
        name:
          type: string
        namespace:
          type: string
        spaceId:
          type: string
          format: uuid
      required:
      - entityId
      - extensionId
      - name
      - namespace
      - spaceId
    ExtensionUpdateConfigureDetailResult:
      type: object
      properties:
        enabled:
          type: boolean
        identifier:
          type: string
        message:
          type: string
        success:
          type: boolean
    ExtensionUpdateConfigureResult:
      type: object
      properties:
        details:
          type: array
          items:
            $ref: '#/components/schemas/ExtensionUpdateConfigureDetailResult'
        totalFailure:
          type: integer
          format: int64
        totalSuccess:
          type: integer
          format: int64
    KSeFDirectorySearchRequest:
      type: object
      properties:
        spaceId:
          type: string
          format: uuid
      required:
      - spaceId
    PeppolDocumentSendRequest:
      type: object
      properties:
        documentIds:
          type: array
          items:
            type: string
            format: uuid
        spaceId:
          type: string
          format: uuid
      required:
      - documentIds
      - spaceId
    PeppolMessageResult:
      type: object
      properties:
        message:
          type: string
        messageId:
          type: string
    PeppolSearchDocumentType:
      type: object
      properties:
        scheme:
          type: string
        value:
          type: string
    PeppolSearchParticipantId:
      type: object
      properties:
        scheme:
          type: string
        value:
          type: string
    PeppolSearchResponse:
      type: object
      properties:
        name:
          type: string
        settings:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/PeppolSearchSetting'
    PeppolSearchSetting:
      type: object
      properties:
        docTypes:
          type: array
          items:
            $ref: '#/components/schemas/PeppolSearchDocumentType'
        participantId:
          $ref: '#/components/schemas/PeppolSearchParticipantId'
    ProblemDetail:
      type: object
      properties:
        detail:
          type: string
        instance:
          type: string
          format: uri
        properties:
          type: object
          additionalProperties:
            type: object
        status:
          type: integer
          format: int32
        title:
          type: string
        type:
          type: string
          format: uri
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.cve.btx.eu.banqup.com/oauth2/client_credential/gettoken
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
        authorizationCode:
          authorizationUrl: https://api.cve.btx.eu.banqup.com/oauth2/auth
          tokenUrl: https://api.cve.btx.eu.banqup.com/oauth2/token
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
