> 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/mutations/createinventoryitemset.md).

# Create Inventory Item Set

Create Inventory Item Set Mutation

Creates a new InventoryItemSet object in the system. Item sets represent logical groupings of related inventory items, such as product bundles, kits, or collections that are managed together.

## Arguments

| Name    | Type                           | Description                                        |
| ------- | ------------------------------ | -------------------------------------------------- |
| `input` | `CreateInventoryItemSetInput!` | Input data for creating the new inventory item set |

## Return Type

`InventoryItemSetOutput` - Contains the created inventory item set and any related workflows.

## Input Fields

`CreateInventoryItemSetInput`:

| Field          | Type      | Description                                           |
| -------------- | --------- | ----------------------------------------------------- |
| `dataTypeID`   | `UUID`    | Optional data type ID to associate with the item set  |
| `dataTypeSlug` | `String`  | Optional data type slug for categorization            |
| `data`         | `Map`     | Custom data associated with the item set              |
| `sku`          | `String!` | **Required** - Unique SKU identifier for the item set |
| `itemIDs`      | `[ID!]`   | List of inventory item IDs to include in this set     |

## Return Fields

`InventoryItemSetOutput`:

| Field              | Type                 | Description                                            |
| ------------------ | -------------------- | ------------------------------------------------------ |
| `inventoryItemSet` | `InventoryItemSet`   | The created inventory item set                         |
| `workflows`        | `[TemporalWorkflow]` | Workflow instances that were triggered by the creation |

## Usage Example

```graphql
mutation {
  createInventoryItemSet(input: {
    sku: "STARTER_KIT_001",
    data: {
      "name": "Warehouse Starter Kit",
      "description": "Essential items for new warehouse operations",
      "category": "operational_kit",
      "bundle_type": "starter_package",
      "total_value": 2500.00,
      "weight_kg": 45.2,
      "contains_hazardous": false,
      "assembly_required": true,
      "supplier": "WareHouse Solutions Inc",
      "warranty_months": 12,
      "instructions_url": "https://docs.example.com/starter-kit"
    },
    dataTypeSlug: "operational_kit",
    itemIDs: [
      "scanner_001",
      "printer_thermal_002", 
      "cart_mobile_003",
      "supplies_basic_004",
      "tablet_android_005"
    ]
  }) {
    inventoryItemSet {
      id
      sku
      data
      dataTypeSlug
      items {
        id
        sku
        inventoryJSONData
      }
      createdAt
      createdBy
    }
    workflows {
      id
      type
      status
      runID
      startedAt
      completedAt
    }
  }
}
```

## JavaScript Example

```javascript
const CREATE_INVENTORY_ITEM_SET = gql`
  mutation CreateInventoryItemSet($input: CreateInventoryItemSetInput!) {
    createInventoryItemSet(input: $input) {
      inventoryItemSet {
        id
        sku
        data
        dataTypeSlug
        items {
          id
          sku
          inventoryJSONData
        }
        createdAt
        createdBy
      }
      workflows {
        id
        type
        status
        runID
        startedAt
        completedAt
      }
    }
  }
`;

const { data } = await client.mutate({
  mutation: CREATE_INVENTORY_ITEM_SET,
  variables: {
    input: {
      sku: "STARTER_KIT_001",
      data: {
        name: "Warehouse Starter Kit",
        description: "Essential items for new warehouse operations",
        category: "operational_kit",
        bundle_type: "starter_package",
        total_value: 2500.00,
        weight_kg: 45.2,
        contains_hazardous: false,
        assembly_required: true,
        supplier: "WareHouse Solutions Inc",
        warranty_months: 12,
        instructions_url: "https://docs.example.com/starter-kit"
      },
      dataTypeSlug: "operational_kit",
      itemIDs: [
        "scanner_001",
        "printer_thermal_002", 
        "cart_mobile_003",
        "supplies_basic_004",
        "tablet_android_005"
      ]
    }
  }
});

console.log(`Created item set: ${data.createInventoryItemSet.inventoryItemSet.sku}`);
```

## Important Notes

* **SKU Uniqueness**: The SKU must be unique across all inventory item sets in the system
* **Item Validation**: All items referenced in `itemIDs` must exist and be accessible
* **Workflow Triggers**: Creating an item set may trigger workflows for bundle management, pricing updates, or inventory synchronization
* **Data Integrity**: The system validates that all referenced items are valid and accessible
* **Authorization**: Ensure you have proper permissions to create item sets and reference the specified items
* **Relationship Management**: The system automatically creates bidirectional relationships between the set and its items

## Common Use Cases

1. **Product Bundles**: Group related products sold together (e.g., starter kits, combo packages)
2. **Maintenance Kits**: Collections of spare parts and tools for equipment maintenance
3. **Seasonal Collections**: Items grouped for seasonal sales or promotions
4. **Assembly Sets**: Components that combine to create a finished product
5. **Replacement Kits**: Collections of commonly replaced parts
6. **Training Sets**: Items used together for training or demonstration purposes

## Best Practices

* **Meaningful SKUs**: Use descriptive SKU patterns that indicate the set's purpose
* **Complete Data**: Include comprehensive metadata in the `data` field for better management
* **Logical Grouping**: Ensure items in the set have a logical business relationship
* **Documentation**: Include assembly instructions, usage notes, or related documentation URLs
* **Validation**: Verify all component items exist before creating the set

## Related Operations

After creating an inventory item set, you may need to:

* Create stock records for the item set in appropriate repositories
* Set up pricing rules for bundle discounts
* Configure movement rules for keeping sets together
* Update catalog systems with the new item set
* Create workflow rules for set assembly or disassembly

## Error Handling

Common errors when creating item sets:

* **Duplicate SKU**: The specified SKU already exists
* **Invalid Item References**: One or more items in `itemIDs` don't exist or aren't accessible
* **Insufficient Permissions**: User lacks permission to create item sets or reference specific items
* **Data Validation**: Custom data doesn't meet schema requirements


---

# 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/mutations/createinventoryitemset.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.
