Product Variant
Requires access scope.
A specific version of a product available for sale, differentiated by options like size or color. For example, a small blue t-shirt and a large blue t-shirt are separate variants of the same product. For more information, see the docs on Shopify's product model.
For products with quantity rules, variants enforce minimum, maximum, and increment constraints on purchases.
Variants also support subscriptions and pre-orders through selling plan allocations objects, bundle configurations through product variant components objects, and shop pay installments pricing for flexible payment options.
Anchor to FieldsFields
- availableForSale (Boolean!)
- barcode (String)
- compareAtPrice (MoneyV2)
- components (ProductVariantComponentConnection!)
- currentlyNotInStock (Boolean!)
- groupedBy (ProductVariantConnection!)
- id (ID!)
- image (Image)
- metafield (Metafield)
- metafields ([Metafield]!)
- price (MoneyV2!)
- product (Product!)
- quantityAvailable (Int)
- quantityPriceBreaks (QuantityPriceBreakConnection!)
- quantityRule (QuantityRule!)
- requiresComponents (Boolean!)
- requiresShipping (Boolean!)
- selectedOptions ([SelectedOption!]!)
- sellingPlanAllocations (SellingPlanAllocationConnection!)
- shopPayInstallmentsPricing (ShopPayInstallmentsProductVariantPricing)
- sku (String)
- storeAvailability (StoreAvailabilityConnection!)
- taxable (Boolean!)
- title (String!)
- unitPrice (MoneyV2)
- unitPriceMeasurement (UnitPriceMeasurement)
- weight (Float)
- weightUnit (WeightUnit!)
- Anchor to availableForSaleavailable•Boolean!
For Sale non-null Indicates if the product variant is available for sale.
- Anchor to barcodebarcode•String
The barcode (for example, ISBN, UPC, or GTIN) associated with the variant.
- Anchor to compareAtPricecompare•Money
At Price V2 The compare at price of the variant. This can be used to mark a variant as on sale, when
is higher thanprice.- Anchor to componentscomponents•Product
Variant Component Connection! non-null List of bundles components included in the variant considering only fixed bundles.
- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
Arguments
- Anchor to currentlyNotInStockcurrently•Boolean!
Not In Stock non-null Whether a product is out of stock but still available for purchase (used for backorders).
- Anchor to groupedBygrouped•Product
By Variant Connection! non-null List of bundles that include this variant considering only fixed bundles.
- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
Arguments
- •ID!non-null
A globally-unique ID.
- Anchor to imageimage•Image
Image associated with the product variant. This field falls back to the product image if no image is available.
- Anchor to metafieldmetafield•MetafieldToken access required
A custom field, including its
namespaceandkey, that's associated with a Shopify resource for the purposes of adding and storing additional information.- Anchor to namespacenamespace•String
The container the metafield belongs to. If omitted, the app-reserved namespace will be used.
- •String!required
The identifier for the metafield.
Arguments
- Anchor to metafieldsmetafields•[Metafield]!non-null Token access required
A list of custom fields that a merchant associates with a Shopify resource.
- Anchor to identifiersidentifiers•[Has
Metafields Identifier!]! required The list of metafields to retrieve by namespace and key.
The input must not contain more than
250values.
Arguments
- Anchor to priceprice•Money
V2! non-null The product variant’s price.
- Anchor to productproduct•Product!non-null
The product object that the product variant belongs to.
- Anchor to quantityAvailablequantity•Int
Available Token access required The total sellable quantity of the variant for online sales channels.
- Anchor to quantityPriceBreaksquantity•Quantity
Price Breaks Price Break Connection! non-null A list of quantity breaks for the product variant.
- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
Arguments
- Anchor to quantityRulequantity•Quantity
Rule Rule! non-null The quantity rule for the product variant in a given context.
- Anchor to requiresComponentsrequires•Boolean!
Components non-null Whether a product variant requires components. The default value is
false. Iftrue, then the product variant can only be purchased as a parent bundle with components.- Anchor to requiresShippingrequires•Boolean!
Shipping non-null Whether a customer needs to provide a shipping address when placing an order for the product variant.
- Anchor to selectedOptionsselected•[Selected
Options Option!]! non-null List of product options applied to the variant.
- Anchor to sellingPlanAllocationsselling•Selling
Plan Allocations Plan Allocation Connection! non-null Represents an association between a variant and a selling plan. Selling plan allocations describe which selling plans are available for each variant, and what their impact is on pricing.
- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
Arguments
- Anchor to shopPayInstallmentsPricingshop•Shop
Pay Installments Pricing Pay Installments Product Variant Pricing Token access required The Shop Pay Installments pricing information for the product variant.
- •String
The SKU (stock keeping unit) associated with the variant.
- Anchor to storeAvailabilitystore•Store
Availability Availability Connection! non-null The in-store pickup availability of this variant by location.
- Anchor to nearnear•Geo
Coordinate Input Used to sort results based on proximity to the provided location.
- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
Arguments
- Anchor to taxabletaxable•Boolean!non-null
Whether tax is charged when the product variant is sold.
- Anchor to titletitle•String!non-null
The product variant’s title.
- Anchor to unitPriceunit•Money
Price V2 The unit price value for the variant based on the variant's measurement.
- Anchor to unitPriceMeasurementunit•Unit
Price Measurement Price Measurement The unit price measurement for the variant.
- Anchor to weightweight•Float
The weight of the product variant in the unit system specified with
.- Anchor to weightUnitweight•Weight
Unit Unit! non-null Unit of measurement for weight.
Deprecated fields
- compareAtPriceV2 (MoneyV2): deprecated
- priceV2 (MoneyV2!): deprecated
- Anchor to compareAtPriceV2compare•Money
At Price V2 V2 Deprecated - Anchor to priceV2price•Money
V2 V2! non-nullDeprecated