# Create Product — BigCommerce

> Create a product. See the docs here

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

## Description

Create a product. [See the docs here](https://developer.bigcommerce.com/api-reference/366928572e59e-create-a-product)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `name` | `string` | Yes | The product name. >= 1 characters <= 250 characters |
| `type` | `string` | Yes | The product type. One of: physical - a physical stock unit, digital - a digital download. Allowed values: physical digital Example: physical |
| `sku` | `string` | No | User defined product code/stock keeping unit (SKU). >= 0 characters <= 255 characters Example: SM-13 |
| `description` | `string` | No | The product description, which can include HTML formatting. |
| `weight` | `any` | Yes | Weight of the product, which can be used when calculating shipping costs. This is based on the unit set on the store >= 0 and <= 9999999999 |
| `width` | `any` | No | Width of the product, which can be used when calculating shipping costs. >= 0 and <= 9999999999 |
| `depth` | `any` | No | Depth of the product, which can be used when calculating shipping costs. >= 0 and <= 9999999999 |
| `height` | `any` | No | Height of the product, which can be used when calculating shipping costs. >= 0 and <= 9999999999 |
| `price` | `any` | Yes | The price of the product. The price should include or exclude tax, based on the store settings. >= 0 |
| `cost_price` | `any` | No | The cost price of the product. Stored for reference only; it is not used or displayed anywhere on the store. >=0 |
| `retail_price` | `any` | No | The retail cost of the product. If entered, the retail cost price will be shown on the product page. >=0 |
| `sale_price` | `any` | No | If entered, the sale price will be used instead of value in the price field when calculating the product's cost. >=0 |
| `map_price` | `integer` | No | Minimum Advertised Price |
| `tax_class_id` | `integer` | No | The ID of the tax class applied to the product. (NOTE: Value ignored if automatic tax is enabled.) >= 0 and <= 1000000000 Options are loaded from the connected account. |
| `product_tax_code` | `string` | No | Accepts AvaTax System Tax Codes, which identify products and services that fall into special sales-tax categories. By using these codes, merchants who subscribe to BigCommerce's Avalara Premium integration can calculate sales taxes more accurately. Stores without Avalara Premium will ignore the code when calculating sales tax. Do not pass more than one code. The codes are case-sensitive. For details, please see Avalara's documentation. >= 0 characters <= 255 characters |
| `categories` | `integer[]` | No | An array of IDs for the categories to which this product belongs. When updating a product, if an array of categories is supplied, all product categories will be overwritten. Does not accept more than 1,000 ID values. Options are loaded from the connected account. |
| `brand_id` | `integer` | No | A product can be added to an existing brand during a product /PUT or /POST. >= 0 and <= 1000000000 Options are loaded from the connected account. |
| `inventory_level` | `integer` | No | Current inventory level of the product. Simple inventory tracking must be enabled (See the inventory_tracking field) for this to take any effect. >= 0 and <= 1000000000 |
| `inventory_warning_level` | `integer` | No | Inventory warning level for the product. When the product's inventory level drops below the warning level, the store owner will be informed. Simple inventory tracking must be enabled (see the inventory_tracking field) for this to take any effect. >= 0 and <= 1000000000 |
| `inventory_tracking` | `string` | No | The type of inventory tracking for the product. Values are: none - inventory levels will not be tracked; product - inventory levels will be tracked using the inventory_level and inventory_warning_level fields; variant - inventory levels will be tracked based on variants, which maintain their own warning levels and inventory levels. Allowed values: none, product, variant |
| `fixed_cost_shipping_price` | `any` | No | A fixed shipping cost for the product. If defined, this value will be used during checkout instead of normal shipping-cost calculation. >= 0 |
| `is_free_shipping` | `boolean` | No | Flag used to indicate whether the product has free shipping. If true, the shipping cost for the product will be zero. |
| `is_visible` | `boolean` | No | Flag to determine whether the product should be displayed to customers browsing the store. If true, the product will be displayed. If false, the product will be hidden from view. |
| `is_featured` | `boolean` | No | Flag to determine whether the product should be included in the featured products panel when viewing the store. |
| `related_products` | `integer[]` | No | An array of IDs for the related products. Options are loaded from the connected account. |
| `warranty` | `string` | No | Warranty information displayed on the product page. Can include HTML formatting. >= 0 characters and <= 65535 characters |
| `bin_picking_number` | `string` | No | The BIN picking number for the product. >= 0 characters and <= 255 characters |
| `layout_file` | `string` | No | The layout template file used to render this product category. This field is writable only for stores with a Blueprint theme applied. >= 0 characters and <= 500 characters |
| `upc` | `string` | No | The product UPC code, which is used in feeds for shopping comparison sites and external channel integrations. >= 0 characters and <= 255 characters |
| `search_keywords` | `string` | No | A comma-separated list of keywords that can be used to locate the product when searching the store. >= 0 characters and <= 65535 characters |
| `availability` | `string` | No | Availability of the product. (Corresponds to the product's Purchasability section in the control panel.) Supported values: available - the product is available for purchase; disabled - the product is listed on the storefront, but cannot be purchased; preorder - the product is listed for pre-orders. Allowed values: available, disabled or preorder |
| `availability_description` | `string` | No | Availability text displayed on the checkout page, under the product title. Tells the customer how long it will normally take to ship this product, such as: 'Usually ships in 24 hours.' >= 0 characters and <= 255 characters |
| `gift_wrapping_options_type` | `string` | No | Type of gift-wrapping options. Values: any - allow any gift-wrapping options in the store; none - disallow gift-wrapping on the product; list – provide a list of IDs in the gift_wrapping_options_list field. Allowed values: any, none or list |
| `gift_wrapping_options_list` | `string[]` | No | A list of gift-wrapping option IDs. |
| `sort_order` | `integer` | No | Priority to give this product when included in product lists on category pages and in search results. Lower integers will place the product closer to the top of the results. >= -2147483648 and <= 2147483647 |
| `condition` | `string` | No | The product condition. Will be shown on the product page if the is_condition_shown field's value is true. Possible values: New, Used, Refurbished. Allowed values: New, Used and Refurbished |
| `is_condition_shown` | `boolean` | No | Flag used to determine whether the product condition is shown to the customer on the product page. |
| `order_quantity_minimum` | `integer` | No | The minimum quantity an order must contain, to be eligible to purchase this product. >= 0 and <= 1000000000 |
| `order_quantity_maximum` | `integer` | No | The maximum quantity an order can contain when purchasing the product. >= 0 and <= 1000000000 |
| `page_title` | `string` | No | Custom title for the product page. If not defined, the product name will be used as the meta title. >= 0 characters and <= 255 characters |
| `meta_keywords` | `string[]` | No | Custom meta keywords for the product page. If not defined, the store's default keywords will be used. |
| `meta_description` | `string` | No | Custom meta description for the product page. If not defined, the store's default meta description will be used. >= 0 characters and <= 65535 characters |
| `view_count` | `integer` | No | The number of times the product has been viewed. >= 0 and <= 1000000000 |
| `preorder_release_date` | `string` | No | Pre-order release date. See the availability field for details on setting a product's availability to accept pre-orders. |
| `preorder_message` | `string` | No | Custom expected-date message to display on the product page. If undefined, the message defaults to the storewide setting. Can contain the %%DATE%% placeholder, which will be substituted for the release date. >= 0 characters and <= 255 characters |
| `is_preorder_only` | `boolean` | No | If set to true then on the preorder release date the preorder status will automatically be removed. If set to false, then on the release date the preorder status will not be removed. It will need to be changed manually either in the control panel or using the API. Using the API set availability to available. |
| `is_price_hidden` | `boolean` | No | False by default, indicating that this product's price should be shown on the product page. If set to true, the price is hidden. (NOTE: To successfully set is_price_hidden to true, the availability value must be disabled.) |
| `price_hidden_label` | `string` | No | By default, an empty string. If is_price_hidden is true, the value of price_hidden_label is displayed instead of the price. (NOTE: To successfully set a non-empty string value with is_price_hidden set to true, the availability value must be disabled.) >= 0 characters and <= 200 characters |
| `open_graph_type` | `string` | No | Type of product, defaults to product. Allowed values: product, album, book, drink, food, game, movie, song OR tv_show |
| `open_graph_title` | `string` | No | Title of the product, if not specified the product name will be used instead. |
| `open_graph_description` | `string` | No | Description to use for the product, if not specified then the meta_description will be used instead. |
| `open_graph_use_meta_description` | `boolean` | No | Flag to determine if product description or open graph description is used. |
| `open_graph_use_product_name` | `boolean` | No | Flag to determine if product name or open graph name is used. |
| `open_graph_use_image` | `boolean` | No | Flag to determine if product image or open graph image is used. |
| `brand_name` | `string` | No | It performs a fuzzy match and adds the brand. eg. "Common Good" and "Common good" are the same. Brand name does not return as part of a product response. Only the brand_id. |
| `gtin` | `string` | No | Global Trade Item Number |
| `mpn` | `string` | No | Manufacturer Part Number |
| `reviews_rating_sum` | `any` | No | The total rating for the product. |
| `reviews_count` | `integer` | No | The number of times the product has been rated. |
| `total_sold` | `integer` | No | The total quantity of this product sold. |
| `images` | `string[]` | No | Array of image strings. They can be either local paths or URLs. Limit of 8MB per file. If it is a URL it has a 255 character limit. Supported image file types are BMP, GIF, JPEG, PNG, WBMP, XBM, and WEBP. If it is a local path it should be previously downloaded to Pipedream E.g. (/tmp/my-image.png). Download a file to the /tmp directory |

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

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: "bigcommerce-create-product",
  arguments: {
    name: "Name",
    type: "Type",
  },
})
```

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

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": "bigcommerce-create-product",
    "configured_props": {
      "bigcommerce": { "authProvisionId": "apn_xxxxxxx" },
      "name": "Name",
      "type": "Type"
    }
  }'
```

---

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