Skip to main content
object

Requires read_products access scope.

The ProductVariant object represents a version of a product that comes in more than one option, such as size or color. For example, if a merchant sells t-shirts with options for size and color, then a small, blue t-shirt would be one product variant and a large, blue t-shirt would be another.

Use the ProductVariant object to manage the full lifecycle and configuration of a product's variants. Common use cases for using the ProductVariant object include:

  • Tracking inventory for each variant
  • Setting unique prices for each variant
  • Assigning barcodes and SKUs to connect variants to fulfillment services
  • Attaching variant-specific images and media
  • Setting delivery and tax requirements
  • Supporting product bundles, subscriptions, and selling plans

A ProductVariant is associated with a parent Product object. ProductVariant serves as the central link between a product's merchandising configuration, inventory, pricing, fulfillment, and sales channels within the GraphQL Admin API schema. Each variant can reference other GraphQL types such as:

Learn more about Shopify's product model.

Anchor to Fields and connectionsFields and connections

Boolean!
non-null

Whether the product variant is available for sale.

String

The value of the barcode associated with the product.

Money

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

ProductVariantContextualPricing!
non-null

The pricing that applies for a customer in a given context. As of API version 2025-04, only active markets are considered in the price resolution.

DateTime!
non-null

The date and time when the variant was created.

String!
non-null

A default cursor that returns the single next record, sorted ascending by ID.

DeliveryProfile

The delivery profile for the variant.

Anchor to deliveryPromiseParticipantsdeliveryPromiseParticipants
[DeliveryPromiseParticipant!]!
non-null

The delivery promise participants for the product variant.

String!
non-null

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

ID!
non-null

A globally-unique ID.

Image

The featured image for the variant.

InventoryItem!
non-null

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

ProductVariantInventoryPolicy!
non-null

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

Int

The total sellable quantity of the variant.

UnsignedInt64!
non-null

The ID of the corresponding resource in the REST Admin API.

Metafield

A custom field, including its namespace and key, that's associated with a Shopify resource for the purposes of adding and storing additional information.

MetafieldConnection!
non-null

A list of custom fields that a merchant associates with a Shopify resource.

Anchor to metafieldsByIdentifiersmetafieldsByIdentifiers
[Metafield]!
non-null

The metafields associated with the resource matching the supplied list of namespaces and keys.

Int!
non-null

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

Money!
non-null

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

Product!
non-null

The product that this variant belongs to.

ProductConnection!
non-null

A list of products that have product variants that contain this variant as a product component.

Anchor to productVariantComponentsproductVariantComponents
ProductVariantComponentConnection!
non-null

A list of the product variant components.

Boolean!
non-null

Whether a product variant requires components. The default value is false. If true, then the product variant can only be purchased as a parent bundle with components and it will be omitted from channels that don't support bundles.

[SelectedOption!]!
non-null

List of product options applied to the variant.

Anchor to sellableOnlineQuantitysellableOnlineQuantity
Int!
non-null

The total sellable quantity of the variant for online channels. This doesn't represent the total available inventory or capture limitations based on customer location.

SellingPlanGroupConnection!
non-null

A list of all selling plan groups defined in the current shop associated with the product variant.

Anchor to sellingPlanGroupsCountsellingPlanGroupsCount
Count

Count of selling plan groups associated with the product variant.

Boolean!
non-null

Whether to show the unit price for this product variant.

String

A case-sensitive identifier for the product variant in the shop. Required in order to connect to a fulfillment service.

Boolean!
non-null

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

String

The tax code for the product variant.

String!
non-null

The title of the product variant.

[Translation!]!
non-null

The published translations associated with the resource.

MoneyV2

The unit price value for the variant based on the variant measurement.

Anchor to unitPriceMeasurementunitPriceMeasurement
UnitPriceMeasurement

The unit price measurement for the variant.

DateTime!
non-null

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

Deprecated fields and connections

Anchor to metafieldDefinitionsmetafieldDefinitions
MetafieldDefinitionConnection!
non-nullDeprecated
ProductVariantPricePairConnection!
non-nullDeprecated
Anchor to sellingPlanGroupCountsellingPlanGroupCount
Int!
non-nullDeprecated
StorefrontID!
non-nullDeprecated

Was this section helpful?

query

Retrieves a product variant by its ID.

A product variant is a specific version of a product that comes in more than one option, such as size or color. For example, if a merchant sells t-shirts with options for size and color, then a small, blue t-shirt would be one product variant and a large, blue t-shirt would be another.

Use the productVariant query when you need to:

  • Access essential product variant data (for example, title, price, image, and metafields).
  • Build product detail pages and manage inventory.
  • Handle international sales with localized pricing and content.
  • Manage product variants that are part of a bundle or selling plan.

Learn more about working with Shopify's product model.

query

Return a product variant by an identifier.

query

Retrieves a list of product variants associated with a product.

A product variant is a specific version of a product that comes in more than one option, such as size or color. For example, if a merchant sells t-shirts with options for size and color, then a small, blue t-shirt would be one product variant and a large, blue t-shirt would be another.

Use the productVariants query when you need to:

  • Search for product variants by attributes such as SKU, barcode, or inventory quantity.
  • Filter product variants by attributes, such as whether they're gift cards or have custom metafields.
  • Fetch product variants for bulk operations, such as updating prices or inventory.
  • Preload data for product variants, such as inventory items, selected options, or associated products.

The productVariants query supports pagination to handle large product catalogs and saved searches for frequently used product variant queries.

The productVariants query returns product variants with their associated metadata, including:

  • Basic product variant information (for example, title, SKU, barcode, price, and inventory)
  • Media attachments (for example, images and videos)
  • Associated products, selling plans, bundles, and metafields

