# Create Item — Zenventory

> Generates a new item. See the documentation

- Key: `zenventory-create-item`
- Type: Action (Write)
- Version: 0.0.4
- App: Zenventory (`zenventory`) — https://pipedream.com/apps/zenventory.md
- This page (HTML): https://pipedream.com/apps/zenventory/actions/create-item
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/zenventory/actions/create-item/create-item.mjs

## Description

Generates a new item. [See the documentation](https://docs.zenventory.com/#tag/items/paths/~1items/post)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `sku` | `string` | Yes | The item's SKU. |
| `clientId` | `integer` | No | Id of the client that the item belongs to. Defaults to the user's client id. |
| `clientName` | `string` | No | Name of the client that the item belongs to. Ignored if clientId is provided and is nonzero. |
| `upc` | `string` | No | The item's UPC. |
| `description` | `string` | No | The item's description. |
| `category` | `string` | No | The item's category to be grouped by. |
| `baseUom` | `string` | No | The item's base unit of measurement. |
| `unitCost` | `string` | No | How much the item costs you to stock. |
| `leadTime` | `integer` | No | The item's lead time. |
| `defaultEconOrder` | `integer` | No | The item's default order quantity for purchase orders. |
| `orderLimit` | `integer` | No | The item's order limit. |
| `rrp` | `string` | No | The item's recommended retail price. |
| `price` | `string` | No | How much the item is sold for. |
| `active` | `boolean` | No | True if the item is active. Inactive items are hidden from most processes. |
| `kit` | `boolean` | No | True if the item is a kit item made up of other items. An item cannot both be a kit and an assembly item. |
| `assembly` | `boolean` | No | True if the item is stocked by combining other items together. An item cannot both be a kit and an assembly item. |
| `perishable` | `boolean` | No | True if the item has an expiration date. A non-inventory or serialized item cannot also be this. |
| `trackLot` | `boolean` | No | True if the item is tracked by lot numbers. A non-inventory or serialized item cannot also be this. |
| `serialized` | `boolean` | No | True if the item is tracked by serial numbers. A non-inventory item cannot be serialized. |
| `nonInventory` | `boolean` | No | True if the item does not have inventory. A kit or assembly cannot also be non-inventory. |
| `weight` | `string` | No | The item's weight. |
| `storageLength` | `string` | No | Part of the dimensions the item takes to store. |
| `storageWidth` | `string` | No | Part of the dimensions the item takes to store. |
| `storageHeight` | `string` | No | Part of the dimensions the item takes to store. |
| `safetyStock` | `integer` | No | How much stock should be withheld when reporting stock levels to marketplace integrations. |
| `userField1` | `string` | No | User defined field for the item. |
| `userField2` | `string` | No | User defined field for the item. |
| `userField3` | `string` | No | User defined field for the item. |
| `userField4` | `string` | No | User defined field for the item. |
| `userField5` | `string` | No | User defined field for the item. |
| `userField6` | `string` | No | User defined field for the item. |
| `notes` | `string` | No | Notes for the item. |
| `assignToAllWarehouses` | `boolean` | No | True to assign to all warehouses on creation. |
| `assignToWarehouse` | `boolean` | No | True to assign the item to a specific warehouse. |
| `warehouseId` | `integer` | No | Id of the warehouse the item will be assigned to. If no warehouse parameters are given, then the user's current warehouse will be used. |
| `warehouseName` | `string` | No | Name of the warehouse the item will be assigned to. Ignored if warehouseId is provided. |
| `reorderLevel` | `integer` | No | Reorder level for the item's warehouse assignment. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "zenventory",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "zenventory-create-item",
  arguments: {
    sku: "SKU",
    clientId: 10,
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "zenventory-create-item",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    zenventory: { authProvisionId: "apn_xxxxxxx" },
    sku: "SKU",
    clientId: 10,
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "zenventory-create-item",
    "configured_props": {
      "zenventory": { "authProvisionId": "apn_xxxxxxx" },
      "sku": "SKU",
      "clientId": 10
    }
  }'
```

---

- App: https://pipedream.com/apps/zenventory.md · All apps: https://pipedream.com/apps
