openapi: 3.1.0
info:
  title: AbaNinja Products API - Suppliers
  version: 3.0.0
  x-domain-id: products
servers:
  - url: https://api.abaninja.ch
    description: The AbaNinja API server
tags:
  - name: product-suppliers
    description: Manage product suppliers
    x-displayName: Product Suppliers
security:
  - ApiToken: []
paths:
  /accounts/{accountUuid}/products/{productUuid}/suppliers/{supplierUuid}:
    delete:
      tags:
        - product-suppliers
      summary: Delete supplier
      description: Deletes a supplier of a product
      operationId: products_delete_suppliers
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: productUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: supplierUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      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
        '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
      x-legacy-operation-id: b57e0568a5ea730549fd0758a8471c07
      x-required-scopes:
        - products
  /accounts/{accountUuid}/products/v2/products/{productUuid}/suppliers:
    get:
      tags:
        - product-suppliers
      summary: Get suppliers
      description: Get product suppliers
      operationId: products_list_suppliers
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: productUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      title: Product Supplier Resource
                      properties:
                        uuid:
                          type: string
                          format: uuid
                        id:
                          type: integer
                          format: int64
                          deprecated: true
                        addressUuid:
                          type: string
                          format: uuid
                        addressId:
                          type: integer
                          format: int64
                          deprecated: true
                        name:
                          description: Name of the address
                          type: string
                        productCode:
                          type:
                            - string
                            - 'null'
                        productName:
                          type:
                            - string
                            - 'null'
                        contactName:
                          type:
                            - string
                            - 'null'
                        contactUuid:
                          type:
                            - string
                            - 'null'
                          format: uuid
                        contactId:
                          type:
                            - integer
                            - 'null'
                          format: int64
                          deprecated: true
                      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/products
      x-legacy-operation-id: 297e90349ac8247f244037d9ab3921de
      x-required-scopes:
        - products
    post:
      tags:
        - product-suppliers
      summary: Create supplier
      description: Create a product supplier
      operationId: products_create_suppliers
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: productUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Product supplier body
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: https://api.abaninja.ch/schemas/2.0.0/product-supplier.schema.json
              description: A Schema for create/update product supplier in AbaNinja over API
              type: object
              properties:
                addressUuid:
                  type: string
                  format: uuid
                personUuid:
                  type: string
                  format: uuid
                contactUuid:
                  type:
                    - 'null'
                    - string
                  format: uuid
                productCode:
                  type:
                    - 'null'
                    - string
                  maxLength: 255
                productName:
                  type: string
                  maxLength: 255
              required:
                - addressUuid
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: Product Supplier Resource
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      id:
                        type: integer
                        format: int64
                        deprecated: true
                      addressUuid:
                        type: string
                        format: uuid
                      addressId:
                        type: integer
                        format: int64
                        deprecated: true
                      name:
                        description: Name of the address
                        type: string
                      productCode:
                        type:
                          - string
                          - 'null'
                      productName:
                        type:
                          - string
                          - 'null'
                      contactName:
                        type:
                          - string
                          - 'null'
                      contactUuid:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      contactId:
                        type:
                          - integer
                          - 'null'
                        format: int64
                        deprecated: true
                    type: object
                  message:
                    title: message
                    type: string
                  status:
                    example: 201
                  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/products
      x-legacy-operation-id: 4dbb6d352ff548d64bf6669179b8f6e0
      x-required-scopes:
        - products
  /accounts/{accountUuid}/products/v2/products/{productUuid}/suppliers/{supplierUuid}:
    get:
      tags:
        - product-suppliers
      summary: Get supplier
      description: Get a single product suppliers
      operationId: products_get_suppliers
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: productUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: supplierUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: Product Supplier Resource
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      id:
                        type: integer
                        format: int64
                        deprecated: true
                      addressUuid:
                        type: string
                        format: uuid
                      addressId:
                        type: integer
                        format: int64
                        deprecated: true
                      name:
                        description: Name of the address
                        type: string
                      productCode:
                        type:
                          - string
                          - 'null'
                      productName:
                        type:
                          - string
                          - 'null'
                      contactName:
                        type:
                          - string
                          - 'null'
                      contactUuid:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      contactId:
                        type:
                          - integer
                          - 'null'
                        format: int64
                        deprecated: true
                    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
      x-legacy-operation-id: 609b660395b406b75cd1716bdcc3ff24
      x-required-scopes:
        - products
    patch:
      tags:
        - product-suppliers
      summary: Update supplier
      description: Update a product supplier
      operationId: products_update_suppliers
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: productUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: supplierUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Product supplier body
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: https://api.abaninja.ch/schemas/2.0.0/product-supplier.schema.json
              description: A Schema for create/update product supplier in AbaNinja over API
              type: object
              properties:
                addressUuid:
                  type: string
                  format: uuid
                personUuid:
                  type: string
                  format: uuid
                contactUuid:
                  type:
                    - 'null'
                    - string
                  format: uuid
                productCode:
                  type:
                    - 'null'
                    - string
                  maxLength: 255
                productName:
                  type: string
                  maxLength: 255
              required:
                - addressUuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: Product Supplier Resource
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      id:
                        type: integer
                        format: int64
                        deprecated: true
                      addressUuid:
                        type: string
                        format: uuid
                      addressId:
                        type: integer
                        format: int64
                        deprecated: true
                      name:
                        description: Name of the address
                        type: string
                      productCode:
                        type:
                          - string
                          - 'null'
                      productName:
                        type:
                          - string
                          - 'null'
                      contactName:
                        type:
                          - string
                          - 'null'
                      contactUuid:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      contactId:
                        type:
                          - integer
                          - 'null'
                        format: int64
                        deprecated: true
                    type: object
                  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
        '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
      x-legacy-operation-id: 2a3c781d260221281dea27298eda0a33
      x-required-scopes:
        - products
components:
  securitySchemes:
    ApiToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication. Create tokens in Settings > API Token.
