> Documentation index: [Saleor](/llms.txt) · [This section](/api-reference/products/llms.txt)
> Source: https://docs.saleor.io/api-reference/products/objects/product-variant

# ProductVariant Object

Represents a version of a product such as different size or color.

```graphql
type ProductVariant implements Node, ObjectWithMetadata, ObjectWithAttributes {
  id: ID!
  privateMetadata: [MetadataItem!]!
  privateMetafield(
    key: String!
  ): String
  privateMetafields(
    keys: [String!]
  ): Metadata
  metadata: [MetadataItem!]!
  metafield(
    key: String!
  ): String
  metafields(
    keys: [String!]
  ): Metadata
  assignedAttribute(
    slug: String!
  ): AssignedAttribute
  assignedAttributes(
    limit: PositiveInt = 100
  ): [AssignedAttribute!]!
  name: String!
  sku: String
  product: Product!
  trackInventory: Boolean!
  quantityLimitPerCustomer: Int
  weight: Weight
  channel: String
  channelListings: [ProductVariantChannelListing!]
  pricing(
    address: AddressInput
  ): VariantPricingInfo
  attributes(
    variantSelection: VariantAttributeScope
  ): [SelectedAttribute!]! @deprecated
  margin: Int
  quantityOrdered: Int
  revenue(
    period: ReportingPeriod
  ): TaxedMoney
  images: [ProductImage!] @deprecated
  media: [ProductMedia!]
  translation(
    languageCode: LanguageCodeEnum!
  ): ProductVariantTranslation
  stocks(
    address: AddressInput
    countryCode: CountryCode
  ): [Stock!]
  quantityAvailable(
    address: AddressInput
    countryCode: CountryCode
  ): Int
  preorder: PreorderData @deprecated
  created: DateTime!
  updatedAt: DateTime!
  externalReference: String
}
```

<a id="fields"></a>

### Fields

<a id="id"></a>

#### [`id`](#id) ● [`ID!`](/api-reference/miscellaneous/scalars/id.md)

The ID of the product variant.

<a id="private-metadata"></a>

#### [`privateMetadata`](#private-metadata) ● [`[MetadataItem!]!`](/api-reference/miscellaneous/objects/metadata-item.md)

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

<a id="private-metafield"></a>

#### [`privateMetafield`](#private-metafield) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

Tip: Use GraphQL aliases to fetch multiple keys.

<a id="product-variant-private-metafield-key"></a>

##### [`key`](#product-variant-private-metafield-key) ● [`String!`](/api-reference/miscellaneous/scalars/string.md)

<a id="private-metafields"></a>

#### [`privateMetafields`](#private-metafields) ● [`Metadata`](/api-reference/miscellaneous/scalars/metadata.md)

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

<a id="product-variant-private-metafields-keys"></a>

##### [`keys`](#product-variant-private-metafields-keys) ● [`[String!]`](/api-reference/miscellaneous/scalars/string.md)

<a id="metadata"></a>

#### [`metadata`](#metadata) ● [`[MetadataItem!]!`](/api-reference/miscellaneous/objects/metadata-item.md)

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

<a id="metafield"></a>

#### [`metafield`](#metafield) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

<a id="product-variant-metafield-key"></a>

##### [`key`](#product-variant-metafield-key) ● [`String!`](/api-reference/miscellaneous/scalars/string.md)

<a id="metafields"></a>

#### [`metafields`](#metafields) ● [`Metadata`](/api-reference/miscellaneous/scalars/metadata.md)

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

<a id="product-variant-metafields-keys"></a>

##### [`keys`](#product-variant-metafields-keys) ● [`[String!]`](/api-reference/miscellaneous/scalars/string.md)

<a id="assigned-attribute"></a>

#### [`assignedAttribute`](#assigned-attribute) ● [`AssignedAttribute`](/api-reference/attributes/interfaces/assigned-attribute.md)

Get a single attribute attached to product by attribute slug.

Added in Saleor 3.22

<a id="product-variant-assigned-attribute-slug"></a>

##### [`slug`](#product-variant-assigned-attribute-slug) ● [`String!`](/api-reference/miscellaneous/scalars/string.md)

Slug of the attribute

<a id="assigned-attributes"></a>

