openapi: 3.0.1
info:
  title: 'Partner service: API Specification'
  description: 'The Partner service: API Specification'
  version: 0.0.294
servers:
- description: Generated server url
  url: https://api.uat.btx.fr.banqup.com/partner
- description: Generated server url
  url: https://api.uat.btx.eu.banqup.com/partner
security:
- oauth2: []
tags:
- name: Client
  description: Client APIs
- name: Extension
  description: Extension APIs
paths:
  /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: []<br/> This Endpoint is part
        of: partner-service-api"
      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: []<br/>
        This Endpoint is part of: partner-service-api"
      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/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: []<br/> This Endpoint
        is part of: partner-service-api"
      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: []<br/> This Endpoint
        is part of: partner-service-api"
      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: []<br/> This
        Endpoint is part of: partner-service-api'
      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
  /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: []<br/> This Endpoint is part
        of: partner-service-api"
      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: []<br/> This Endpoint
        is part of: partner-service-api"
      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: []<br/> This Endpoint
        is part of: partner-service-api"
      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: []<br/> This Endpoint
        is part of: partner-service-api"
      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
components:
  schemas:
    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:
      - clientSheetName
      - headers
      - segment
      type: object
      properties:
        headers:
          type: object
          description: Client template headers
          example:
            legalName: Legal name *
            countryCode: Country (letter code) *
            email: Contact email *
            firstName: Contact first name *
            lastName: Contact last name *
            languageCode: Contact language (locale) *
            companyNumber: Company number
            vat: VAT
            externalReference: External reference
            iban: IBAN
            street: Street
            number: Number
            postbox: Postbox
            postalCode: Postal code
            city: Town/City
            mandate: Mandate
            template: Template
        clientSheetName:
          type: string
          description: Client sheet name
          example: client
        country:
          type: string
          description: Space's country code
          example: BE
        segment:
          type: string
          description: 'Space segment like CONSUMER, ACCOUNTING, RESELLER, REFERRAL,... '
          example: ACCOUNTING
    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:
          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
    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'
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.uat.btx.fr.banqup.com/oauth2/client_credential/gettoken
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
        authorizationCode:
          authorizationUrl: https://api.uat.btx.fr.banqup.com/oauth2/auth
          tokenUrl: https://api.uat.btx.fr.banqup.com/oauth2/token
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
