---
title: "variant"

doc_type: static
doc_category: static
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/sline/object/variant'
  md: 'https://developer.shopline.com/docs/sline/object/variant.md'
---

# variant


    A product variant.

    
> **TIP**
>
> To get product variant-associated metafields, use the [get_metafields](https://developer.shopline.com/docs/sline/filter/get-metafields.md) filter.



    <div>
    
        ## Properties

        
<ObjectProperty 
    name="available"
    types={[<Mdx>boolean</Mdx>]}
>
<ObjectSummary>
Whether the product variant is available.
- `true`: available
- `false`: unavailable


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="barcode"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The barcode of the variant.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="compare_at_price"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The original price of the variant.

The value is output in the customer's local currency.

> **TIP**
>
> Output a formatted amount using the [money filter](https://developer.shopline.com/docs/sline/filter/money.md).
</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="featured_image"
    types={[<Mdx>[image](https://developer.shopline.com/docs/sline/object/image.md)</Mdx>]}
>
<ObjectSummary>
The featured image for the variant.

> **TIP**
>
> This is the same value as `variant.image`.
</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="featured_media"
    types={[<Mdx>array</Mdx>]}
>
<ObjectSummary>
The first media object for the variant.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="id"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The ID of the variant.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="image"
    types={[<Mdx>[image](https://developer.shopline.com/docs/sline/object/image.md)</Mdx>]}
>
<ObjectSummary>
The image for the variant.

> **TIP**
>
> This is the same value as `variant.featured_image`.
</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="inventory_quantity"
    types={[<Mdx>integer</Mdx>]}
>
<ObjectSummary>
The inventory quantity of the variant.

If inventory tracking is disabled, `0` is returned.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="option1"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The value of the first option of the product variant.

If the first option is unavailable, `null` is returned.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="option2"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The value of the second option of the product variant.

If the second option is unavailable, `null` is returned.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="option3"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The value of the third option of the product variant.

If the third option is unavailable, `null` is returned.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="option4"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The value of the fourth option of the product variant.

If the fourth option is unavailable, `null` is returned.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="option5"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The value of the fifth option of the product variant.

If the fifth option is unavailable, `null` is returned.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="options"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
A list of options for the product variant.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="price"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The price of the variant.

The value is output in the customer's local currency.

> **TIP**
>
> Output a formatted amount using the [money filter](https://developer.shopline.com/docs/sline/filter/money.md).
</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="requires_selling_plan"
    types={[<Mdx>boolean</Mdx>]}
>
<ObjectSummary>
Whether the product variant requires a sales plan to be added to the cart.
- `true`: required
- `false`: not required


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="requires_shipping"
    types={[<Mdx>boolean</Mdx>]}
>
<ObjectSummary>
Whether the product variant requires shipping.
- `true`: required
- `false`: not required


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="selected"
    types={[<Mdx>boolean</Mdx>]}
>
<ObjectSummary>
Whether the variant is selected.
- `true`: selected
- `false`: not selected

> **TIP**
>
> The selected variant is determined by the variant URL parameter. This URL parameter is available on product pages URLs only.
</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="sku"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The SKU of the variant.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="store_availabilities"
    types={[<Mdx>array</Mdx>]}
>
<ObjectSummary>
The store availabilities for the variant.

The array is defined in only the following cases:
- `variant.selected` is `true`
- The variant is the product's first available variant. For example, `product.first_available_variant` or `product.selected_or_first_available_variant`.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="taxable"
    types={[<Mdx>boolean</Mdx>]}
>
<ObjectSummary>
Whether the product variant is subject to tax.
- `true`: Tax is required. 
- `false`: No tax is required. 


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="title"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
A concatenation of each variant option, separated by a `/`.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="url"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The URL of the variant.

Variant URL use the following structure: `/products/[product-handle]?sku=[variant-id]`


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="weight_in_unit"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The weight of the variant.


</ObjectSummary>
</ObjectProperty>
        
    
    </div>