#### [`assignedAttributes`](#assigned-attributes) ● [`[AssignedAttribute!]!`](/api-reference/attributes/interfaces/assigned-attribute.md)

List of attributes assigned to this variant.

Added in Saleor 3.22

<a id="product-variant-assigned-attributes-limit"></a>

##### [`limit`](#product-variant-assigned-attributes-limit) ● [`PositiveInt`](/api-reference/miscellaneous/scalars/positive-int.md)

Maximum number of attributes to return. Default is 100.

<a id="name"></a>

#### [`name`](#name) ● [`String!`](/api-reference/miscellaneous/scalars/string.md)

The name of the product variant.

<a id="sku"></a>

#### [`sku`](#sku) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

The SKU (stock keeping unit) of the product variant.

<a id="product"></a>

#### [`product`](#product) ● [`Product!`](/api-reference/products/objects/product.md)

The product to which the variant belongs.

<a id="track-inventory"></a>

#### [`trackInventory`](#track-inventory) ● [`Boolean!`](/api-reference/miscellaneous/scalars/boolean.md)

Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. If the field is not provided, `Shop.trackInventoryByDefault` will be used.

<a id="quantity-limit-per-customer"></a>

#### [`quantityLimitPerCustomer`](#quantity-limit-per-customer) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

The maximum quantity of this variant that a customer can purchase.

<a id="weight"></a>

#### [`weight`](#weight) ● [`Weight`](/api-reference/miscellaneous/objects/weight.md)

The weight of the product variant.

<a id="channel"></a>

#### [`channel`](#channel) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

Channel given to retrieve this product variant. Also used by federation gateway to resolve this object in a federated query.

<a id="channel-listings"></a>

#### [`channelListings`](#channel-listings) ● [`[ProductVariantChannelListing!]`](/api-reference/products/objects/product-variant-channel-listing.md)

List of price information in channels for the product.

Requires one of the following permissions: AUTHENTICATED\_APP AUTHENTICATED\_STAFF\_USER

<a id="pricing"></a>

#### [`pricing`](#pricing) ● [`VariantPricingInfo`](/api-reference/products/objects/variant-pricing-info.md)

Lists the storefront variant's pricing, the current price and discounts, only meant for displaying.

<a id="product-variant-pricing-address"></a>

##### [`address`](#product-variant-pricing-address) ● [`AddressInput`](/api-reference/miscellaneous/inputs/address-input.md)

Destination address used to find warehouses where stock availability for this product is checked. If address is empty, uses `Shop.companyAddress` or fallbacks to server's `settings.DEFAULT_COUNTRY` configuration.

<a id="margin"></a>

#### [`margin`](#margin) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Gross margin percentage value.

<a id="quantity-ordered"></a>

#### [`quantityOrdered`](#quantity-ordered) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Total quantity ordered.

Requires the MANAGE\_PRODUCTS permission.

<a id="revenue"></a>

#### [`revenue`](#revenue) ● [`TaxedMoney`](/api-reference/miscellaneous/objects/taxed-money.md)

Total revenue generated by a variant in given period of time. Note: this field should be queried using `reportProductSales` query as it uses optimizations suitable for such calculations.

Requires the MANAGE\_PRODUCTS permission.

<a id="product-variant-revenue-period"></a>

##### [`period`](#product-variant-revenue-period) ● [`ReportingPeriod`](/api-reference/miscellaneous/enums/reporting-period.md)

<a id="media"></a>

#### [`media`](#media) ● [`[ProductMedia!]`](/api-reference/products/objects/product-media.md)

List of media for the product variant.

<a id="translation"></a>

#### [`translation`](#translation) ● [`ProductVariantTranslation`](/api-reference/products/objects/product-variant-translation.md)

Returns translated product variant fields for the given language code.

<a id="product-variant-translation-language-code"></a>

##### [`languageCode`](#product-variant-translation-language-code) ● [`LanguageCodeEnum!`](/api-reference/miscellaneous/enums/language-code-enum.md)

A language code to return the translation for product variant.

<a id="stocks"></a>

#### [`stocks`](#stocks) ● [`[Stock!]`](/api-reference/products/objects/stock.md)

Stocks for the product variant.

Requires one of the following permissions: MANAGE\_PRODUCTS MANAGE\_ORDERS

