openapi: 3.0.0
info:
  title: Products API
  contact:
    name: API Integration Support
    email: integration@dintero.com
  description: |
    # Changelog
    All notable changes to the API.

    ## 2020-05-01

    > Initial version
    > - [POST /products](/#tag/products)
  version: LATEST
  license:
    name: UNLICENSED
    url: https://dintero.com
  x-logo:
    url: https://docs.dintero.com/img/dintero-dark-padded.svg
security:
  - JWT: []
paths:
  /accounts/{aid}/products/catalogs:
    get:
      operationId: aid_catalogs_get
      summary: aid_catalogs_get
      description: |
        Get catalogs from account based on query parameters

        scopes:
          - admin:products
          - write:products
          - read:products
      x-scopes:
        - admin:products
        - write:products
        - read:products
      tags:
        - catalogs
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
      responses:
        '200':
          description: Catalog collection
          content:
            application/json:
              schema:
                type: object
                properties:
                  catalogs:
                    type: array
                    items:
                      allOf:
                        - $ref: '#/components/schemas/Catalog'
                        - $ref: '#/components/schemas/Entity'
                  starting_after:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Catalogs collection
          sidebarTitle: Catalogs collection
    post:
      operationId: aid_catalogs_post
      summary: aid_catalogs_post
      description: |
        Create a new product catalog

        scopes:
          - admin:products
          - write:products
      x-scopes:
        - admin:products
        - write:products
      tags:
        - catalogs
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    catalog_id:
                      type: string
                      maxLength: 255
                      description: >
                        The id you have defined for the catalog.

                        (must not have trailing or leading spaces). An

                        auto-generated catalog_id will be created if no
                        catalog_id

                        is provided
                      example: SK33
                      readOnly: false
                - $ref: '#/components/schemas/Catalog'
        description: catalogs
        required: true
      responses:
        '200':
          description: Catalog created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Catalog'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new catalog
          sidebarTitle: Create new catalog
  /accounts/{aid}/products/catalogs/{catalog_id}:
    put:
      operationId: aid_catalogs_put
      summary: aid_catalogs_put
      description: |
        Update an existing catalog

        scopes:
          - admin:products
          - write:products
      x-scopes:
        - admin:products
        - write:products
      tags:
        - catalogs
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/catalogId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Catalog'
        description: catalog
        required: true
      responses:
        '200':
          description: Catalog updated
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Catalog'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update catalog
          sidebarTitle: Update catalog
    delete:
      operationId: aid_catalogs_delete
      summary: aid_catalogs_delete
      description: |
        Delete catalog and all corresponding products

        scopes:
          - admin:products
          - write:products
      x-scopes:
        - admin:products
        - write:products
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/catalogId'
      tags:
        - catalogs
      security:
        - JWT: []
      responses:
        '200':
          description: Catalog deleted
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Catalog'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete catalog
          sidebarTitle: Delete catalog
  /accounts/{aid}/products/catalogs/{catalog_id}/products:
    get:
      operationId: aid_products_get
      summary: aid_products_get
      description: |
        Get products in a catalog based on query parameters

        scopes:
          - admin:products
          - write:products
          - read:products
      x-scopes:
        - admin:products
        - write:products
        - read:products
      tags:
        - products
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/catalogId'
        - $ref: '#/components/parameters/productId'
        - $ref: '#/components/parameters/product_name'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
      responses:
        '200':
          description: Product collection
          content:
            application/json:
              schema:
                type: object
                properties:
                  products:
                    type: array
                    items:
                      allOf:
                        - $ref: '#/components/schemas/ProductResponse'
                        - properties:
                            groups:
                              type: array
                              items:
                                $ref: '#/components/schemas/Group'
                  starting_after:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Products collection
          sidebarTitle: Products collection
    post:
      operationId: aid_products_post
      summary: aid_products_post
      description: |
        Create a new product

        scopes:
          - admin:products
          - write:products
      x-scopes:
        - admin:products
        - write:products
      tags:
        - products
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/catalogId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductPost'
        description: product to create
        required: true
      responses:
        '200':
          description: Product created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ProductResponse'
                  - properties:
                      groups:
                        type: array
                        items:
                          $ref: '#/components/schemas/Group'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new product
          sidebarTitle: Create new product
  /accounts/{aid}/products/catalogs/{catalog_id}/products/{product_id}:
    put:
      operationId: aid_products_put
      summary: aid_products_put
      description: |
        Update an existing product

        scopes:
          - admin:products
          - write:products
      x-scopes:
        - admin:products
        - write:products
      tags:
        - products
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/catalogId'
        - $ref: '#/components/parameters/product_id'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Product'
        description: products
        required: true
      responses:
        '200':
          description: Product updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update product
          sidebarTitle: Update product
    delete:
      operationId: aid_catalog_id_product_delete
      summary: aid_catalog_id_product_delete
      description: |
        Delete product in a given catalog

        scopes:
          - admin:products
          - write:products
      x-scopes:
        - admin:products
        - write:products
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/catalogId'
        - $ref: '#/components/parameters/product_id'
      tags:
        - products
      responses:
        '200':
          description: Product deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete product
          sidebarTitle: Delete product
  /accounts/{aid}/products/groups:
    get:
      operationId: aid_group_get
      summary: aid_group_get
      description: |
        Lists all groups
      x-scopes:
        - admin:products
        - write:products
      tags:
        - groups
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/group_id_query'
      responses:
        '200':
          description: Group collection
          content:
            application/json:
              schema:
                type: object
                properties:
                  groups:
                    type: array
                    items:
                      allOf:
                        - $ref: '#/components/schemas/Entity'
                        - $ref: '#/components/schemas/Group'
                  starting_after:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Group collection
          sidebarTitle: Group collection
    post:
      operationId: aid_group_post
      summary: aid_group_post
      description: |
        Insert a new group
      x-scopes:
        - admin:products
        - write:products
      tags:
        - groups
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    group_id:
                      type: string
                      maxLength: 255
                      description: >
                        The id you have defined for the group (must not have
                        training or leading spaces). An auto-generated group_id
                        will be created if not provided
                      example: b1
                      readOnly: false
                - $ref: '#/components/schemas/Group'
        description: group
        required: true
      responses:
        '200':
          description: Group created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Group'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new group
          sidebarTitle: Create new group
  /accounts/{aid}/products/groups/{group_id}:
    put:
      operationId: aid_group_put
      summary: aid_group_put
      description: |
        Update an existing group
      x-scopes:
        - admin:products
        - write:products
      tags:
        - groups
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/groupId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Group'
        description: group
        required: true
      responses:
        '200':
          description: Group updated
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Group'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update group
          sidebarTitle: Update group
    delete:
      operationId: aid_delete
      summary: aid_delete
      description: |
        Delete an existing group
      x-scopes:
        - admin:products
        - write:products
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/groupId'
      tags:
        - groups
      security:
        - JWT: []
      responses:
        '200':
          description: Group deleted
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Group'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete group
          sidebarTitle: Delete group
  /accounts/{aid}/products/tax:
    get:
      operationId: aid_tax_get
      summary: aid_tax_get
      description: |
        Lists all taxgroups
      x-scopes:
        - admin:products
        - write:products
      tags:
        - tax
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
      responses:
        '200':
          description: Taxgroup collection
          content:
            application/json:
              schema:
                type: object
                properties:
                  tax_groups:
                    type: array
                    items:
                      allOf:
                        - $ref: '#/components/schemas/Entity'
                        - $ref: '#/components/schemas/TaxGroup'
                  starting_after:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Taxgroup collection
          sidebarTitle: Taxgroup collection
    post:
      operationId: aid_tax_post
      summary: aid_tax_post
      description: |
        Insert a new taxgroup
      x-scopes:
        - admin:products
        - write:products
      tags:
        - tax
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    tax_id:
                      type: string
                      maxLength: 255
                      description: >
                        The id you have defined for the taxgroup (must not have
                        training or leading spaces). An auto-generated tax_id
                        will be created if not provided
                      example: vmva1
                      readOnly: false
                - $ref: '#/components/schemas/TaxGroup'
        description: tax_group
        required: true
      responses:
        '200':
          description: Taxgroup created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/TaxGroup'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new taxgroup
          sidebarTitle: Create new taxgroup
  /accounts/{aid}/products/tax/{tax_id}:
    put:
      operationId: aid_tax_put
      summary: aid_tax_put
      description: |
        Update an existing taxgroup
      x-scopes:
        - admin:products
        - write:products
      tags:
        - tax
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/taxId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaxGroup'
        description: tax_group
        required: true
      responses:
        '200':
          description: Taxgroup updated
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/TaxGroup'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update taxgroup
          sidebarTitle: Update taxgroup
    delete:
      operationId: aid_tax_delete
      summary: aid_tax_delete
      description: |
        Delete an existing taxgroup
      x-scopes:
        - admin:products
        - write:products
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/taxId'
      tags:
        - tax
      security:
        - JWT: []
      responses:
        '200':
          description: Taxgroup deleted
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/TaxGroup'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete taxgroup
          sidebarTitle: Delete taxgroup
x-tagGroups:
  - name: Product
    tags:
      - catalogs
      - products
      - groups
      - tax
servers:
  - url: https://api.dintero.com/v1
components:
  parameters:
    accountId:
      name: aid
      description: |
        An id that uniquely identifies the account.
      in: path
      required: true
      schema:
        type: string
        format: ^[PT]{1}\d{8}$
        minLength: 9
        maxLength: 9
    limit:
      name: limit
      in: query
      description: |
        A limit on the number of objects to be returned. Limit can range
        between 1 and 100 items, and the default is 10 items.
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 10
    startingAfter:
      name: starting_after
      in: query
      description: |
        cursor for use in pagination. starting_after is an object ID
        that defines your place in the list. For instance, if you make
        a list request and receive 100 objects, end the result contains
          `paging_token=pt1`, your subsequent call can include
        `starting_after=pt1` in order to fetch the next page of the list.
      required: false
      schema:
        type: string
    catalogId:
      name: catalog_id
      description: >
        An id that uniquely identifies the catalog. (must not have trailing or
        leading spaces)
      in: path
      required: true
      schema:
        type: string
        maxLength: 255
    productId:
      name: product_id
      description: >
        A string that uniquely identifies the product. (must not have trailing
        or leading spaces)
      in: query
      required: false
      schema:
        type: string
    product_name:
      name: product_name
      description: |
        Lookup on product name
      in: query
      required: false
      schema:
        type: string
    product_id:
      name: product_id
      description: >
        A string that uniquely identifies the product. (must not have trailing
        or leading spaces)
      in: path
      required: true
      schema:
        type: string
        maxLength: 255
    group_id_query:
      name: group_id
      description: >
        A string that uniquely identifies the group. (must not have trailing or
        leading spaces)
      in: query
      schema:
        type: string
        maxLength: 255
    groupId:
      name: group_id
      description: >
        A string that uniquely identifies the group. (must not have trailing or
        leading spaces)
      in: path
      required: true
      schema:
        type: string
        maxLength: 255
    taxId:
      name: tax_id
      description: >
        A string that uniquely identifies the tax. (must not have trailing or
        leading spaces)
      in: path
      required: true
      schema:
        type: string
        maxLength: 255
  responses:
    BadRequest:
      description: Bad / Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    AccessForbidden:
      description: Access forbidden, invalid JWT token was used
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Unexpected Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    JWT:
      type: http
      description: >
        Bearer authentication (token authentication) should be used for
        accessing the API.


        Use [Get Token](/api-reference/authenticate/aid_auths_oauth_token_post)
        to get an access token for client credentials.

        Pass the token in the request header:

            Authorization: Bearer {access_token}

        where the **access_token** is JSON Web Tokens (JWT).
      scheme: bearer
      bearerFormat: JWT
  schemas:
    BatchResponse:
      allOf:
        - type: object
          properties:
            catalog:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Catalog'
            products:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/Product'
    Catalog:
      type: object
      properties:
        catalog_id:
          type: string
          example: S23
          description: >-
            The id to define which catalog the product is a part of. An
            auto-generated ID will be created if not provided
          readOnly: true
        catalog_name:
          type: string
          example: Sommer
          description: |
            The catalog's name that will be shown customers
    Entity:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: |
            An UUID that uniquely identifies the resource
          readOnly: true
        created_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was created
          readOnly: true
        created_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was last updated
          readOnly: true
        deleted_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        deleted_at:
          type: string
          format: date-time
          readOnly: true
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
          properties:
            code:
              type: string
              description: The code used to identify the error/warning
            errors:
              type: array
              description: The nested error(s) encountered during validation
              items:
                type: object
            message:
              type: string
              description: The human readable description of the error/warning
    Dimension:
      type: object
      description: |
        Identify item attributes, such as size and color
      properties:
        color:
          type: string
        size:
          type: string
        style:
          type: string
        config:
          type: string
        variant:
          type: string
    Images:
      description: Links to images of product
      type: array
      example:
        - href: https://example.dintero.com/c/photos/2018/6_20_thumbnail_image.png
          rel: thumbnail_image
          caption: Image of current discount
        - href: https://example.dintero.com/c/photos/2018/6_20_medium_image.png
          rel: medium_image
      items:
        type: object
        maxItems: 10
        required:
          - href
        properties:
          href:
            description: The URL of the link.
            type: string
            format: uri
          title:
            description: Describes the image
            type: string
          rel:
            description: |
              Specifies the relationship between the image and the link

              Following `rel` values are reserved for specific usage

                - thumbnail_image: link to image
                - medium_image: link to image
                - large_image: link to image
                - webshop: link to site where the image may be used
            type: string
          type:
            type: string
            description: Specifies the media type of the link
    Location:
      type: object
      properties:
        location_id:
          type: string
          description: >
            The id you have defined for the sales location. 

            (must not have trailing or leading spaces). 

            An auto-generated location_id will be created if no location_id is
            provided
          maxLength: 255
        location_name:
          type: string
          description: |
            The name that will be shown to customers
        is_available_for_shipping:
          description: |
            If true, the product is available for shipping
          type: boolean
          default: true
        is_available_for_pickup:
          description: |
            If true, the product can be picked up at this location
          type: boolean
          default: false
        number_of_items_in_storage:
          description: |
            Number of items currently in storage at this location
          type: integer
    Product:
      type: object
      allOf:
        - properties:
            product_name:
              type: string
              example: Stablestol
              description: |
                The products name which is shown to customers
            description:
              type: string
              example: Stablestol for utendørsbruk
            is_virtual_product:
              type: boolean
              default: false
            unit_gross_price:
              type: integer
              example: 10900
            unit:
              type: string
              example: stk
              description: Unit type
            currency:
              type: string
              example: NOK
              description: >
                The three-character ISO-4217 currency.
                https://en.wikipedia.org/wiki/ISO_4217
            starting_at:
              type: string
              format: date-time
              description: |
                The product will not be visible until this time
            stopping_at:
              type: string
              format: date-time
              description: |
                The product will not be visible after this time
            dimension:
              $ref: '#/components/schemas/Dimension'
            images:
              $ref: '#/components/schemas/Images'
            locations:
              description: |
                All locations connected to the product
              type: array
              example:
                - location_id: SC_Oslo
                  location_name: SuperChain Oslo
                  is_available_for_shipping: false
                  is_available_for_pickup: true
                  number_of_items_in_storage: 15
                - location_id: SC_web
                  location_name: SuperChain Webshop
                  is_available_for_shipping: true
                  is_available_for_pickup: false
                  number_of_items_in_storage: 500
              items:
                $ref: '#/components/schemas/Location'
    ProductResponse:
      allOf:
        - $ref: '#/components/schemas/Entity'
        - $ref: '#/components/schemas/Product'
        - properties:
            product_id:
              description: >
                The id to define the product. An auto-generated product_id will
                be created if no product_id is provided
              type: string
              example: Stol22
              readOnly: true
            catalog_id:
              type: string
              example: S23
              description: >-
                The id to define which catalog the product is a part of. An
                auto-generated ID will be created if not provided
            catalog_name:
              type: string
              example: Sommer
              readOnly: true
              description: |
                Name of corresponding catalog
    Group:
      type: object
      properties:
        group_id:
          type: string
          description: group id
          example: B1
          readOnly: true
        group_name:
          type: string
          description: Name of the group
          example: Møbel
    ProductPost:
      allOf:
        - $ref: '#/components/schemas/Product'
        - properties:
            product_id:
              description: >
                The id to define the product. An auto-generated product_id will
                be created if no product_id is provided
              type: string
              example: Stol22
              readOnly: false
            groups:
              type: array
              description: >
                Array containing relevant product groups and sub-groups to be
                upserted. New groups will be inserted, existing groups will be
                updated and deleted groups will be revived.
              example:
                - id: B234
                  name: Stol
                - id: B1
                  name: Møbel
              items:
                allOf:
                  - properties:
                      group_id:
                        type: string
                        maxLength: 255
                        description: >
                          The id you have defined for the group (must not have
                          training or leading spaces). An auto-generated
                          group_id will be created if not provided
                        example: b1
                        readOnly: false
                  - $ref: '#/components/schemas/Group'
    TaxGroup:
      type: object
      properties:
        tax_id:
          type: string
          description: >
            The id you have defined for the taxgroup (must not have training or
            leading spaces). An auto-generated tax_id will be created if not
            provided
          example: vmva1
          readOnly: true
        tax_group:
          type: string
          description: |
            The taxgroup name which is usually shown
          example: Vmva-høy
        description:
          type: string
          example: Taxgroup for food. Currently 12%
        amount:
          type: number
          example: 10000
        percentage:
          type: number
          example: 12
        tax_code:
          type: string
          example: 3
