openapi: 3.1.0
info:
  title: AbaNinja Accounts API - Accounts
  version: 3.0.0
  x-domain-id: accounts
servers:
  - url: https://api.abaninja.ch
    description: The AbaNinja API server
tags:
  - name: accounts
    description: Manage accounts
    x-displayName: Accounts
security:
  - ApiToken: []
paths:
  /accounts/v2/accounts/{accountUuid}:
    get:
      tags:
        - accounts
      summary: Get account
      description: Get account information
      operationId: accounts_get_accounts
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: Account Resource
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      name:
                        type: string
                      email:
                        type: string
                        format: email
                      type:
                        type: string
                        enum:
                          - SWISS21
                          - NINJABOX
                          - STR
                      locale:
                        type: string
                        enum:
                          - de
                          - en
                          - fr
                          - it
                      currencyCode:
                        type: string
                        format: iso-4217
                        maxLength: 3
                        minLength: 3
                      lastLogin:
                        type:
                          - string
                          - 'null'
                        format: date-time
                      hasLogo:
                        type: boolean
                      isInitialized:
                        description: shows if the account is finished setting up
                        type: boolean
                      industryCode:
                        description: NOGA code
                        type:
                          - string
                          - 'null'
                      companyKindCode:
                        type:
                          - string
                          - 'null'
                        enum:
                          - TRADE
                          - PRODUCTION
                          - SERVICE
                          - PRIVATE
                      legalFormCode:
                        type:
                          - string
                          - 'null'
                        enum:
                          - SOLE_PROPRIETORSHIP
                          - GENERAL_PARTNERSHIP
                          - LIMITED_PARTNERSHIP
                          - LIMITED_COMPANY
                          - LIMITED_LIABILITY_COMPANY
                          - ASSOCIATION
                      language:
                        type: string
                        enum:
                          - de
                          - en
                          - fr
                          - it
                    type: object
                  message:
                    title: message
                    type: string
                  status:
                    example: 200
                  meta:
                    title: meta
                    type:
                      - object
                      - 'null'
                required:
                  - data
                  - message
                  - status
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/accounts
            - https://api.abaninja.ch/auth/profile
            - https://api.abaninja.ch/auth/settings
      x-legacy-operation-id: bd9ba82ee57865ab384ee4fb21b8e543
      x-required-scopes:
        - accounts
        - profile
        - settings
  /accounts/v2/accounts/{accountUuid}/logo:
    get:
      tags:
        - accounts
      summary: Get logo
      description: Get the account logo
      operationId: accounts_list_logo
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          headers:
            Content-Type:
              schema:
                type: string
                enum:
                  - image/jpeg
            Content-Length:
              schema:
                type: integer
          content:
            image/jpeg:
              schema:
                type: string
                format: binary
        '404':
          description: No logo available
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/accounts
            - https://api.abaninja.ch/auth/profile
            - https://api.abaninja.ch/auth/settings
      x-legacy-operation-id: 7a12d935a96a3ba786fe1894c513df30
      x-required-scopes:
        - accounts
        - profile
        - settings
    post:
      tags:
        - accounts
      summary: Upload logo
      description: Upload a new account logo
      operationId: accounts_create_logo
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              required:
                - logo
              properties:
                logo:
                  type: string
                  format: binary
              type: object
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data: {}
                  message:
                    title: message
                    type: string
                  status:
                    example: 200
                  meta:
                    title: meta
                    type:
                      - object
                      - 'null'
                required:
                  - data
                  - message
                  - status
        '400':
          description: Bad request or validation error
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/accounts
            - https://api.abaninja.ch/auth/profile
            - https://api.abaninja.ch/auth/settings
      x-legacy-operation-id: 6e0c998e1a3ecfab6bafadd6aac8c945
      x-required-scopes:
        - accounts
        - profile
        - settings
components:
  securitySchemes:
    ApiToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication. Create tokens in Settings > API Token.
