Product

Required access

unauthenticated_read_product_listings access scope

A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty).

Show definition
# A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be.
# For example, a digital download (such as a movie, music or ebook file) also
# qualifies as a product, as do services (such as equipment rental, work for hire,
# customization of another product or an extended warranty).
type Product implements Node {
  # Globally unique identifier.
  id: ID!

  # List of collections a product belongs to.
  collections(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false
  ): CollectionConnection!

  # The date and time when the product was created.
  createdAt: DateTime!

  # Stripped description of the product, single line with HTML tags removed.
  description(
    # Truncates string after the given length.
    truncateAt: Int
  ): String!

  # The description of the product, complete with HTML formatting.
  descriptionHtml: HTML!

  # A human-friendly unique string for the Product automatically generated from its title.
  # They are used by the Liquid templating language to refer to objects.
  handle: String!

  # List of images associated with the product.
  images(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: ProductImageSortKeys = POSITION

    # Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead.
    maxWidth: Int

    # Image height in pixels between 1 and 2048. This argument is deprecated: Use
    # `maxHeight` on `Image.transformedSrc` instead.
    maxHeight: Int

    # Crops the image according to the specified region. This argument is
    # deprecated: Use `crop` on `Image.transformedSrc` instead.
    crop: CropRegion

    # Image size multiplier for high-resolution retina displays. Must be between 1
    # and 3. This argument is deprecated: Use `scale` on `Image.transformedSrc` instead.
    scale: Int = 1
  ): ImageConnection!

  # The online store URL for the product.
  # A value of `null` indicates that the product is not published to the Online Store sales channel.
  onlineStoreUrl: URL

  # List of custom product options (maximum of 3 per product).
  options(
    # Truncate the array result to this size.
    first: Int
  ): [ProductOption!]!

  # A categorization that a product can be tagged with, commonly used for filtering and searching.
  productType: String!

  # The date and time when the product was published to the channel.
  publishedAt: DateTime!

  # A categorization that a product can be tagged with, commonly used for filtering and searching.
  # Each comma-separated tag has a character limit of 255.
  tags: [String!]!

  # The product’s title.
  title: String!

  # The date and time when the product was last modified.
  updatedAt: DateTime!

  # Find a product’s variant based on its selected options.
  # This is useful for converting a user’s selection of product options into a single matching variant.
  # If there is not a variant for the selected options, `null` will be returned.
  variantBySelectedOptions(selectedOptions: [SelectedOptionInput!]!): ProductVariant

  # List of the product’s variants.
  variants(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: ProductVariantSortKeys = POSITION
  ): ProductVariantConnection!

  # The product’s vendor name.
  vendor: String!
}

Implements

Connections

collections   (CollectionConnection!)

List of collections a product belongs to.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

reverse Boolean false

Reverse the order of the underlying list.

images   (ImageConnection!)

List of images associated with the product.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

crop CropRegion

Crops the image according to the specified region. This argument is deprecated: Use crop on Image.transformedSrc instead.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

maxHeight Int

Image height in pixels between 1 and 2048. This argument is deprecated: Use maxHeight on Image.transformedSrc instead.

maxWidth Int

Image width in pixels between 1 and 2048. This argument is deprecated: Use maxWidth on Image.transformedSrc instead.

reverse Boolean false

Reverse the order of the underlying list.

scale Int 1

Image size multiplier for high-resolution retina displays. Must be between 1 and 3. This argument is deprecated: Use scale on Image.transformedSrc instead.

sortKey ProductImageSortKeys POSITION

Sort the underlying list by the given key.

variants   (ProductVariantConnection!)

List of the product’s variants.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

reverse Boolean false

Reverse the order of the underlying list.

sortKey ProductVariantSortKeys POSITION

Sort the underlying list by the given key.

Fields

createdAt   (DateTime!)

The date and time when the product was created.

description   (String!)

Stripped description of the product, single line with HTML tags removed.

Argument Type Default Description
truncateAt Int

Truncates string after the given length.

descriptionHtml   (HTML!)

The description of the product, complete with HTML formatting.

handle   (String!)

A human-friendly unique string for the Product automatically generated from its title. They are used by the Liquid templating language to refer to objects.

id   (ID!)

Globally unique identifier.

onlineStoreUrl   (URL)

The online store URL for the product. A value of null indicates that the product is not published to the Online Store sales channel.

options   ([ProductOption!]!)

List of custom product options (maximum of 3 per product).

Argument Type Default Description
first Int

Truncate the array result to this size.

productType   (String!)

A categorization that a product can be tagged with, commonly used for filtering and searching.

publishedAt   (DateTime!)

The date and time when the product was published to the channel.

tags   ([String!]!)

A categorization that a product can be tagged with, commonly used for filtering and searching. Each comma-separated tag has a character limit of 255.

title   (String!)

The product’s title.

updatedAt   (DateTime!)

The date and time when the product was last modified.

variantBySelectedOptions   (ProductVariant)

Find a product’s variant based on its selected options. This is useful for converting a user’s selection of product options into a single matching variant. If there is not a variant for the selected options, null will be returned.

Argument Type Default Description
selectedOptions required [SelectedOptionInput!]!

vendor   (String!)

The product’s vendor name.