Backend API
Fields
Unique identifier for the variant.
Human-friendly name of the variant. Defaults to the combined name of all options, for example "Blue, Large" in the case of 2 options; color and size.
ID of the parent product.
An active variant is visible to customers in a storefront. Otherwise it will be hidden from view.
A variant is automatically archived when it has been sold in the past and product options are changed in a way that would cause the variant to be removed.
An object containing custom attribute values. Overrides product attributes. See attributes for more details.
Unique code to identify the gift card variant.
Cost of goods used to calculate gross margins. Overrides parent product cost.
Three-letter ISO currency code in uppercase. Defaults to store's base currency.
Date and time the variant was created.
Date and time the variant was last updated.
List of images depicting the variant.
Unique identifier for the object.
A brief description of the image.
An object representing the image file.
Unique identifier for the file.
MIME content type of the file.
A reference to the raw file data.
Date the file was uploaded.
Optional file name.
Image height in pixels, if applicable.
Size of the file in bytes.
An MD5 hash of the file contents. This can be used to uniquely identify the file for caching purposes.
A public URL to reference the file. Updated automatically if file content changes.
Image width in pixels, if applicable.
Indicates the image is not visible to customers.
Arbitrary image data, typically used to store custom values. See Frontend API for more details.
List of option value IDs that constitute the variant.
Reflects the non-sale price of the product
Expandable link to the parent product.
List price used by default when sale=false or sale_price is not defined. Overrides parent product price.
Price rules to override price and sale_price when conditions match quantity or account group in a cart. Overrides parent product prices.
Price applied when conditions are met.
Customer account group as a condition to apply price.
Maximum quantity as a condition to apply price.
Minimum quantity as a condition to apply price.
Purchase options available for the product variant.
Designates purchase option as a one-time purchase.
List price used by default when sale=false or sale_price is not defined. Overrides product price.
Indicates whether the product option is on sale. If true, the sale_price will be used by default when the product is added to a cart.
Sale price used by default when sale=true, overriding price. Overrides product sale price.
Price rules determined by cart quantity or customer account group. Overrides price and sale_price when conditions match.
Price applied when conditions are met.
Customer account group as a condition to apply price.
Maximum quantity as a condition to apply price.
Minimum quantity as a condition to apply price.
Indicates the variant is on sale andsale_price is used by default when the product is added to a cart. Overrides parent product sale.
Sale price used by default when sale=true, overriding price. Overrides parent product sale_price.
If specified, shipping is calculated based on this shipping weight. Otherwise, it will assume 1 lb/oz/kg depending on your default weight unit. Overrides parent product shipment_weight.
Stock keeping unit (SKU) used to track inventory in a warehouse.
Expandable list of stock adjustments for the variant.
Current in-stock quantity of the variant, based on the sum of stock entries.
Total stock level of the variant across inventory locations.
Stock distributed over inventory locations, if multi-location inventory is enabled.
The default billing interval when this product is used as a subscription plan. Can be monthly, yearly, weekly or daily.
Possible enum values:
Multiplier when combined with subscription_interval. For example, to make a subscription bill every 2 weeks, set subscription_interval=weekly and subscription_interval_count=2.
Number of days offered as a free trial before the customer is billed. If a subscription is canceled by the last day of the trial period, an invoice won't be issued.
The product variant model
{
"id": "60f199509111e70000000067",
"name": "Medium",
"parent_id": "60f199509111e70000000069",
"active": true,
"archived": false,
"attributes": {
"example": true
},
"currency": "USD",
"date_created": "2021-07-16T14:36:00.333Z",
"date_updated": "2021-07-16T14:36:00.333Z",
"images": [
{
"id": "5ca24abb9c077817e5fe2b37",
"caption": "Just a variant",
"file": {
"id": "5ca24abb9c077817e5fe2b38",
"length": 66764,
"md5": "99194f53bfdea832553e7fa8ae8fd80f",
"content_type": "image/png",
"url": "http://cdn.swell.store/test/5ca24abb9c077817e5fe2b36/99194f53bfdea832553e7fa8ae8fd80f",
"width": 940,
"height": 600
}
}
],
"option_value_ids": [
"59764b54e68ba2330390319a"
],
"price": 18.99,
"sale": false,
"sale_price": null,
"sku": "EX2001",
"stock_level": 6
}