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

# Update Inventory Item

> This endpoint updates an existing inventory item.

### Body

<ParamField body="id" type="string">
  This is the unique identifier for the inventory item.
</ParamField>

<ParamField body="sku" type="string">
  This is the stock keeping unit (SKU) for the inventory item.
</ParamField>

<ParamField body="description" type="string">
  This is the description for the inventory item.
</ParamField>

<ParamField body="size" type="string">
  This is the size for the inventory item.
</ParamField>

<ParamField body="incoming" type="number">
  This is the number of items incoming for the inventory item.
</ParamField>

<ParamField body="color" type="string">
  This is the color for the inventory item.
</ParamField>

<ParamField body="warehouse" type="number">
  This is the identifier for the warehouse for the inventory item.
</ParamField>

<ParamField body="available" type="number">
  This is the number of items available for the inventory item.
</ParamField>

<ParamField body="arriving" type="date">
  This is the date when the items are expected to arrive for the inventory item.
</ParamField>

<ParamField body="purchase_order_id" type="string">
  This is the identifier for the purchase order associated with the inventory item.
</ParamField>

### Response

<ResponseField name="id" type="string">
  This is the unique identifier for the inventory item.
</ResponseField>

<ResponseField name="sku" type="string">
  This is the stock keeping unit (SKU) for the inventory item.
</ResponseField>

<ResponseField name="description" type="string">
  This is the description for the inventory item.
</ResponseField>

<ResponseField name="size" type="string">
  This is the size for the inventory item.
</ResponseField>

<ResponseField name="incoming" type="number">
  This is the number of items incoming for the inventory item.
</ResponseField>

<ResponseField name="color" type="string">
  This is the color for the inventory item.
</ResponseField>

<ResponseField name="warehouse" type="number">
  This is the identifier for the warehouse for the inventory item.
</ResponseField>

<ResponseField name="available" type="number">
  This is the number of items available for the inventory item.
</ResponseField>

<ResponseField name="arriving" type="date">
  This is the date when the items are expected to arrive for the inventory item.
</ResponseField>

<ResponseField name="purchase_order_id" type="string">
  This is the identifier for the purchase order associated with the inventory item.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request PUT 'https://api.stateset.com/v1/inventory_items/:id' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token <token>' \
  --data-raw '{
      "id": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30"
  }'
  ```

  ```graphQL GraphQL theme={null}

                 mutation: gql`
                 mutation (
                  $id: String
                  $inventory_item: inventory_item_set_input!
                ) {
                  update_inventory_item (
                  where: { id : { _eq: $id }}
                  _set: $inventory_item
                  ) {
                    returning {
                      id
                      sku
                      upc
                      description
                      size
                      color
                      incoming
                      warehouse
                      available
                    }
                  }
                }
  ```

  ```javascript Node.js theme={null}

  var updated = await stateset.inventoryItem.update({
    id: "example_1",
    inventory_item: {
      name: "0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
    }
  })

  ```

  ```python Python theme={null}

  updated = stateset.inventory_item.modify(
    id="example_1",
    inventory_item={
      "name": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
    }
  )

  ```

  ```ruby Ruby theme={null}

  updated = Stateset::InventoryItem.update(
    id: "example_1",
    inventory_item: {
      name: "0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
    }
  )

  ```

  ```php PHP theme={null}

  $updated = $stateset->inventoryItem->update([
    "id" => "example_1",
    "inventory_item" => [
      "name" => "0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
    ]
  ]);

  ```

  ```go Golang theme={null}

  inventory_item := stateset.InventoryItem{
    Name: "0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
  }

  updated, err := stateset.InventoryItem.Update(
    "example_1",
    inventory_item,
  )

  ```

  ```java Java theme={null}

  InventoryItem inventory_item = new InventoryItem();

  inventory_item.setName("0901f083-aa1c-43c5-af5c-0a9d2fc64e30");

  InventoryItem updated = stateset.inventoryItem.update(
    "example_1",
    inventory_item
  );

  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
      "inventory_items": [
          {
              "id": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
              "sku": "SKU-123",
              "description": "This is a description",
              "size": "Large",
              "incoming": 10,
              "color": "Red",
              "warehouse": 1,
              "available": 10,
              "arriving": "2021-01-01",
              "purchase_order_id": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30"
          },
      ]
  }  
  ```
</ResponseExample>