<a id="product-variant-stocks-address"></a>

##### [`address`](#product-variant-stocks-address) ● [`AddressInput`](/api-reference/miscellaneous/inputs/address-input.md)

DEPRECATED

No longer supported

Destination address used to find warehouses where stock availability for this product is checked. If address is empty, uses `Shop.companyAddress` or fallbacks to server's `settings.DEFAULT_COUNTRY` configuration. When `Shop.useLegacyShippingZoneStockAvailability` is disabled, this argument is ignored — stock availability is determined by the direct warehouse-channel link instead of shipping zones.

<a id="product-variant-stocks-country-code"></a>

##### [`countryCode`](#product-variant-stocks-country-code) ● [`CountryCode`](/api-reference/miscellaneous/enums/country-code.md)

DEPRECATED

Use `address` argument instead.

Two-letter ISO 3166-1 country code.

<a id="quantity-available"></a>

#### [`quantityAvailable`](#quantity-available) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Quantity of a product available for sale in one checkout. Field value will be `null` when no `limitQuantityPerCheckout` in global settings has been set, and `productVariant` stocks are not tracked.

<a id="product-variant-quantity-available-address"></a>

##### [`address`](#product-variant-quantity-available-address) ● [`AddressInput`](/api-reference/miscellaneous/inputs/address-input.md)

DEPRECATED

No longer supported

Destination address used to find warehouses where stock availability for this product is checked. If address is empty, uses `Shop.companyAddress` or fallbacks to server's `settings.DEFAULT_COUNTRY` configuration. When `Shop.useLegacyShippingZoneStockAvailability` is disabled, this argument is ignored — stock availability is determined by the direct warehouse-channel link instead of shipping zones.

<a id="product-variant-quantity-available-country-code"></a>

##### [`countryCode`](#product-variant-quantity-available-country-code) ● [`CountryCode`](/api-reference/miscellaneous/enums/country-code.md)

DEPRECATED

Use `address` argument instead.

Two-letter ISO 3166-1 country code. When provided, the exact quantity from a warehouse operating in shipping zones that contain this country will be returned. Otherwise, it will return the maximum quantity from all shipping zones.

<a id="created"></a>

#### [`created`](#created) ● [`DateTime!`](/api-reference/miscellaneous/scalars/date-time.md)

The date and time when the product variant was created.

<a id="updated-at"></a>

#### [`updatedAt`](#updated-at) ● [`DateTime!`](/api-reference/miscellaneous/scalars/date-time.md)

The date and time when the product variant was last updated.

<a id="external-reference"></a>

#### [`externalReference`](#external-reference) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

External ID of this product.

Show deprecatedHide deprecated

<a id="attributes"></a>

#### [`attributes`](#attributes) ● [`[SelectedAttribute!]!`](/api-reference/attributes/objects/selected-attribute.md)

DEPRECATED

Use the `assignedAttributes` field instead.

List of attributes assigned to this variant.

<a id="product-variant-attributes-variant-selection"></a>

##### [`variantSelection`](#product-variant-attributes-variant-selection) ● [`VariantAttributeScope`](/api-reference/products/enums/variant-attribute-scope.md)

Define scope of returned attributes.

<a id="images"></a>

#### [`images`](#images) ● [`[ProductImage!]`](/api-reference/products/objects/product-image.md)

DEPRECATED

Use the `media` field instead.

List of images for the product variant.

<a id="preorder"></a>

#### [`preorder`](#preorder) ● [`PreorderData`](/api-reference/products/objects/preorder-data.md)

DEPRECATED

Preorder is deprecated and will be removed. Model pre-sales with regular stock instead: create the planned quantity in a warehouse, or set `trackInventory` to false to sell without a stock limit.

Preorder data for product variant.

<a id="interfaces"></a>

### Interfaces

<a id="node"></a>

#### [`Node`](/api-reference/miscellaneous/interfaces/node.md)

An object with an ID

<a id="objectwithmetadata"></a>

#### [`ObjectWithMetadata`](/api-reference/miscellaneous/interfaces/object-with-metadata.md)

<a id="objectwithattributes"></a>

#### [`ObjectWithAttributes`](/api-reference/attributes/interfaces/object-with-attributes.md)

An object with attributes.

Added in Saleor 3.22

