Skip to main content

Variant

The Variant is the atomic and operational unit of Webround Commerce. While the Product serves as the general template, the Variant is its specific commercial declination — and the only element that possesses a physical existence in the warehouse, a price, and the ability to be added to the cart.

Without a Variant, a product can neither be priced nor sold.


Identity and Navigation

Each variant possesses unique attributes for its identification and navigation within the frontend:

PropertyTypeDescription
idstring (UUID)Unique identifier of the variant.
namestringSpecific name of the declination (e.g., "Nike Pegasus 41 - Total White").
slugstringThe "friendly-url" part that uniquely identifies the variant on the site.
isFavouritebooleanIf true, this variant is loaded first on the product page.
productIdstring (UUID)Reference to the parent Product.
availabilitystringAvailability status: available, low_availability, not_available.

URL Structure: yourdomain.com/product/[slug]


Inheritance and Overriding

Variant management is based on a system of inheritance from the parent product. For each field subject to inheritance, you can choose between two modes:

  1. Inheritance (Flag Active): The variant automatically inherits the product's settings. Elements added at the variant level are added to those of the product.
  2. Overriding (Flag Inactive): The variant breaks the link with the product for that specific field and redefines it entirely.

Integrity Rule: It is not possible to manually relink elements that the variant is already inheriting from the product. To define a specific subset (e.g., limiting the variant to only one of the product's three carriers), you must disable inheritance for that field and proceed with manual configuration.

PropertyTypeDescription
inheritAssetsbooleanIf true, uses the parent product's assets.
inheritAttributesbooleanIf true, uses the parent product's attributes.
inheritTagValuesbooleanIf true, inherits tags from the parent product.
inheritShippingbooleanIf true, inherits shipping methods and zones from the parent product.
inheritTaxZonesbooleanIf true, inherits tax zones from the parent product.
inheritDisableCouponsbooleanIf true, inherits coupon disabling rules from the parent product.

Fields subject to inheritance: Assets, Tags and Attributes, Package Dimensions and Weight, Logistics (shipping methods, shipping zones, tax zones), Coupon Settings.


Operational and Logistic Management

The variant incorporates all the operational information necessary for checkout and synchronization with external systems (ERP/Logistics):

PropertyTypeDescription
skustringUnique commercial identifier code (e.g., "NIK-A6B512-283BBA").
eanstringInternational standard barcode (EAN).
mpnstringManufacturer Part Number.
quantitynumberQuantity currently available in stock.
allowBackorderbooleanIf true, allows purchase even if stock is exhausted (backorder).
backorderDaysnumberEstimated days for replenishment in case of backorder.
maxOrderQuantitynumberMaximum limit of pieces purchasable in a single order.
allowFreeShippingbooleanThe variant is eligible for free shipping according to general rules.
forceFreeShippingbooleanIf true, forces free shipping regardless of cart rules.

Options

Options (e.g., "Size") are defined at the Product level, but it is at the Variant level that they come to life through the options map.

PropertyTypeDescription
optionsObjectMap of selected options: { "OPTION_ID": "OPTION_VALUE_ID" }.

During the automatic generation of variants, the system intersects the options defined on the product and automatically assigns the corresponding tags to the variant, making it immediately filterable.

Filterability

If you create a "Shoe Size" option with values 40, 41, 42… and associate it with the variant via automatic generation, the variant will already be tagged with all the sizes. By setting the Tag as filterable, customers will be able to filter by size in the frontend.


Pricing Strategy (Multi-Price & Multi-Currency)

A variant is not limited to a single price. Webround allows total flexibility via the prices array:

PropertyTypeDescription
pricesPrice[]Array of prices applicable to this variant.
priceRangesPriceRange[]Price ranges (min/max) calculated on the variant's options. Used for rendering in product cards.

Supported Pricing Models

  • One-Time Price (cadence: "once"): The classic sale.
  • Subscriptions: Prices with a frequency (daily, monthly, yearly, etc.). The same variant can be sold as both a single purchase and a subscription.

It is not possible to define two prices with the same combination of cadence and currencyCode.

Comparative Price (Visual Discount)

The Compare Price is the original price shown crossed out next to the current price. It manages the perception of the discount directly in the product sheet.

Taxes: Net vs Gross

The technical advice is to always reason in terms of the Net price. The tax rate is determined by the Tax Zone (or Stripe Tax) based on the customer's location. Gross prices are only correct for the main market; for multinational sales, the net + tax zone calculation is the only way to ensure correct accounting.


Quantity Discounts (Tier Pricing)

Each price can include a quantityTable that automates volume-based discounting. The unit price is recalculated in real-time as the quantity in the cart changes.


Tags and Attributes

PropertyTypeDescription
tagsTag[]Specific tags for the variant (e.g., Color, Size).
attributesAttribute[]Specific attributes for the variant.
assetsAsset[]Specific multimedia resources for this variant.

Marketing and Promotions

  • Promotion Exclusion: It is possible to link specific promotions from which the variant must be excluded.
  • Coupons: The variant can inherit the product's coupon rules or follow independent logic (controlled by inheritDisableCoupons).

Complete Definition

interface Variant {
// Identity
id: string;
name: string;
slug: string;
isFavourite: boolean;
productId: string;
availability: "available" | "low_availability" | "not_available";
metadata: Record<string, unknown>;

// Inheritance
inheritAssets: boolean;
inheritAttributes: boolean;
inheritTagValues: boolean;
inheritShipping: boolean;
inheritTaxZones: boolean;
inheritCoupon: boolean;

// Operational / Warehouse
sku: string;
ean: string;
mpn: string;
quantity: number;
allowBackorder: boolean;
backorderDays: number;
maxOrderQuantity: number;
allowFreeShipping: boolean;
forceFreeShipping: boolean;

// Options
options: Record<string, string>; // { optionId: optionValueId }

// Prices
prices: Price[];
priceRanges: PriceRange[];

// Relations
tags: Tag[];
attributes: Attribute[];
assets: Asset[];
}

Price

Represents a specific price for the variant.

PropertyTypeDescription
idstring (UUID)Unique identifier of the price.
amountnumberNominal value of the price.
netAmountnumberUnit net price.
grossAmountnumberUnit gross price (including tax).
netComparenumberNet compare price (original price).
grossComparenumberGross compare price (original price including tax).
currencyCodestringISO currency code (e.g., EUR).
cadencestringPayment frequency (e.g., once).
isDefaultbooleanIndicates if it is the main price for the current currency.
externalIdstringStripe product ID or external system ID.
quantityTableQuantityTablenull

PriceRange

Describes the price range calculated based on the variant's options. Primarily used for rendering in product cards.

PropertyTypeDescription
currencyCodestringISO currency code (e.g., EUR).
cadencestringPayment frequency (e.g., once).
netMinnumberMinimum net price.
netMaxnumberMaximum net price.
grossMinnumberMinimum gross price (VAT included).
grossMaxnumberMaximum gross price.
compareNetMinnumberMinimum net compare price.
compareNetMaxnumberMaximum net compare price.
compareGrossMinnumberMinimum gross compare price.
compareGrossMaxnumberMaximum gross compare price.
ratenumberApplied VAT rate (e.g., 22).
Discount Visualization

To show a "Promo" badge or a crossed-out price, compare grossMin with compareGrossMin. If compareGrossMin > grossMin, the variant is on sale.


QuantityTable (Tier Pricing)

PropertyTypeDescription
minnumberMinimum quantity to activate the tier.
maxnumbernull
discountTypestringDiscount type: percentage or fixed.
discountValuenumberDiscount value.
roundingstringnull

Price Calculation

The final price is calculated by applying the corresponding tier discount to the amount (or grossAmount) value of the variant. If the quantity in the cart changes, the unit price is recalculated in real-time.

UI Management

In product cards, use priceRanges to display the price and assets for the correct image based on the selected variant. The correct variant is identified by crossing the user's selections (options) with the product's variants.