# Create Product — OTO

> Creates a new product. See the documentation

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

## Description

Creates a new product. [See the documentation](https://apis.tryoto.com/#21b289bc-04c1-49b1-993e-23e928d57f56)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `sku` | `string` | Yes | SKU of the product |
| `productName` | `string` | Yes | Name of the product |
| `price` | `string` | Yes | Price of the product |
| `taxAmount` | `string` | Yes | Tax Amount of the product |
| `brandId` | `string` | No | The brand ID of the product Options are loaded from the connected account. |
| `description` | `string` | No | Description of the product |
| `barcode` | `string` | No | Barcode of the product |
| `secondBarcode` | `string` | No | Second Barcode of the product |
| `productImage` | `string` | No | Image Link of the product |
| `category` | `string` | No | Category of the product |
| `hsCode` | `string` | No | A standardized numerical method of classifying traded products |
| `itemOrigin` | `string` | No | Origin of the product |
| `customAttributes` | `object` | No | Custom attributes of the product specified as a JSON Array of objects with keys attributeName and attributeValue. Example: [{ "attributeName": "112", "attributeValue": "test product"}] |

## 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": "oto",
      },
    },
  },
)

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: "oto-create-product",
  arguments: {
    sku: "Sku",
    productName: "Product Name",
  },
})
```

**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: "oto-create-product",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    oto: { authProvisionId: "apn_xxxxxxx" },
    sku: "Sku",
    productName: "Product Name",
  },
})

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": "oto-create-product",
    "configured_props": {
      "oto": { "authProvisionId": "apn_xxxxxxx" },
      "sku": "Sku",
      "productName": "Product Name"
    }
  }'
```

---

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