> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.noyax.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List product group details

> Lists the selectable values of the product groups.

Product groups are **hierarchical**: the parent of a detail (`ParentGroupDetailId`) is always a detail of the previous group.

* Group 1 details have no parent, so all of them are always selectable.
* Once a detail is selected in group 2, only the details **whose parent is that detail** and the details **without a parent** can be selected in group 3. The same rule applies for 3 → 4 and 4 → 5.
* **A detail without a parent can be selected under every parent.** For example a "SUV" body type that is valid for every brand is defined without a parent.

```
AUDİ (group 1)
└── SEDAN (group 2, parent AUDİ)
    └── JETTA (group 3, parent SEDAN)
SUV (group 2, no parent) -> selectable with every brand
```

The rule is validated when a product is saved: if `GroupDetailId3` is a detail whose parent is neither the detail selected in `GroupDetailId2` nor empty, the request is rejected with `2013`.

## Getting the selectable details

When a detail is selected in the previous group, send `parentGroupDetailId` together with `groupNumber`: the response contains the children of that parent plus the details without a parent, which is exactly what the drop-down on the screen shows.

```
GET /api/v1/products/groups?groupNumber=3&parentGroupDetailId=<group 2 selection>
```


## OpenAPI

````yaml api-reference/openapi.json GET /api/v1/products/groups
openapi: 3.1.1
info:
  title: Noyax API
  description: Server-to-server API for integrations to access Noyax data.
  version: '1.0'
servers:
  - url: https://api.noyax.com
security:
  - Bearer: []
tags:
  - name: Sections
  - name: Warehouses
  - name: Product Critical Stock
  - name: Product groups
  - name: Product Parameter Definitions
  - name: Product Parameters
  - name: Product Prices
  - name: Products
  - name: Cities
  - name: Countries
  - name: Currencies
  - name: Districts
  - name: Shipment Definitions
  - name: Units
  - name: VAT rates
  - name: Customer Addresses
  - name: Customer Bank Accounts
  - name: Customer Definitions
  - name: Customer Group Members
  - name: Customer Links
  - name: Customer Parameters
  - name: Customer Representatives
  - name: Customers
  - name: Customer Statement
  - name: Customer Telephones
paths:
  /api/v1/products/groups:
    get:
      tags:
        - Product groups
      summary: List product group details
      description: >-
        Returns the selectable values of the five product groups. Use an Id as
        GroupDetailId1...GroupDetailId5 in products.

        Send parentGroupDetailId together with groupNumber to get exactly the
        details that can be selected under that parent:

        the children of the parent plus the details that have no parent.
      parameters:
        - name: groupNumber
          in: query
          description: Returns only the details of this group (1-5).
          schema:
            type: integer
            format: int32
        - name: parentGroupDetailId
          in: query
          description: >-
            Returns only the details whose parent is this detail, plus the
            details without a parent.
          schema:
            type: string
            format: uuid
        - name: X-UserID
          in: header
          description: >-
            ID of the Noyax user the request is made on behalf of. Written to
            the audit fields of created, updated and deleted records.
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: X-CompanyID
          in: header
          description: >-
            ID of the company. The user must be assigned to this company. All
            reads and writes are limited to this company.
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: X-PeriodID
          in: header
          description: >-
            ID of the accounting period. Optional for customer endpoints; if
            sent, it is written to created records.
          schema:
            minimum: 1
            type: integer
            format: int32
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataResultOfListOfProductGroupDetailDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0201'
                Message: X-UserID header is required.
                Errors:
                  - Code: '0201'
                    Message: X-UserID header is required.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0102'
                Message: Token has expired. Obtain a new token using the refresh token.
                Errors:
                  - Code: '0102'
                    Message: >-
                      Token has expired. Obtain a new token using the refresh
                      token.
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0110'
                Message: You do not have permission for this operation.
                Errors:
                  - Code: '0110'
                    Message: You do not have permission for this operation.
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0120'
                Message: Daily request limit (10000) exceeded.
                Errors:
                  - Code: '0120'
                    Message: Daily request limit (10000) exceeded.
components:
  schemas:
    DataResultOfListOfProductGroupDetailDto:
      required:
        - Success
        - ResultCode
        - Data
      type: object
      properties:
        Success:
          type: boolean
          description: Whether the operation succeeded.
          example: true
        ResultCode:
          type: string
          description: >-
            "0000" on success. On failure, the code of the first error; all
            errors are listed in Errors.
          example: '0000'
        Message:
          type:
            - 'null'
            - string
          description: >-
            Error message when Success is false. Messages of all errors are
            joined into a single text.
        Data:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ProductGroupDetailDto'
          description: Response data. Null when Success is false.
    ErrorResult:
      type: object
      properties:
        Success:
          type: boolean
          description: Whether the operation succeeded.
          example: false
        ResultCode:
          type:
            - 'null'
            - string
          description: >-
            "0000" on success. On failure, the code of the first error; all
            errors are listed in Errors.
        Message:
          type:
            - 'null'
            - string
          description: >-
            Error message when Success is false. Messages of all errors are
            joined into a single text.
        Errors:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ResultError'
          description: All errors with their codes. Only present when Success is false.
    ProductGroupDetailDto:
      type: object
      properties:
        Id:
          type: string
          description: >-
            Product group detail ID. Use it as GroupDetailId1...GroupDetailId5
            in products.
          format: uuid
        ParentName:
          type:
            - 'null'
            - string
          description: Name of the parent detail.
          example: AUDİ
        GroupNumber:
          type: integer
          description: >-
            Required. Which product group the detail belongs to: 1-5, matching
            GroupDetailId1...GroupDetailId5 of a product.
          format: int32
          example: 2
        Name:
          type:
            - 'null'
            - string
          description: >-
            Required. Detail name, unique within the group. At most 50
            characters.
          example: SEDAN
        ParentGroupDetailId:
          type:
            - 'null'
            - string
          description: >-
            ID of the parent detail, which must belong to the previous group
            (GroupNumber - 1). Leave it empty to make the detail selectable
            under every parent. Group 1 details cannot have a parent.
          format: uuid
    ResultError:
      required:
        - Code
        - Message
      type: object
      properties:
        Code:
          type: string
          description: Error code. See the result codes page for the full list.
        Message:
          type: string
          description: Error description.
  securitySchemes:
    Bearer:
      type: http
      description: Access token obtained from the Noyax auth service with your API key.
      scheme: bearer
      bearerFormat: JWT

````