openapi: 3.1.0
info:
  title: AbaNinja Units API - System units
  version: 3.0.0
  x-domain-id: units
servers:
  - url: https://api.abaninja.ch
    description: The AbaNinja API server
tags:
  - name: system-units
    description: Manage system units
    x-displayName: System Units
security:
  - ApiToken: []
paths:
  /accounts/{accountUuid}/units/v2/system-units:
    get:
      tags:
        - system-units
      summary: Get system units
      description: Get the system units
      operationId: units_list_system_units
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: page
          in: query
          schema:
            type:
              - integer
              - 'null'
            default: 1
            minimum: 1
        - name: perPage
          in: query
          schema:
            type:
              - integer
              - 'null'
            minimum: 1
        - name: search
          in: query
          required: false
          schema:
            description: search for system units
            type: string
            maxLength: 255
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      title: System Unit Resource
                      properties:
                        uuid:
                          type: string
                          format: uuid
                        unitCode:
                          type: string
                        unitCodeStandardized:
                          description: UN/ECE Rec20/21 compatible unit code, can differ to ensure standard compatibility
                          type: string
                        translations:
                          properties:
                            de:
                              properties:
                                unit:
                                  type: string
                                unitPlural:
                                  type:
                                    - string
                                    - 'null'
                                unitDescription:
                                  type: string
                              type: object
                            en:
                              properties:
                                unit:
                                  type: string
                                unitPlural:
                                  type:
                                    - string
                                    - 'null'
                                unitDescription:
                                  type: string
                              type: object
                            fr:
                              properties:
                                unit:
                                  type: string
                                unitPlural:
                                  type:
                                    - string
                                    - 'null'
                                unitDescription:
                                  type: string
                              type: object
                            it:
                              properties:
                                unit:
                                  type: string
                                unitPlural:
                                  type:
                                    - string
                                    - 'null'
                                unitDescription:
                                  type: string
                              type: object
                          type: object
                      type: object
                  message:
                    title: message
                    type: string
                  status:
                    example: 200
                  meta:
                    properties:
                      pagination:
                        properties:
                          currentPage:
                            type: integer
                            minimum: 1
                          firstPageUrl:
                            type:
                              - string
                              - 'null'
                            format: uri
                          from:
                            type:
                              - integer
                              - 'null'
                            example: 1
                          lastPage:
                            type: integer
                          lastPageUrl:
                            type: string
                            format: uri
                          nextPageUrl:
                            type:
                              - string
                              - 'null'
                            format: uri
                          perPage:
                            type: integer
                            example: 50
                          previousPageUrl:
                            type:
                              - string
                              - 'null'
                            format: uri
                          to:
                            type:
                              - integer
                              - 'null'
                            example: 50
                          totalItems:
                            type: integer
                        type: object
                    type: object
                required:
                  - data
                  - message
                  - status
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/products
            - https://api.abaninja.ch/auth/settings
      x-legacy-operation-id: 7ee815ca8ccc388272e3945b48ad5eec
      x-required-scopes:
        - products
        - settings
  /accounts/{accountUuid}/units/v2/system-units/{systemUnitUuid}:
    get:
      tags:
        - system-units
      summary: Get system unit
      description: Get a system unit
      operationId: units_get_system_units
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: systemUnitUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: System Unit Resource
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      unitCode:
                        type: string
                      unitCodeStandardized:
                        description: UN/ECE Rec20/21 compatible unit code, can differ to ensure standard compatibility
                        type: string
                      translations:
                        properties:
                          de:
                            properties:
                              unit:
                                type: string
                              unitPlural:
                                type:
                                  - string
                                  - 'null'
                              unitDescription:
                                type: string
                            type: object
                          en:
                            properties:
                              unit:
                                type: string
                              unitPlural:
                                type:
                                  - string
                                  - 'null'
                              unitDescription:
                                type: string
                            type: object
                          fr:
                            properties:
                              unit:
                                type: string
                              unitPlural:
                                type:
                                  - string
                                  - 'null'
                              unitDescription:
                                type: string
                            type: object
                          it:
                            properties:
                              unit:
                                type: string
                              unitPlural:
                                type:
                                  - string
                                  - 'null'
                              unitDescription:
                                type: string
                            type: object
                        type: object
                    type: object
                  message:
                    title: message
                    type: string
                  status:
                    example: 200
                  meta:
                    title: meta
                    type:
                      - object
                      - 'null'
                required:
                  - data
                  - message
                  - status
        '404':
          description: Resource not found
          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/products
            - https://api.abaninja.ch/auth/settings
      x-legacy-operation-id: 33a922b516b0b326f2b22b1ea97286bb
      x-required-scopes:
        - products
        - settings
components:
  securitySchemes:
    ApiToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication. Create tokens in Settings > API Token.
