# Create Product — Squarespace

> Create a new product. See docs here

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

## Description

Create a new product. [See docs here](https://developers.squarespace.com/commerce-apis/create-product)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `storePageId` | `string` | Yes | The ID of the store page Options are loaded from the connected account. |
| `variants` | `string` | Yes | The variants of the product. Array must contain at least one object but no more than 100 objects. E.g [ { "sku": "SQ0557856", "pricing": { "basePrice": { "currency": "USD", "value": "12.95" }, "onSale": false, "salePrice": { "currency": "USD", "value": "0.00" } }, "stock": { "quantity": 10, "unlimited": false }, "attributes": { "Flavor": "Habanero" }, "shippingMeasurements": { "weight": { "unit": "POUND", "value": 2.0 }, "dimensions": { "unit": "INCH", "length": 7.0, "width": 5.0, "height": 5.0 } } } ] |
| `name` | `string` | No | The name of the product. 200 char limit |
| `description` | `string` | No | The description of the product. 102,400 char limit |
| `urlSlug` | `string` | No | The URL slug of the product. E.g artisanal-steak-dry-rub |
| `tags` | `string[]` | No | The tags of the product. E.g ["artisanal", "steak"] |
| `variantAttributes` | `string[]` | No | The variants attributes of the product. E.g ["Flavor"] |

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

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: "squarespace-create-product",
  arguments: {
    storePageId: "Store Page ID",
    variants: "Variants",
  },
})
```

**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: "squarespace-create-product",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    squarespace: { authProvisionId: "apn_xxxxxxx" },
    storePageId: "Store Page ID",
    variants: "Variants",
  },
})

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": "squarespace-create-product",
    "configured_props": {
      "squarespace": { "authProvisionId": "apn_xxxxxxx" },
      "storePageId": "Store Page ID",
      "variants": "Variants"
    }
  }'
```

---

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