---
title: "ProductInput"
description: "商品相关的输入字段。"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/inputs/product-input'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/inputs/product-input.md'
---
# ProductInput

商品相关的输入字段。

- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Input

## Input Fields

* `id`

  [ID](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/id.md)

  商品的唯一标识 ID。用于在 `productUpdate` 接口中指定要更新的商品。若在 `productCreate` 接口中传入该参数，系统将忽略。<br/>
  最大长度限制：64 

* `collectionsToJoin`

  [[ID!]](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/id.md)

  该产品将添加到的分类的 ID。

* `collectionsToLeave`

  [[ID!]](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/id.md)

  分类的 ID。该产品将从这些分类中移除。

* `descriptionHtml`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  商品的描述。<br/>
  最大容量限制：512 KB

* `giftCard`

  [Boolean](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/boolean.md)

  表明是否为礼品卡商品。
  
  - `true`：该商品为礼品卡商品。
  - `false`：该商品非礼品卡商品。

* `handle`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  商品的语义化的唯一标识，默认基于 `title` 生成。<br/>
  最大长度限制： 255

* `options`

  [[String!]](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  商品规格列表。<br/>
  最大个数限制：5

* `productCategory`

  [ProductCategoryInput](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/inputs/product-category-input.md)

  商家给产品分配的标准分类。

* `productType`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  商家自定义的商品类型。<br/>
  最大长度限制：255

* `status`

  [ProductStatus](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/enums/product-status.md)

  商品的状态。

* `tags`

  [[String!]](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  商品的标签列表。<br/>
  最大个数限制：250<br/>
  单字符串最大长度限制：255

* `title`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  商品的标题。<br/>
  最大长度限制：255

* `variants`

  [[ProductVariantInput!]](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/inputs/product-variant-input.md)

  商品款式列表。<br/>
  最大个数限制：500

* `vendor`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  商品的品牌或厂商。<br/>
  最大长度限制：255

* `publishDate`

  [Date](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/date.md)

  商品发布到在线商店的时间。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。
  
  :::danger
  **废弃**：该字段自 API 版本 v20241201 起已废弃。
  :::

* `path`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  商品的相对路径。<br/>
  最大长度限制：512

* `spu`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  商家为商品自定义的标识。<br/>
  最大个数限制：255

* `subtitle`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  商品的摘要。<br/>
  最大长度限制：400

* `templateSuffix`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  商品的主题模板。

## Argument from

* [Mutation](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/mutations/product-create.md).productCreate

* [Mutation](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/mutations/product-update.md).productUpdate