Learn more about working with Shopify's product model.


Was this section helpful?

mutation

Appends media from a product to variants of the product.

Arguments

ID!
required

Specifies the product associated to the media.

[ProductVariantAppendMediaInput!]!
required

A list of pairs of variants and media to be attached to the variants.


Fields

Product

The product associated with the variants and media.

[ProductVariant!]

The product variants that were updated.

[MediaUserError!]!
non-null

The list of errors that occurred from executing the mutation.

mutation

Detaches media from product variants.

Arguments

ID!
required

Specifies the product to which the variants and media are associated.

[ProductVariantDetachMediaInput!]!
required

A list of pairs of variants and media to be deleted from the variants.


Fields

Product

The product associated with the variants and media.

[ProductVariant!]

The product variants that were updated.

[MediaUserError!]!
non-null

The list of errors that occurred from executing the mutation.

mutation

Adds multiple selling plan groups to a product variant.

Arguments

ID!
required

The ID of the product variant.

[ID!]!
required

The IDs of the selling plan groups to add.


Fields

ProductVariant

The product variant object.

[SellingPlanGroupUserError!]!
non-null

The list of errors that occurred from executing the mutation.

mutation

Remove multiple groups from a product variant.

Arguments

ID!
required

The ID of the product variant.

[ID!]!
required

The IDs of the selling plan groups to leave.


Fields

ProductVariant

The product variant object.

[SellingPlanGroupUserError!]!
non-null

The list of errors that occurred from executing the mutation.

mutation

Creates new bundles, updates existing bundles, and removes bundle components for one or multiple bundles.

Arguments

[ProductVariantRelationshipUpdateInput!]!
required

The input options for the product variant being updated.


Fields

Anchor to parentProductVariantsparentProductVariants
[ProductVariant!]

The product variants with successfully updated product variant relationships.

[ProductVariantRelationshipBulkUpdateUserError!]!
non-null

The list of errors that occurred from executing the mutation.

mutation

Creates multiple product variants for a single product in one operation. You can run this mutation directly or as part of a bulk operation for large-scale catalog updates.

Use the productVariantsBulkCreate mutation to efficiently add new product variants—such as different sizes, colors, or materials—to an existing product. The mutation is helpful if you need to add product variants in bulk, such as importing from an external system.

The mutation supports:

  • Creating variants with custom options and values
  • Associating media (for example, images, videos, and 3D models) with the product or its variants
  • Handling complex product configurations

Note

By default, stores have a limit of 100 product variants for each product. You can create a development store and enable the Extended Variants developer preview to create a maximum of 2,048 product variants in a single operation.


After creating variants, you can make additional changes using one of the following mutations:

  • productVariantsBulkUpdate: Updates multiple product variants for a single product in one operation.
  • productSet: Used to perform multiple operations on products, such as creating or modifying product options and variants.

You can also specifically manage product options through related mutations:

Learn more about the product model and adding product data.

Arguments

[CreateMediaInput!]

List of new media to be added to the product.

ID!
required

The ID of the product on which to create the variants.

ProductVariantsBulkCreateStrategy
Default:DEFAULT

The strategy defines which behavior the mutation should observe, such as whether to keep or delete the standalone variant (when product has only a single or default variant) when creating new variants in bulk.

[ProductVariantsBulkInput!]!
required

An array of product variants to be created.


Fields

Product

The updated product object.

[ProductVariant!]

The newly created variants.

[ProductVariantsBulkCreateUserError!]!
non-null

The list of errors that occurred from executing the mutation.

mutation

Updates multiple product variants for a single product in one operation. You can run this mutation directly or as part of a bulk operation for large-scale catalog updates.

Use the productVariantsBulkUpdate mutation to efficiently modify product variants—such as different sizes, colors, or materials—associated with an existing product. The mutation is helpful if you need to update a product's variants in bulk, such as importing from an external system.

The mutation supports:

  • Updating variants with custom options and values
  • Associating media (for example, images, videos, and 3D models) with the product or its variants
  • Handling complex product configurations

Note

By default, stores have a limit of 100 product variants for each product. You can create a development store and enable the Extended Variants developer preview to update a maximum of 2,048 product variants in a single operation.


After creating variants, you can make additional changes using the productSet mutation, which is used to perform multiple operations on products, such as creating or modifying product options and variants.

You can also specifically manage product options through related mutations:

Learn more about the product model and adding product data.

Arguments

Boolean
Default:false

When partial updates are allowed, valid variant changes may be persisted even if some of the variants updated have invalid data and cannot be persisted. When partial updates are not allowed, any error will prevent all variants from updating.

[CreateMediaInput!]

List of new media to be added to the product.

ID!
required

The ID of the product associated with the variants to update.

[ProductVariantsBulkInput!]!
required

An array of product variants to update.


Fields

Product

The updated product object.

[ProductVariant!]

The updated variants.

[ProductVariantsBulkUpdateUserError!]!
non-null

The list of errors that occurred from executing the mutation.

mutation

Updates quantity pricing on a price list. You can use the quantityPricingByVariantUpdate mutation to set fixed prices, quantity rules, and quantity price breaks. This mutation does not allow partial successes. If any of the requested resources fail to update, none of the requested resources will be updated. Delete operations are executed before create operations.

Arguments

QuantityPricingByVariantUpdateInput!
required

The input data used to update the quantity pricing in the price list.

ID!
required

The ID of the price list for which quantity pricing will be updated.


Fields

[ProductVariant!]

The variants for which quantity pricing was created successfully in the price list.

[QuantityPricingByVariantUserError!]!
non-null

The list of errors that occurred from executing the mutation.


Was this section helpful?