# Update Product — SureCart

> Update an existing product. See the documentation

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

## Description

Update an existing product. [See the documentation](https://developer.surecart.com/api-reference/products/update)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `productId` | `string` | Yes | The unique identifier of the product. Use List Products to retrieve a list of available products. |
| `name` | `string` | No | The product name, shown to customers. Example: Premium Plan |
| `description` | `string` | No | The product description, shown to customers. |
| `status` | `string` | No | The status of the product. |
| `sku` | `string` | No | The stock keeping unit for this product. Example: PLAN-001 |
| `slug` | `string` | No | A unique, URL-friendly identifier. Example: premium-plan |
| `recurring` | `boolean` | No | Set to true for a subscription product, false for a one-time purchase. |
| `featured` | `boolean` | No | Set to true to mark the product as featured. |
| `taxEnabled` | `boolean` | No | Set to true to make this product taxable. |
| `taxCategory` | `string` | No | The tax category that matches this product. |
| `shippingEnabled` | `boolean` | No | Set to true to require a full shipping address at checkout. |
| `weight` | `string` | No | The product weight, used for shipping calculations. Accepts decimals. Example: 1.5 |
| `weightUnit` | `string` | No | The weight unit for this product. |
| `stockEnabled` | `boolean` | No | Set to true to track stock for this product. |
| `stockAdjustment` | `integer` | No | Amount to adjust the stock by (positive or negative). Example: 100 |
| `allowOutOfStockPurchases` | `boolean` | No | Set to true to allow purchases when stock runs out. |
| `purchaseLimit` | `integer` | No | Max number of times a customer can purchase this product. Example: 5 |
| `reviewsEnabled` | `boolean` | No | Set to true to enable reviews for this product. |
| `licensingEnabled` | `boolean` | No | Set to true to enable licensing for this product. |
| `licenseActivationLimit` | `integer` | No | Max activations allowed per license. Leave empty for unlimited. Example: 5 |
| `productGroup` | `string` | No | The UUID of the product group to assign this product to. |
| `shippingProfile` | `string` | No | The UUID of the shipping profile to assign this product to. |
| `productCollections` | `string[]` | No | UUIDs of the product collections this product belongs to. |
| `metadata` | `object` | No | Additional key-value metadata. Example: { "internal_id": "123" } |

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

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: "surecart-update-product",
  arguments: {
    productId: "Product ID",
    name: "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: "surecart-update-product",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    surecart: { authProvisionId: "apn_xxxxxxx" },
    productId: "Product ID",
    name: "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": "surecart-update-product",
    "configured_props": {
      "surecart": { "authProvisionId": "apn_xxxxxxx" },
      "productId": "Product ID",
      "name": "Name"
    }
  }'
```

---

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