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

# Get grouped item counts

> Returns a list of keys and their total item counts based on the specified grouping. Used for rendering paginated accordion tables.



## OpenAPI

````yaml get /inventory/items/groups
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /inventory/items/groups:
    get:
      tags:
        - Items
      summary: Get grouped item counts
      description: >-
        Returns a list of keys and their total item counts based on the
        specified grouping. Used for rendering paginated accordion tables.
      operationId: get_item_groups_inventory_items_groups_get
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: page
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Page
        - name: per_page
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Per Page
        - name: sort_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Sort By
        - name: sort_direction
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - asc
                  - desc
                type: string
              - type: 'null'
            title: Sort Direction
        - name: location_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Location Id
        - name: ids
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: List of item IDs to filter by
            title: Ids
          description: List of item IDs to filter by
        - name: name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Name
            description: Name of the item
          description: Name of the item
        - name: category
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Filter to items in this category, expanded through the
              category_closure tree by default (parent → every descendant). Set
              `category_exact` to disable expansion for grouped per-group page
              queries that need direct-children-only counts.
            title: Category
          description: >-
            Filter to items in this category, expanded through the
            category_closure tree by default (parent → every descendant). Set
            `category_exact` to disable expansion for grouped per-group page
            queries that need direct-children-only counts.
        - name: category_exact
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              When True, treat `category` as an exact match instead of expanding
              through the closure. Used when paginating within a grouped table
              so child categories don't double-appear under their parent's
              group.
            default: false
            title: Category Exact
          description: >-
            When True, treat `category` as an exact match instead of expanding
            through the closure. Used when paginating within a grouped table so
            child categories don't double-appear under their parent's group.
        - name: category_search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Category of the item (fuzzy match)
            title: Category Search
          description: Category of the item (fuzzy match)
        - name: categories
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: List of categories (can contain 'no-category')
            title: Categories
          description: List of categories (can contain 'no-category')
        - name: brand_names
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: List of brand names (can contain 'no-brand')
            title: Brand Names
          description: List of brand names (can contain 'no-brand')
        - name: settings
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: 'Settings toggles: ''hasExemptions'', ''customPricing'', ''noSettings'''
            title: Settings
          description: 'Settings toggles: ''hasExemptions'', ''customPricing'', ''noSettings'''
        - name: usage_value
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: Usage count filter value
            title: Usage Value
          description: Usage count filter value
        - name: usage_comparison
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - eq
                  - gte
                  - lte
                type: string
              - type: 'null'
            description: 'Usage count filter comparison: ''eq'', ''gte'', ''lte'''
            title: Usage Comparison
          description: 'Usage count filter comparison: ''eq'', ''gte'', ''lte'''
        - name: price_range
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: integer
                type: array
              - type: 'null'
            description: Price range [min, max]
            title: Price Range
          description: Price range [min, max]
        - name: is_archived
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: Archived status of the item
            title: Is Archived
          description: Archived status of the item
        - name: include_archived
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              When True, include archived items (e.g. for checkout discounts
              that reference archived items)
            default: false
            title: Include Archived
          description: >-
            When True, include archived items (e.g. for checkout discounts that
            reference archived items)
        - name: is_physical
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: Physical status of the item
            title: Is Physical
          description: Physical status of the item
        - name: item_type
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/ItemType'
              - type: 'null'
            description: List of item types to filter by
            title: Item Type
          description: List of item types to filter by
        - name: group_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Field to group by, e.g. 'category'
            title: Group By
          description: Field to group by, e.g. 'category'
        - name: tag_ids
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: Filter items that have all of the given tag IDs
            title: Tag Ids
          description: Filter items that have all of the given tag IDs
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ItemGroupItem'
                title: Response Get Item Groups Inventory Items Groups Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ItemType:
      type: string
      enum:
        - ITEM
        - SERVICE
        - PRODUCT
        - PACKAGE
        - MEMBERSHIP
        - MEDICATION
        - SERVICE_FEE
        - GIFT_CARD
      title: ItemType
    ItemGroupItem:
      properties:
        key:
          type: string
          title: Key
        label:
          type: string
          title: Label
        total:
          type: integer
          title: Total
        depth:
          type: integer
          title: Depth
          default: 0
        parentKey:
          anyOf:
            - type: string
            - type: 'null'
          title: Parentkey
        isSynthetic:
          type: boolean
          title: Issynthetic
          default: false
      type: object
      required:
        - key
        - label
        - total
      title: ItemGroupItem
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````