Catalog
Catalog
Products
Product Metafields
Product Bulk Pricing Rules
Product Custom Fields
Product Images
Product Variant Options
Product Variant Option Values
Product Variants Metafields
Product Modifiers
Product Modifier Values
Product Modifier Images
Product Complex Rules
Product Reviews
Product Videos
Brands
Brand Metafields
Brand Images
Category
Category Metafields
Category Images
Models
post

/catalog/products/{product_id}/variants

Creates a Product Variant.

Required Fields

  • sku
  • option_values

Read-Only Fields

  • id

Variants need to be created one at a time using this endpoint. To use a variant array and create products and variants in the same call use the Create Products during the initial product creation.

Authorization

apiKey - X-Auth-Client
apiKey - X-Auth-Token

Request Parameters

1 Path Parameter

Request Body

1 Example
Schema
object

The model for a POST to create variants on a product.

cost_price
number

The cost price of the variant. Not affected by Price List prices.

3 validations
price
number

This variant’s base price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is null, the product’s default price (set in the Product resource’s price field) will be used as the base price.

3 validations
sale_price
number

This variant’s sale price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is null, the product’s sale price (set in the Product resource’s price field) will be used as the sale price.

3 validations
retail_price
number

This variant’s retail price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is null, the product’s retail price (set in the Product resource’s price field) will be used as the retail price.

3 validations
weight
number

This variant’s base weight on the storefront. If this value is null, the product’s default weight (set in the Product resource’s weight field) will be used as the base weight.

3 validations
width
number

Width of the variant, which can be used when calculating shipping costs. If this value is null, the product’s default width (set in the Product resource’s width field) will be used as the base width.

3 validations
height
number

Height of the variant, which can be used when calculating shipping costs. If this value is null, the product’s default height (set in the Product resource’s height field) will be used as the base height.

3 validations
depth
number

Depth of the variant, which can be used when calculating shipping costs. If this value is null, the product’s default depth (set in the Product resource’s depth field) will be used as the base depth.

3 validations
is_free_shipping
boolean

Flag used to indicate whether the variant has free shipping. If true, the shipping cost for the variant will be zero.

fixed_cost_shipping_price
number

A fixed shipping cost for the variant. If defined, this value will be used during checkout instead of normal shipping-cost calculation.

3 validations
purchasing_disabled
boolean

If true, this variant will not be purchasable on the storefront.

purchasing_disabled_message
string

If purchasing_disabled is true, this message should show on the storefront when the variant is selected.

2 validations
image_url
string

The image that will be displayed when this variant is selected on the storefront. When updating a SKU image, send the publicly accessible URL. Supported image formats are JPEG, PNG, and GIF. Generic product images not specific to the variant should be stored on the product. Limit of 8MB per file.

1 validation
upc
string

The UPC code used in feeds for shopping comparison sites and external channel integrations.

1 validation
inventory_level
integer

Inventory level for the variant, which is used when the product’s inventory_tracking is set to variant.

1 validation
inventory_warning_level
integer

When the variant hits this inventory level, it is considered low stock.

1 validation
bin_picking_number
string

Identifies where in a warehouse the variant is located.

3 validations
product_id
integer
1 validation
sku
string
3 validations
option_values
array[object]

Array of option and option values IDs that make up this variant. Will be empty if the variant is the product’s base variant.

1 validation

Responses

1 Example
Schema
object
data
object

Common Variant properties.

meta
object

Empty meta object; may be used later.

Send a Test Request

Send requests directly from the browser (CORS must be enabled)
Path Params
2 path params not set
store_hash
product_id
$$.env
2 variables not set
X-Auth-Client
X-Auth-Token