Skip to main content

ProductType Object

Represents a type of product. It defines what attributes are available to products of this type.

type ProductType implements Node, ObjectWithMetadata {
id: ID!
privateMetadata: [MetadataItem!]!
privateMetafield(
key: String!
): String
privateMetafields(
keys: [String!]
): Metadata
metadata: [MetadataItem!]!
metafield(
key: String!
): String
metafields(
keys: [String!]
): Metadata
name: String!
slug: String!
hasVariants: Boolean! @deprecated
isShippingRequired: Boolean!
isDigital: Boolean! @deprecated
weight: Weight
kind: ProductTypeKindEnum!
products(
channel: String
before: String
after: String
first: Int
last: Int
): ProductCountableConnection @deprecated
taxType: TaxType @deprecated
taxClass: TaxClass
variantAttributes(
variantSelection: VariantAttributeScope
): [Attribute!] @deprecated
assignedVariantAttributes(
variantSelection: VariantAttributeScope
): [AssignedVariantAttribute!]
productAttributes: [Attribute!]
availableAttributes(
filter: AttributeFilterInput
where: AttributeWhereInput
search: String
before: String
after: String
first: Int
last: Int
): AttributeCountableConnection
}

Fields​

id ● ID!​

The ID of the product type.

privateMetadata ● [MetadataItem!]!​

List of private metadata items. Requires staff permissions to access.

privateMetafield ● String​

A single key from private metadata. Requires staff permissions to access.

Tip: Use GraphQL aliases to fetch multiple keys.

key ● String!​

privateMetafields ● Metadata​

Private metadata. Requires staff permissions to access. Use keys to control which fields you want to include. The default is to include everything.

keys ● [String!]​

metadata ● [MetadataItem!]!​

List of public metadata items. Can be accessed without permissions.

metafield ● String​

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

key ● String!​

metafields ● Metadata​

Public metadata. Use keys to control which fields you want to include. The default is to include everything.

keys ● [String!]​

name ● String!​

Name of the product type.

slug ● String!​

Slug of the product type.

isShippingRequired ● Boolean!​

Whether shipping is required for this product type.

weight ● Weight​

Weight of the product type.

kind ● ProductTypeKindEnum!​

The product type kind.

taxClass ● TaxClass​

Tax class assigned to this product type. All products of this product type use this tax class, unless it's overridden in the Product type.

Requires one of the following permissions: AUTHENTICATED_STAFF_USERAUTHENTICATED_APP

assignedVariantAttributes ● [AssignedVariantAttribute!]​

Variant attributes of that product type with attached variant selection.

variantSelection ● VariantAttributeScope​

Define scope of returned attributes.

productAttributes ● [Attribute!]​

Product attributes of that product type.

availableAttributes ● AttributeCountableConnection​

List of attributes which can be assigned to this product type.

Requires the MANAGE_PRODUCTSpermission.
filter ● AttributeFilterInput​
DEPRECATED

Use where filter instead.

Filtering options for attributes of this product type.

where ● AttributeWhereInput​

Where filtering options for attributes of this product type.

Search attributes.

before ● String​

Return the elements in the list that come before the specified cursor.

after ● String​

Return the elements in the list that come after the specified cursor.

first ● Int​

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

last ● Int​

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

Show deprecatedHide deprecated

hasVariants ● Boolean!​

DEPRECATED

This is a leftover from the past Simple/Configurable product distinction. Products can have multiple variants regardless of this setting.

Whether the product type has variants.

isDigital ● Boolean!​

DEPRECATED

Will be removed in v3.24.0, use metadata or attributes instead.

Whether the product type is digital - doesn't have any effect, it's present for backward-compatibility.

products ● ProductCountableConnection​

DEPRECATED

Use the top-level products query with the productTypes filter.

List of products of this type.

channel ● String​

Slug of a channel for which the data should be returned.

before ● String​

Return the elements in the list that come before the specified cursor.

after ● String​

Return the elements in the list that come after the specified cursor.

first ● Int​

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

last ● Int​

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

taxType ● TaxType​

DEPRECATED

Use taxClass field instead.

A type of tax. Assigned by enabled tax gateway

variantAttributes ● [Attribute!]​

DEPRECATED

Use assignedVariantAttributes instead.

Variant attributes of that product type.

variantSelection ● VariantAttributeScope​

Define scope of returned attributes.

Interfaces​

Node​

An object with an ID

ObjectWithMetadata​

Returned By​

productType query

Member Of​

Product object ● ProductAttributeAssign object ● ProductAttributeAssignmentUpdate object ● ProductAttributeUnassign object ● ProductTypeCountableEdge object ● ProductTypeCreate object ● ProductTypeDelete object ● ProductTypeReorderAttributes object ● ProductTypeUpdate object

Implemented By​

_Entity union ● ReferenceType union