---
displayed_sidebar: inventoryReference
slug: /references/inventory/updateInventoryItem
sidebar_label: updateInventoryItem
---

import ParameterTypes from "@site/src/components/ParameterTypes"

# updateInventoryItem - Inventory Module Reference

This documentation provides a reference to the `updateInventoryItem` method. This belongs to the Inventory Module.

This method is used to update an inventory item.

## Example

```ts
import { 
  initialize as initializeInventoryModule,
} from "@medusajs/inventory"

async function updateInventoryItem (
  inventoryItemId: string,
  sku: string
) {
  const inventoryModule = await initializeInventoryModule({})

  const inventoryItem = await inventoryModule.updateInventoryItem(
    inventoryItemId,
    {
      sku
    }
  )

  // do something with the inventory item or return it
}
```

## Parameters

<ParameterTypes parameters={[
  {
    "name": "inventoryItemId",
    "type": "`string`",
    "description": "The ID of the inventory item.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "input",
    "type": "Partial&#60;[CreateInventoryItemInput](../../inventory/interfaces/inventory.CreateInventoryItemInput.mdx)&#62;",
    "description": "The attributes to update in the inventory item.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "description",
        "type": "`null` \\| `string`",
        "description": "The description of the inventory item.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "height",
        "type": "`null` \\| `number`",
        "description": "The height of the inventory item.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "hs_code",
        "type": "`null` \\| `string`",
        "description": "The HS code of the inventory item.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "length",
        "type": "`null` \\| `number`",
        "description": "The length of the inventory item.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "material",
        "type": "`null` \\| `string`",
        "description": "The material of the inventory item.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "metadata",
        "type": "`null` \\| `Record<string, unknown>`",
        "description": "Holds custom data in key-value pairs.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "mid_code",
        "type": "`null` \\| `string`",
        "description": "The MID code of the inventory item.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "origin_country",
        "type": "`null` \\| `string`",
        "description": "The origin country of the inventory item.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "requires_shipping",
        "type": "`boolean`",
        "description": "Whether the inventory item requires shipping.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "sku",
        "type": "`null` \\| `string`",
        "description": "The SKU of the inventory item.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "thumbnail",
        "type": "`null` \\| `string`",
        "description": "The thumbnail of the inventory item.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "title",
        "type": "`null` \\| `string`",
        "description": "The title of the inventory item.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "weight",
        "type": "`null` \\| `number`",
        "description": "The weight of the inventory item.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "width",
        "type": "`null` \\| `number`",
        "description": "The width of the inventory item.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  },
  {
    "name": "context",
    "type": "[SharedContext](../../inventory/interfaces/inventory.SharedContext.mdx)",
    "description": "A context used to share resources, such as transaction manager, between the application and the module.",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "manager",
        "type": "`EntityManager`",
        "description": "An instance of an entity manager.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "transactionManager",
        "type": "`EntityManager`",
        "description": "An instance of a transaction manager.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} />

## Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[InventoryItemDTO](../../inventory/types/inventory.InventoryItemDTO.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "The updated inventory item's details.",
    "expandable": false,
    "children": [
      {
        "name": "created_at",
        "type": "`string` \\| `Date`",
        "description": "The date with timezone at which the resource was created.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "deleted_at",
        "type": "`string` \\| `Date` \\| `null`",
        "description": "The date with timezone at which the resource was deleted.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "description",
        "type": "`string` \\| `null`",
        "description": "Description of the inventory item",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "height",
        "type": "`number` \\| `null`",
        "description": "The height of the Inventory Item. May be used in shipping rate calculations.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "hs_code",
        "type": "`string` \\| `null`",
        "description": "The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "id",
        "type": "`string`",
        "description": "The inventory item's ID.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "length",
        "type": "`number` \\| `null`",
        "description": "The length of the Inventory Item. May be used in shipping rate calculations.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "material",
        "type": "`string` \\| `null`",
        "description": "The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "metadata",
        "type": "`Record<string, unknown>` \\| `null`",
        "description": "An optional key-value map with additional details",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "mid_code",
        "type": "`string` \\| `null`",
        "description": "The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "origin_country",
        "type": "`string` \\| `null`",
        "description": "The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "requires_shipping",
        "type": "`boolean`",
        "description": "Whether the item requires shipping.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "sku",
        "type": "`string` \\| `null`",
        "description": "The Stock Keeping Unit (SKU) code of the Inventory Item.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "thumbnail",
        "type": "`string` \\| `null`",
        "description": "Thumbnail for the inventory item",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "title",
        "type": "`string` \\| `null`",
        "description": "Title of the inventory item",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "updated_at",
        "type": "`string` \\| `Date`",
        "description": "The date with timezone at which the resource was updated.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "weight",
        "type": "`number` \\| `null`",
        "description": "The weight of the Inventory Item. May be used in shipping rate calculations.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "width",
        "type": "`number` \\| `null`",
        "description": "The width of the Inventory Item. May be used in shipping rate calculations.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} />
