# Create Product — Sperse

> Creates a new product. See the documentation

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

## Description

Creates a new product. [See the documentation](https://app.sperse.com/app/api/swagger)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `name` | `string` | Yes | The name of the product |
| `code` | `string` | Yes | The product code |
| `productType` | `string` | Yes | The type of the product |
| `currencyId` | `string` | Yes | The ID of the currency Options are loaded from the connected account. |
| `priceOptions` | `string[]` | Yes | An array of price option objects. See the documentation Example: [ { "type": "Subscription", "frequency": "OneTime", "fee": 0, "customerChoosesPrice": false, "credits": 100, "trialDayCount": 0, "customPeriodCount": 14, "customPeriodType": "Days" } ] |
| `description` | `string` | No | The description of the product |
| `descriptionHtml` | `string` | No | The HTML description of the product |
| `barCode` | `string` | No | The product barcode |
| `isPublished` | `boolean` | No | Whether the product is published |
| `publishDate` | `string` | No | The publish date is required if the product is published. Example: 2026-02-16 |
| `groupName` | `string` | No | The product group name |

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

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: "sperse-create-product",
  arguments: {
    name: "Name",
    code: "Product Code",
  },
})
```

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

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": "sperse-create-product",
    "configured_props": {
      "sperse": { "authProvisionId": "apn_xxxxxxx" },
      "name": "Name",
      "code": "Product Code"
    }
  }'
```

---

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