> For the complete documentation index, see [llms.txt](https://docs.pyck.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pyck.cloud/graphql-api/types/inventoryitemset.md).

# InventoryItemSet

InventoryItemSet Type

Represents a collection or set of inventory items grouped by a common Stock Keeping Unit (SKU). InventoryItemSet allows managing multiple instances of the same product type as a single logical unit.

## Fields

| Field          | Type                       | Description                                          |
| -------------- | -------------------------- | ---------------------------------------------------- |
| `id`           | `ID!`                      | Unique identifier of the item set                    |
| `tenantID`     | `UUID!`                    | Tenant identifier                                    |
| `dataTypeID`   | `UUID`                     | DataType identifier for schema validation            |
| `dataTypeSlug` | `String`                   | DataType slug for easier reference                   |
| `data`         | `Map`                      | Custom metadata stored as JSON                       |
| `createdAt`    | `Time!`                    | Creation timestamp                                   |
| `createdBy`    | `UUID!`                    | User identifier who created the item set             |
| `updatedAt`    | `Time`                     | Last update timestamp                                |
| `updatedBy`    | `UUID`                     | User identifier who last updated the item set        |
| `deletedAt`    | `Time`                     | Deletion timestamp                                   |
| `deletedBy`    | `UUID`                     | User identifier who deleted the item set             |
| `sku`          | `String!`                  | Stock Keeping Unit identifier                        |
| `items`        | `InventoryItemConnection!` | Connection to individual inventory items in this set |

## Connection Fields

The `items` field returns a Connection object that supports pagination, filtering, and ordering.

### items Connection

```graphql
items(
  after: Cursor
  first: Int
  before: Cursor
  last: Int
  orderBy: InventoryItemOrder
  where: InventoryItemWhereInput
): InventoryItemConnection!
```

| Argument  | Type                      | Description                         |
| --------- | ------------------------- | ----------------------------------- |
| `after`   | `Cursor`                  | Returns elements after this cursor  |
| `first`   | `Int`                     | Returns the first n elements        |
| `before`  | `Cursor`                  | Returns elements before this cursor |
| `last`    | `Int`                     | Returns the last n elements         |
| `orderBy` | `InventoryItemOrder`      | Ordering options for items          |
| `where`   | `InventoryItemWhereInput` | Filtering options for items         |

## Interfaces

* `Node`

## Usage Example

```graphql
query {
  inventoryItemSets(first: 10) {
    edges {
      node {
        id
        sku
        items(first: 50) {
          edges {
            node {
              id
              sku
              inventoryJSONData
            }
          }
          pageInfo {
            hasNextPage
            endCursor
          }
          totalCount
        }
        data
        createdAt
        updatedAt
      }
    }
  }
}
```

### Query with Filtering and Ordering

```graphql
query {
  inventoryItemSets(first: 10) {
    edges {
      node {
        id
        sku
        items(
          first: 20
          orderBy: { direction: DESC, field: CREATED_AT }
          where: { sku: "PROD-001" }
        ) {
          edges {
            node {
              id
              sku
              createdAt
            }
          }
          totalCount
        }
      }
    }
  }
}
```

## Mutation Examples

### Create an InventoryItemSet

```graphql
mutation {
  createInventoryItemSet(input: {
    sku: "PROD-001"
    dataTypeSlug: "product_set"
    data: {
      category: "electronics"
      brand: "TechCorp"
      model: "TC-2024"
    }
    itemIDs: ["item-uuid-1", "item-uuid-2", "item-uuid-3"]
  }) {
    inventoryItemSet {
      id
      sku
      items {
        edges {
          node {
            id
            sku
          }
        }
        totalCount
      }
    }
    workflows {
      id
      status
    }
  }
}
```

### Update an InventoryItemSet

```graphql
mutation {
  updateInventoryItemSet(
    id: "itemset-uuid-here"
    input: {
      data: {
        category: "consumer_electronics"
        updated_at: "2024-01-15T10:30:00Z"
      }
    }
  ) {
    inventoryItemSet {
      id
      sku
      data
    }
    workflows {
      id
      status
    }
  }
}
```

### Delete an InventoryItemSet

```graphql
mutation {
  deleteInventoryItemSet(id: "itemset-uuid-here") {
    deletedID
    workflows {
      id
      status
    }
  }
}
```

## Relations

* **InventoryItemSet** `1:N` **InventoryItem**: An item set contains multiple individual inventory items
* **InventoryItemSet** `N:1` **DataType**: Item sets can reference a DataType for schema validation

## Common Use Cases

* **Product Variants**: Group items with the same SKU but different attributes (size, color, etc.)
* **Batch Management**: Manage inventory items received or manufactured in the same batch
* **Bundle Products**: Create logical groupings of related products sold together
* **Kit Assembly**: Manage component items that make up a complete product kit
* **Inventory Organization**: Group items for easier tracking and reporting by product line

## Best Practices

* Use consistent SKU naming conventions across your organization
* Leverage the `data` field to store product-specific metadata
* Consider using DataTypes to enforce consistent data structure
* Monitor item set relationships when performing inventory movements
* Use workflows to track complex operations on item sets


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pyck.cloud/graphql-api/types/inventoryitemset.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
