OBJECT

ProductVariant

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

link GraphQL Schema definition

  • type ProductVariant implements Node {
  • # The ID of the object.
  • id: ID!
  • sku: String!
  • name: String!
  • product: Product!
  • trackInventory: Boolean!
  • quantity: Int!
  • quantityAllocated: Int!
  • weight: Weight
  • # Quantity of a product available for sale.
  • stockQuantity: Int!
  • # Override the base price of a product if necessary.
  • # A value of `null` indicates that the default product
  • # price is used.
  • priceOverride: Money
  • # Price of the product variant.
  • price: Money @deprecated( reason: "Has been replaced by 'pricing.price_undiscounted'" )
  • # Informs about variant's availability in the
  • # storefront, current price and discounted price.
  • availability: VariantPricingInfo @deprecated( reason: "Has been renamed to 'pricing'." )
  • # Lists the storefront variant's pricing, the current
  • # price and discounts, only meant for displaying
  • pricing: VariantPricingInfo
  • # Whether the variant is in stock and visible or not.
  • isAvailable: Boolean
  • # List of attributes assigned to this variant.
  • attributes: [SelectedAttribute!]!
  • # Cost price of the variant.
  • costPrice: Money
  • # Gross margin percentage value.
  • margin: Int
  • # Total quantity ordered.
  • quantityOrdered: Int
  • # 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.
  • #
  • # Arguments
  • # period:
  • revenue(period: ReportingPeriod): TaxedMoney
  • # List of images for the product variant
  • images: [ProductImage]
  • # Returns translated Product Variant fields for the given language
  • # code.
  • #
  • # Arguments
  • # languageCode:
  • translation(languageCode: LanguageCodeEnum!): ProductVariantTranslation
  • # Digital content for the product variant
  • digitalContent: DigitalContent
  • }