---
title: "Product"
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/objects/product'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/objects/product.md'
---
# Product

产品资源支持对商家商店内的商品进行管理

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

## Type Signature

`Product`

## Fields

* `collections`

  [CollectionConnection](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/objects/collection-connection.md)

  包含该产品的分类的列表

* `compareAtPriceRange`

  [ProductCompareAtPriceRange](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/objects/product-compare-at-price-range.md)

  以默认商店货币表示的产品原价范围

* `createdAt`

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

  创建产品时的日期和时间

* `descriptionHtml`

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

  产品的描述，包括 HTML 格式

* `featuredImage`

  [Image](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common-objects/objects/image.md)

  产品特色图片

* `featuredMedia`

  [Media](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common-objects/interfaces/media.md)

  产品的特色媒体

* `handle`

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

  产品的handle

* `hasOnlyDefaultVariant`

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

  如果该值为 true，则表示该产品只有一种具有默认选项和值的变体

* `id`

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

  产品ID，通用的唯一标识符

* `images`

  [ImageConnection](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common-objects/objects/image-connection.md)

  与产品相关的图像

* `inCollection`

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

  确定产品是否属于指定分类

* `isGiftCard`

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

  是否礼品卡商品

* `media`

  [MediaConnection](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common-objects/objects/media-connection.md)

  与产品相关的媒体。这可以包括图像、视频

* `mediaCount`

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

  与产品关联的媒体总数

* `onlineStorePreviewUrl`

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

  用于预览在线商店的 URL

* `onlineStoreUrl`

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

  在线商店中产品的 URL。如果未发布到在线商店，则该值为空

* `options`

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

  产品的选项列表

* `priceRange`

  [ProductPriceRange](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/objects/product-price-range.md)

  产品的价格范围，格式为小数价格

* `productCategory`

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

  商家指定的产品标准类型

* `productType`

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

  商家自定义的一个产品类型

* `publishedAt`

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

  产品发布到在线商店的日期和时间（采用 ISO 8601 格式）

* `publishedInContext`

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

  产品是否在给定的条件中对客户可见

* `resourcePublicationsV2`

  [ResourcePublicationV2Connection](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/apps/objects/resource-publication-v2-connection.md)

  已发布或准备发布的资源列表

* `spu`

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

  产品的SPU码

* `status`

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

  产品状态

* `subtitle`

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

  产品摘要

* `tags`

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

  产品标签

* `title`

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

  产品标题

* `totalInventory`

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

  产品的可用库存数量

* `totalVariants`

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

  产品变体数量

* `tracksInventory`

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

  产品是否启用库存跟踪

* `updatedAt`

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

  产品最后修改的日期和时间

* `variants`

  [ProductVariantConnection](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/objects/product-variant-connection.md)

  产品的变体列表

* `vendor`

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

  产品品牌

## Schema Definition

```graphql
type Product { 
	collections(after,String,reverse,Boolean,sortKey,CollectionSortKeys,first,Int,last,Int,before,String): CollectionConnection
	compareAtPriceRange: ProductCompareAtPriceRange
	createdAt: Date!
	descriptionHtml: String
	featuredImage: Image
	featuredMedia: Media
	handle: String!
	hasOnlyDefaultVariant: Boolean!
	id: ID!
	images(first,Int,before,String,after,String,last,Int,reverse,Boolean,sortKey,ProductImageSortKeys): ImageConnection
	inCollection(id,ID!): Boolean
	isGiftCard: Boolean!
	media(reverse,Boolean,sortKey,ProductMediaSortKeys,first,Int,after,String,before,String,last,Int): MediaConnection
	mediaCount: Int!
	onlineStorePreviewUrl: URL
	onlineStoreUrl: URL
	options: [ProductOption]
	priceRange: ProductPriceRange
	productCategory: ProductCategory
	productType: String
	publishedAt: Date
	publishedInContext(context,ContextualPublicationContextInput!): Boolean!
	resourcePublicationsV2(first,Int,last,Int,before,String,after,String,reverse,Boolean,onlyPublished,Boolean,catalogType,CatalogType): ResourcePublicationV2Connection
	spu: String
	status: ProductStatus!
	subtitle: String
	tags: [String]
	title: String!
	totalInventory: Int!
	totalVariants: Int!
	tracksInventory: Boolean!
	updatedAt: Date
	variants(first,Int,last,Int,before,String,after,String,reverse,Boolean): ProductVariantConnection
	vendor: String 
}
```

## Field from

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

  更新后的产品实例

* [ProductConnection](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/objects/product-connection.md).nodes

  ProductEdge 中包含的节点列表

* [ProductVariantsBulkUpdatePayload](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/objects/product-variants-bulk-update-payload.md).product

  更新后的产品对象

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

  创建的产品对象

* [ProductVariantsBulkDeletePayload](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/objects/product-variants-bulk-delete-payload.md).product

  更新后的产品对象。

* [ProductVariantsBulkCreatePayload](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/objects/product-variants-bulk-create-payload.md).product

  更新后的产品对象

* [ProductVariant](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/objects/product-variant.md).product

  该变体所属的产品

* [ProductEdge](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/objects/product-edge.md).node

  产品的节点

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

  批量创建产品变体。如果您想创建单个变体，请使用productVariantCreate。

* [Query](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/queries/product-by-handle.md).productByHandle

  通过handle返回商品

## Error Handling

关于更多通用错误码说明，参考：[状态码和错误码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes)。

