ProductVariant

Required access

read_products access scope

Represents a product variant.

Show definition
# Represents a product variant.
type ProductVariant implements HasMetafields, Navigable, Node {
  # Whether the product variant is available for sale.
  availableForSale: Boolean!

  # The value of the barcode associated with the product.
  barcode: String

  # The compare-at price of the variant in the default shop currency.
  compareAtPrice: Money

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

  # A default cursor for use in pagination.
  defaultCursor: String!

  # Display name of the variant, based on product's title + variant's title.
  displayName: String!

  # The fulfillment service associated with the product.
  fulfillmentService: FulfillmentService

  # The Harmonized System Code (or HS Tariff Code) for the variant.
  harmonizedSystemCode: String

  # Globally unique identifier.
  id: ID!

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

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

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

    # 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
  ): Image

  # The featured image for the variant.
  images(
    # Crops the image according to the specified region. This argument is
    # deprecated: Use `crop` on `Image.transformedSrc` instead.
    crop: CropRegion

    # Truncate the array result to this size.
    first: Int

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

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

    # 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
  ): [Image!]!

  # The ID for the inventory item, which is used to query for inventory information.
  inventoryItem: InventoryItem!

  # The fulfillment service that tracks the number of items in stock for the product variant.
  inventoryManagement: ProductVariantInventoryManagement!

  # Whether customers are allowed to place an order for the product variant when it's out of stock.
  inventoryPolicy: ProductVariantInventoryPolicy!

  # The total sellable quantity of the variant.
  inventoryQuantity: Int

  # The metafield associated with the resource.
  metafield(
    # Identifier for the metafield (maximum of 30 characters).
    key: String!

    # Container for a set of metafields (maximum of 20 characters).
    namespace: String!
  ): Metafield

  # A paginated list of metafields associated with the resource.
  metafields(
    # Returns the elements that come after the specified cursor.
    after: String

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

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

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

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

  # The order of the product variant in the list of product variants. The first position in the list is 1.
  position: Int!

  # The price of the product variant in the default shop currency.
  price: Money!

  # The product that this variant belongs to.
  product: Product!

  # Whether a customer needs to provide a shipping address when placing an order for the product variant.
  requiresShipping: Boolean!

  # List of product options applied to the variant.
  selectedOptions: [SelectedOption!]!

  # An identifier for the product variant in the shop. Required in order to connect to a fulfillment service.
  sku: String

  # The storefront ID of the product variant.
  storefrontId: StorefrontID!

  # Whether a tax is charged when the product variant is sold.
  taxable: Boolean!

  # The title of the product variant.
  title: String!

  # The date and time (ISO 8601 format) when the product variant was last modified.
  updatedAt: DateTime!

  # The weight of the product variant in the unit system specified with weight_unit.
  weight: Float

  # The unit of measurement that applies to the product variant's weight. If you
  # don't specify a value for weight_unit, then the shop's default unit of
  # measurement is applied. Valid values: `g`, `kg`, `oz`, `lb`.
  weightUnit: WeightUnit!
}

Implements

Connections

metafields   (MetafieldConnection!)

A paginated list of metafields associated with the resource.

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.

Fields

availableForSale   (Boolean!)

Whether the product variant is available for sale.

barcode   (String)

The value of the barcode associated with the product.

compareAtPrice   (Money)

The compare-at price of the variant in the default shop currency.

createdAt   (DateTime!)

The date and time when the variant was created.

defaultCursor   (String!)

A default cursor for use in pagination.

displayName   (String!)

Display name of the variant, based on product's title + variant's title.

fulfillmentService   (FulfillmentService)

The fulfillment service associated with the product.

harmonizedSystemCode   (String)

The Harmonized System Code (or HS Tariff Code) for the variant.

id   (ID!)

Globally unique identifier.

image   (Image)

The featured image for the variant.

Argument Type Default Description
crop

CropRegion

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

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.

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.

inventoryItem   (InventoryItem!)

The ID for the inventory item, which is used to query for inventory information.

inventoryManagement   (ProductVariantInventoryManagement!)

The fulfillment service that tracks the number of items in stock for the product variant.

inventoryPolicy   (ProductVariantInventoryPolicy!)

Whether customers are allowed to place an order for the product variant when it's out of stock.

inventoryQuantity   (Int)

The total sellable quantity of the variant.

metafield   (Metafield)

The metafield associated with the resource.

Argument Type Default Description
key

required

String!

Identifier for the metafield (maximum of 30 characters).

namespace

required

String!

Container for a set of metafields (maximum of 20 characters).

position   (Int!)

The order of the product variant in the list of product variants. The first position in the list is 1.

price   (Money!)

The price of the product variant in the default shop currency.

product   (Product!)

The product that this variant belongs to.

requiresShipping   (Boolean!)

Whether a customer needs to provide a shipping address when placing an order for the product variant.

selectedOptions   ([SelectedOption!]!)

List of product options applied to the variant.

sku   (String)

An identifier for the product variant in the shop. Required in order to connect to a fulfillment service.

storefrontId   (StorefrontID!)

The storefront ID of the product variant.

taxable   (Boolean!)

Whether a tax is charged when the product variant is sold.

title   (String!)

The title of the product variant.

updatedAt   (DateTime!)

The date and time (ISO 8601 format) when the product variant was last modified.

weight   (Float)

The weight of the product variant in the unit system specified with weight_unit.

weightUnit   (WeightUnit!)

The unit of measurement that applies to the product variant's weight. If you don't specify a value for weight_unit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, lb.

Deprecated fields

Show/Hide

images   ([Image!]!)

deprecated

The featured image for the variant.

Deprecation warning

Use the singular image field instead. There may never be more than one variant image.

Argument Type Default Description
crop

CropRegion

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

first

Int

Truncate the array result to this size.

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.

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.

Sign up for a Partner account to get started.

Sign up