Create Product Variant

Creates a product variant. **Required Fields** * sku * option_values **Read-Only Fields** * id **Limits** * 600 SKUs per product limit. * 255 characters SKU length limit. Variants need to be created one at a time using this endpoint. To use a variant array, create products, and variants in the same call use the [Create Products](/developer/api-reference/rest/admin/catalog/products#create-a-product) endpoint during the initial product creation. To obtain the `option_values` to include in this request, use the [Create a product variant option](/developer/api-reference/rest/admin/catalog/product-variant-options#create-a-product-variant-option) endpoint.

Authentication

X-Auth-Tokenstring
### OAuth scopes | UI Name | Permission | Parameter | |:--------|:-----------|:----------| | Products | modify | `store_v2_products` | | Products | read-only | `store_v2_products_read_only` | ### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-accounts#api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).

Path parameters

product_idstringRequired

Request

This endpoint expects an object.
cost_pricedouble or nullOptional>=0

The cost price of the variant. It is not affected by Price List prices. This value displays as null in the control panel when cost_price equals zero.

pricedouble or nullOptional>=0

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.

sale_pricedouble or nullOptional>=0

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.

retail_pricedouble or nullOptional>=0

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.

weightdouble or nullOptional>=0

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.

widthdouble or nullOptional>=0

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.

heightdouble or nullOptional>=0

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.

depthdouble or nullOptional>=0

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.

is_free_shippingbooleanOptional

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

fixed_cost_shipping_pricedouble or nullOptional>=0

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

purchasing_disabledbooleanOptional

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

purchasing_disabled_messagestringOptional0-255 characters

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

upcstring or nullOptional0-14 characters
The UPC code used in feeds for shopping comparison sites and external channel integrations.
inventory_levelinteger or nullOptional<=2147483647
Inventory level for the variant, which is used when the product’s inventory_tracking is set to `variant`. The Catalog API returns the inventory for only the default location. The inventory for a variant cannot exceed 2,147,483,647 in the catalog. The sum of the variant inventories, or the total inventory for a product, cannot exceed 2,147,483,647. If you exceed the limit, the store sets the variant inventory to the limit if no other variant inventories are set. If other variant inventories are set, the store does not save the variant inventory rather than setting the variant inventory to the remaining limit. The Catalog API handles limits in a different way than the Inventory API. For more information, see [Limit handling](/developer/docs/admin/catalog-and-inventory/inventory-adjustments#limit-handling-in-inventory-versus-catalog-api).
inventory_warning_levelinteger or nullOptional<=2147483647
When the variant hits this inventory level, it is considered low stock.
bin_picking_numberstring or nullOptional0-255 characters
Identifies where in a warehouse the variant is located.
image_urlstringOptional
Publicly available image url
gtinstring or nullOptional0-14 characters
Global Trade Item Number
mpnstring or nullOptional
Manufacturer Part Number
product_idintegerOptional
skustringOptional1-255 characters
option_valueslist of objectsOptional

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

Response

dataobject
metaobject
Response metadata.

Errors

404
Not Found Error