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

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

# createReservationItems - Inventory Module Reference

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

This method is used to create reservation items.

## Example

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

async function createReservationItems (items: {
  inventory_item_id: string,
  location_id: string,
  quantity: number
}[]) {
  const inventoryModule = await initializeInventoryModule({})

  const reservationItems = await inventoryModule.createReservationItems(
    items
  )

  // do something with the reservation items or return them
}
```

## Parameters

<ParameterTypes parameters={[
  {
    "name": "input",
    "type": "[CreateReservationItemInput](../../inventory/interfaces/inventory.CreateReservationItemInput.mdx)[]",
    "description": "The details of the reservation items to create.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "created_by",
        "type": "`string`",
        "description": "The user or system that created the reservation. Can be any form of identification string.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "description",
        "type": "`string`",
        "description": "The description of the reservation.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "external_id",
        "type": "`string`",
        "description": "An ID associated with an external third-party system that the reservation item is connected to.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "inventory_item_id",
        "type": "`string`",
        "description": "The ID of the associated inventory item.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "line_item_id",
        "type": "`string`",
        "description": "The ID of the associated line item.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "location_id",
        "type": "`string`",
        "description": "The ID of the associated location.",
        "optional": false,
        "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": "quantity",
        "type": "`number`",
        "description": "The reserved quantity.",
        "optional": false,
        "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;[ReservationItemDTO](../../inventory/types/inventory.ReservationItemDTO.mdx)[]&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "The created reservation items' details.",
    "expandable": false,
    "children": [
      {
        "name": "ReservationItemDTO[]",
        "type": "[ReservationItemDTO](../../inventory/types/inventory.ReservationItemDTO.mdx)[]",
        "optional": false,
        "defaultValue": "",
        "description": "",
        "expandable": false,
        "children": [
          {
            "name": "ReservationItemDTO",
            "type": "`object`",
            "description": "Represents a reservation of an inventory item at a stock location",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          }
        ]
      }
    ]
  }
]} />
