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

# CreateStockItem

> Creates a new item that is a stock item from the start, so that its stock is managed in warehouses. Takes the same properties as POST /v2/items, except for three: the optional storageConstraints block is replaced by a mandatory stockManagement block, images are not part of this request - assign them with PATCH /v2/items/{itemId} once the item exists - and salesChannels is not either, activate channels with POST /v2/items/{itemId}/sales-channels/{salesChannelId}/activate. Use POST /v2/items/{itemId}/stock-items/convert to turn an item that already exists into a stock item.

If a request with this mutation's Idempotency-Key was already completed, the response's `extensions` contains an `idempotency.{responseName}` entry with `wasReplayed: true`.



**mutation** `CreateStockItem(request: CreateStockItemCommandRequestInput!): CreateStockItemCommandResponse!`

## Arguments

**`request`**: `CreateStockItemCommandRequestInput!` (required)

## Returns

`CreateStockItemCommandResponse!`

**`itemId`**: `ID!`

Unique ID of the newly created stock item - this key is used for all further operations with the item.

## Examples

```graphql Mutation
mutation CreateStockItem($request: CreateStockItemCommandRequestInput!) {
  CreateStockItem(request: $request) {
    itemId
  }
}
```

```json Variables
{
  "request": {
    "categories": {
      "categories": [
        {
          "categoryId": "id"
        }
      ]
    },
    "identifiers": {},
    "descriptions": {
      "defaultDescriptions": [
        {
          "languageIso": "string",
          "descriptionData": {}
        }
      ]
    },
    "stockManagement": {
      "hasShelfLifeExpirationDate": true,
      "hasBatch": true,
      "serialNumberTrackingType": "NONE",
      "divisibilityType": "NONE"
    }
  }
}
```

```json Response
{
  "data": {
    "CreateStockItem": {
      "itemId": "id"
    }
  }
}
```
