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

# Update Inventory Item Set

Update Inventory Item Set Mutation

Updates an existing InventoryItemSet object in the system with new data. This allows modification of item set properties, metadata, and the items included in the set.

## Arguments

| Name    | Type                           | Description                                               |
| ------- | ------------------------------ | --------------------------------------------------------- |
| `id`    | `ID!`                          | The unique identifier of the inventory item set to update |
| `input` | `UpdateInventoryItemSetInput!` | Input data for updating the inventory item set            |

## Return Type

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

## Input Fields

`UpdateInventoryItemSetInput`:

| Field               | Type      | Description                                          |
| ------------------- | --------- | ---------------------------------------------------- |
| `dataTypeID`        | `UUID`    | Optional data type ID to associate with the item set |
| `clearDataTypeID`   | `Boolean` | Clear the existing data type ID                      |
| `dataTypeSlug`      | `String`  | Optional data type slug for categorization           |
| `clearDataTypeSlug` | `Boolean` | Clear the existing data type slug                    |
| `data`              | `Map`     | Custom data associated with the item set             |
| `clearData`         | `Boolean` | Clear the existing custom data                       |
| `sku`               | `String`  | Update the SKU identifier for the item set           |
| `addItemIDs`        | `[ID!]`   | List of inventory item IDs to add to the set         |
| `removeItemIDs`     | `[ID!]`   | List of inventory item IDs to remove from the set    |
| `clearItems`        | `Boolean` | Remove all items from the set                        |

## Return Fields

`InventoryItemSetOutput`:

| Field              | Type                 | Description                                    |
| ------------------ | -------------------- | ---------------------------------------------- |
| `inventoryItemSet` | `InventoryItemSet`   | The updated inventory item set                 |
| `workflows`        | `[TemporalWorkflow]` | Related workflow instances that were triggered |

## Usage Example

```graphql
mutation {
  updateInventoryItemSet(
    id: "itemset_123"
    input: {
      sku: "PREMIUM_KIT_001",
      data: {
        "name": "Premium Warehouse Kit",
        "description": "Upgraded essential items for premium warehouse operations",
        "category": "premium_kit",
        "bundle_type": "premium_package",
        "total_value": 4500.00,
        "weight_kg": 65.8,
        "contains_hazardous": false,
        "assembly_required": true,
        "supplier": "Premium WareHouse Solutions Inc",
        "warranty_months": 24,
        "instructions_url": "https://docs.example.com/premium-kit",
        "last_updated": "2024-12-01T10:00:00Z",
        "version": "2.1"
      },
      dataTypeSlug: "premium_operational_kit",
      addItemIDs: [
        "scanner_premium_006",
        "tablet_rugged_007"
      ],
      removeItemIDs: [
        "scanner_001",
        "tablet_android_005"
      ]
    }
  ) {
    inventoryItemSet {
      id
      sku
      data
      dataTypeSlug
      items {
        id
        sku
        inventoryJSONData
      }
      updatedAt
      updatedBy
    }
    workflows {
      id
      type
      status
      runID
    }
  }
}
```

## JavaScript Example

```javascript
const UPDATE_INVENTORY_ITEM_SET = gql`
  mutation UpdateInventoryItemSet($id: ID!, $input: UpdateInventoryItemSetInput!) {
    updateInventoryItemSet(id: $id, input: $input) {
      inventoryItemSet {
        id
        sku
        data
        dataTypeSlug
        items {
          id
          sku
          inventoryJSONData
        }
        updatedAt
        updatedBy
      }
      workflows {
        id
        type
        status
        runID
      }
    }
  }
`;

const { data } = await client.mutate({
  mutation: UPDATE_INVENTORY_ITEM_SET,
  variables: {
    id: "itemset_123",
    input: {
      sku: "PREMIUM_KIT_001",
      data: {
        name: "Premium Warehouse Kit",
        description: "Upgraded essential items for premium warehouse operations",
        category: "premium_kit",
        bundle_type: "premium_package",
        total_value: 4500.00,
        weight_kg: 65.8,
        contains_hazardous: false,
        assembly_required: true,
        supplier: "Premium WareHouse Solutions Inc",
        warranty_months: 24,
        instructions_url: "https://docs.example.com/premium-kit",
        last_updated: "2024-12-01T10:00:00Z",
        version: "2.1"
      },
      dataTypeSlug: "premium_operational_kit",
      addItemIDs: [
        "scanner_premium_006",
        "tablet_rugged_007"
      ],
      removeItemIDs: [
        "scanner_001",
        "tablet_android_005"
      ]
    }
  }
});

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

## Important Notes

* **SKU Uniqueness**: If updating the SKU, ensure the new SKU is unique across all inventory item sets
* **Item Validation**: All items in `addItemIDs` must exist and be accessible
* **Relationship Management**: Adding/removing items automatically updates bidirectional relationships
* **Workflow Triggers**: Updates may trigger workflows for bundle repricing, inventory updates, or catalog synchronization
* **Data Integrity**: The system validates that all referenced items are valid and accessible
* **Audit Tracking**: All updates to item sets are logged for audit purposes
* **Version Control**: Consider including version information in the `data` field for change tracking

## Common Update Operations

### Add Items to Set

```graphql
input: {
  addItemIDs: ["new_item_001", "new_item_002"]
}
```

### Remove Items from Set

```graphql
input: {
  removeItemIDs: ["old_item_001", "old_item_002"]
}
```

### Replace All Items

```graphql
input: {
  clearItems: true,
  addItemIDs: ["replacement_001", "replacement_002", "replacement_003"]
}
```

### Update Metadata Only

```graphql
input: {
  data: {
    "price": 299.99,
    "last_reviewed": "2024-12-01T10:00:00Z"
  }
}
```

## Common Update Scenarios

1. **Product Evolution**: Update kit composition as products are improved or discontinued
2. **Pricing Updates**: Modify bundle value and pricing information
3. **Seasonal Adjustments**: Add or remove seasonal items from collections
4. **Quality Improvements**: Replace standard components with premium alternatives
5. **Supplier Changes**: Update supplier information and warranty terms
6. **Documentation Updates**: Add or modify assembly instructions and documentation links

## Best Practices

* **Incremental Changes**: Use `addItemIDs` and `removeItemIDs` for precise control over set composition
* **Version Tracking**: Include version numbers and update timestamps in the `data` field
* **Impact Assessment**: Consider downstream effects on pricing, inventory, and orders before making changes
* **Batch Operations**: Group related changes together to minimize workflow triggers
* **Documentation**: Update assembly instructions and related documentation when changing composition

## Related Operations

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

* Update pricing rules and bundle discounts
* Synchronize changes with catalog systems
* Update stock levels if set composition changed significantly
* Notify customers or internal teams about changes
* Update assembly instructions and documentation

## Error Handling

Common errors when updating item sets:

* **Duplicate SKU**: The new SKU already exists (if changing SKU)
* **Invalid Item References**: Items in `addItemIDs` don't exist or aren't accessible
* **Circular References**: Attempting to add an item set to itself
* **Insufficient Permissions**: User lacks permission to modify the item set 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/updateinventoryitemset.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.
