Skip to content

ProductVariant

The ProductVariant object represents a variant of a product.

classDiagram
  direction LR
  ProductVariant --> Unit 
  ProductVariant --> ProductAvailability 
  ProductVariant --> ProductDelivery 
  ProductVariant --> Product 
  ProductVariant --> ProductBundlesList 
  ProductVariant --> ProductImage 
  ProductVariant --> ProductVariantOptionValuesList 
  ProductVariant --> ProductWarehouseAvailabilitiesList
  ProductVariant --> ProductHistoricalPricesList
  ProductVariant --> ProductHistoricalPrice
  ProductVariant --> ProductUrl
  ProductVariant --> Points
  ProductVariant --> Weight
  ProductVariant --> Price
  ProductVariant --> VariantSpecialOffer
  ProductHistoricalPricesList "1" --o "*" ProductHistoricalPrice
  ProductWarehouseAvailabilitiesList "1" --o "*" ProductWarehouseAvailability
  ProductVariantOptionValuesList "1" --o "*" ProductVariantOptionValue
  ProductBundlesList "1" --o "*" ProductBundle
  class Unit{
  }
  class ProductAvailability{
  }  
  class VariantSpecialOffer{
  }
  class ProductDelivery{
  }
  class Product{
  }
  class ProductBundlesList{
  }  
  class ProductImage{
  }
  class ProductVariantOptionValuesList{
  }
  class ProductWarehouseAvailabilitiesList{
  }  
  class ProductHistoricalPricesList{
  }
  class ProductHistoricalPrice{
  }
  class ProductUrl{
  }
  class Points{
  }
  class Weight{
  }
  class Price{
  }
  class ProductVariant{
    int id
    ProductUrl url
    string code
    string ean
    string sku
    string gtin
    string isbn
    string kgo
    string bloz7
    string bloz12
    string producerCode
    string code39
    string gtu
    bool isBasic
    bool isDefault
    bool isAvailable
    float stock
    float packageQuantity
    Points loyaltyPointsEarnedForBuy
    Points loyaltyPointsCost
    Weight weight
    Price price
    Price basePrice
    Price unitPrice
    Unit unitPriceCalculationUnit
    ProductAvailability availability
    ?ProductDelivery delivery
    Product product
    ProductBundlesList bundles
    ProductImage image
    ProductVariantOptionValuesList optionValues
    ProductWarehouseAvailabilitiesList warehouses
    ProductHistoricalPricesList historicalPrices
    ?ProductHistoricalPrice lowestHistoricalPriceInLast30Days
    ?VariantSpecialOffer specialOffer
    Metafields metafields
  }
  click ProductImage href "/object-api/objects/products/image/"

Properties

Attribute name Type Description
id int The unique identifier of the variant.
url ProductUrl The ProductUrl object that represents the url for product.
code string The product code/SKU.
ean string The EAN code of the variant.
sku string The variant code/SKU.
gtin string The GTIN code of the variant.
sbin string The ISBN code of the variant.
kgo string The KGO code of the variant.
bloz7 string The BLOZ7 code of the variant.
bloz12 string The BLOZ12 code of the variant.
producerCode string The producer code of the variant.
code39 string The code39 code of the variant.
gtu int The GTU classification category of the variant.
isBasic bool Returns true if variant is the basic variant of the product.
isDefault bool Returns true if variant is set as default.
isAvailable bool Returns true if variant is available.
stock float The stock quantity of the variant.
packageQuantity float The quantity of the variant in a single package.
loyaltyPointsEarnedForBuy Points The Points object that represents the number of loyalty points earned fo buying this variant.
loyaltyPointsCost Points The Points object that represents the cost of a variant in loyalty points.
weight Weight The Weight object that represents the weight of a variant.
price Price The Price object representing the current price of the variant.
basePrice Price The Price object representing the base price of the variant (without special offer discount).
specialOffer null|VariantSpecialOffer The VariantSpecialOffer object representing the special offer of the variant.
unitPrice Price The Price object representing the base unit price of the variant.
unitPriceCalculationUnit Unit The Unit object representing information about a unit to measure quantity of a variant in unit price calculation.
availability ProductAvailability The ProductAvailability object that represents the availability of the variant.
delivery null|ProductDelivery The ProductDelivery object that represents the delivery information of the variant.
product Product The Product object that represents the product.
bundles ProductBundlesList Reference to the ProductBundlesList object that represents the bundles list of ProductBundle objects in which this variant is part of the bundle.
image null|ProductImage The ProductImage object that represents the image of the variant.
optionValues ProductVariantOptionValuesList Reference to the ProductVariantOptionValuesList object which is a list of ProductVariantOptionValue objects that represents the association of options and their values for a given variant.
metafields Metafields Reference to the Metafields object that provides access to the namespaced containers for key - value pairs of data.
warehouses ProductVariantWarehouseAvailabilitiesList Reference to the ProductVariantWarehouseAvailabilitiesList object which is a list of ProductVariantWarehouseAvailability objects that represents the availability information in each warehouse.
historicalPrices ProductHistoricalPricesList Reference to the ProductHistoricalPricesList object which is a list of ProductHistoricalPrice objects that represents the price of a product on a given date.
lowestHistoricalPriceInLast30Days ProductHistoricalPrice The ProductHistoricalPrice object that represents the lowest price of a product in last 30 days.
countryShippingCosts CountryShippingCosts The CountryShippingCosts object that is a list of available shipping methods and their costs per country.