<a id="returned-by"></a>

### Returned By

[`productVariant`](/api-reference/products/queries/product-variant.md) query

<a id="member-of"></a>

### Member Of

[`AssignedMultiProductVariantReferenceAttribute`](/api-reference/attributes/objects/assigned-multi-product-variant-reference-attribute.md) object  ● [`AssignedSingleProductVariantReferenceAttribute`](/api-reference/attributes/objects/assigned-single-product-variant-reference-attribute.md) object  ● [`CheckoutLine`](/api-reference/checkout/objects/checkout-line.md) object  ● [`CheckoutLineProblemInsufficientStock`](/api-reference/checkout/objects/checkout-line-problem-insufficient-stock.md) object  ● [`OrderLine`](/api-reference/orders/objects/order-line.md) object  ● [`Product`](/api-reference/products/objects/product.md) object  ● [`ProductVariantBackInStock`](/api-reference/products/objects/product-variant-back-in-stock.md) object  ● [`ProductVariantBackInStockForClickAndCollect`](/api-reference/products/objects/product-variant-back-in-stock-for-click-and-collect.md) object  ● [`ProductVariantBackInStockInChannel`](/api-reference/products/objects/product-variant-back-in-stock-in-channel.md) object  ● [`ProductVariantBulkCreate`](/api-reference/products/objects/product-variant-bulk-create.md) object  ● [`ProductVariantBulkResult`](/api-reference/products/objects/product-variant-bulk-result.md) object  ● [`ProductVariantChannelListingUpdate`](/api-reference/products/objects/product-variant-channel-listing-update.md) object  ● [`ProductVariantCountableEdge`](/api-reference/products/objects/product-variant-countable-edge.md) object  ● [`ProductVariantCreate`](/api-reference/products/objects/product-variant-create.md) object  ● [`ProductVariantCreated`](/api-reference/products/objects/product-variant-created.md) object  ● [`ProductVariantDelete`](/api-reference/products/objects/product-variant-delete.md) object  ● [`ProductVariantDeleted`](/api-reference/products/objects/product-variant-deleted.md) object  ● [`ProductVariantDiscountedPriceUpdated`](/api-reference/products/objects/product-variant-discounted-price-updated.md) object  ● [`ProductVariantMetadataUpdated`](/api-reference/products/objects/product-variant-metadata-updated.md) object  ● [`ProductVariantOutOfStock`](/api-reference/products/objects/product-variant-out-of-stock.md) object  ● [`ProductVariantOutOfStockForClickAndCollect`](/api-reference/products/objects/product-variant-out-of-stock-for-click-and-collect.md) object  ● [`ProductVariantOutOfStockInChannel`](/api-reference/products/objects/product-variant-out-of-stock-in-channel.md) object  ● [`ProductVariantPreorderDeactivate`](/api-reference/products/objects/product-variant-preorder-deactivate.md) object  ● [`ProductVariantReorderAttributeValues`](/api-reference/products/objects/product-variant-reorder-attribute-values.md) object  ● [`ProductVariantStocksCreate`](/api-reference/products/objects/product-variant-stocks-create.md) object  ● [`ProductVariantStocksDelete`](/api-reference/products/objects/product-variant-stocks-delete.md) object  ● [`ProductVariantStocksUpdate`](/api-reference/products/objects/product-variant-stocks-update.md) object  ● [`ProductVariantStockUpdated`](/api-reference/products/objects/product-variant-stock-updated.md) object  ● [`ProductVariantTranslatableContent`](/api-reference/products/objects/product-variant-translatable-content.md) object  ● [`ProductVariantTranslate`](/api-reference/products/objects/product-variant-translate.md) object  ● [`ProductVariantUpdate`](/api-reference/products/objects/product-variant-update.md) object  ● [`ProductVariantUpdated`](/api-reference/products/objects/product-variant-updated.md) object  ● [`Stock`](/api-reference/products/objects/stock.md) object  ● [`VariantMediaAssign`](/api-reference/products/objects/variant-media-assign.md) object  ● [`VariantMediaUnassign`](/api-reference/products/objects/variant-media-unassign.md) object

<a id="implemented-by"></a>

### Implemented By

[`_Entity`](/api-reference/miscellaneous/unions/entity.md) union