Examples

id property

{{ productVariant.id }}
1

url property

{{ productVariant.url }}
/en/p/product-name/10

code property

{{ productVariant.code }}
26758

ean property

{{ productVariant.ean }}
5 012345 678900

sku property

{{ productVariant.sku }}
ABC-12345-S-BL

gtin property

{{ productVariant.gtin }}
012345678905

isbn property

{{ productVariant.isbn }}
SBIN0005943

kgo property

{{ productVariant.kgo }}
26758

bloz7 property

{{ productVariant.bloz7 }}
6453734

bloz12 property

{{ productVariant.bloz12 }}
645373443267

producerCode property

{{ productVariant.producerCode }}
11

code39 property

{{ productVariant.code39 }}
26758

gtu property

{{ productVariant.gtu }}
GTU_01

isBasic property

{{ productVariant.isBasic }}
true

isDefault property

{{ productVariant.isDefault }}
true

isAvailable property

{{ productVariant.isAvailable }}
true

stock property

{{ productVariant.stock }}
123

packageQuantity property

{{ productVariant.packageQuantity }}
2

loyaltyPointsEarnedForBuy property

{{ productVariant.loyaltyPointsEarnedForBuy.points }}
123

loyaltyPointsCost property

{{ productVariant.loyaltyPointsCost.points }}
123

weight property

{{ productVariant.weight.formatValue }}
1.2 kg

price property

{{ productVariant.price.formatGross }}
$12.34

basePrice property

{{ productVariant.basePrice.formatGross }}
$2.56

specialOffer property

{{ productVariant.specialOffer.price.formatGross }}
$0.48

unitPrice property

{{ productVariant.unitPrice.formatGross }}
$2.56

unitPriceCalculationUnit property

{{ productVariant.unitPriceCalculationUnit.name }}
kilogram

availability property

{{ productVariant.availability.name }}
In stock

delivery property

{{ productVariant.delivery.name }}
24 hours

product property

{{ productVariant.product.name }}
Super phone

bundles property

{% for bundle in productVariant.bundles %}
  <div>
    Bundle:
    {% for item in bundle.items %}
      <p>Item: {{ item.bundle.product.name }}</p>
    {% endfor %}
  </div>
{% endfor %}
<div>
  Bundle:
  <p>Item: Example bundle item 1</p>
  <p>Item: Example bundle item 2</p>
</div>

<div>
  Bundle:
  <p>Item: Example bundle item 3</p>
  <p>Item: Example bundle item 4</p>
  <p>Item: Example bundle item 5</p>
</div>

image property

{{ productVariant.image.url }}
/path/to/variant/image

optionValues property

{% for optionValue in productVariant.optionValues %}
  {{ optionValue.option.name }}: {{ optionValue.optionValue.name }}
{% endfor %}
Color: Blue
Size: S

metafields property

value: {{ productVariant.metafields.someNamespaceName.key }}
value: example-value-2

warehouses property

{% for warehouse in productVariant.warehouses %}
    <p>{{ warehouse.name }}</p>
{% endfor %}
<p>Example warehouse 1</p>
<p>Example warehouse 2</p>
<p>Example warehouse 3</p>

historicalPrices property

{% for price in productVariant.historicalPrices %}
  {{ price.date }} - {{ price.price.formatGross }}
{% endfor %}
21 may 2021 - $9.45
2 september 2023 - $23.45
11 december 2024 - $76.11

lowestHistoricalPriceInLast30Days property

{{ productVariant.lowestHistoricalPriceInLast30Days.price.formatGross }}
$12.34

countryShippingCosts property

{% for countryShippingCost in productVariant.countryShippingCosts %}
    Shippings available in {{ countryShippingCost.country.name }}:
    {% for shippingCost in countryShippingCost.shippingCosts %}
        {{ shippingCost.shipping.name }} - {{ shippingCost.price.formatGross }}
    {% endfor %}
{% endfor %}
Shippings available in Poland:
    InPost - 12.99PLN
    GLS - 15.99PLN
Shippings available in Slovakia:
    GLS - 4.00€
    DHL - 4.50€