You can create a new product variation using this method. If the options you specify in request don't exist, they will be created automatically with the type of dropdown. If you want to create options explicitly, use the Update product call to create them.
📘
You can create only one variation per API request. To create several variations, send several separate requests for each.
Headers
Name
Type
Description
Authorization
string
oAuth token with mandatory Bearer before it. Example: Bearer e***s0, where e***s0 should be replaced with your oAuth token.
Request body
A JSON object of type 'Variation' with the following fields:
Variation
Field
Type
Description
options
Array<OptionValue>
Set of options that identifies this variation. An array of name-value pairs
sku
string
Variation SKU. Omitted if the variation inherits the base product's SKU
quantity
number
Amount of the variation items in stock
inStock
boolean
true if the variation is in stock (quantity is more than zero) or has unlimited quantity. false otherwise.
unlimited
boolean
true if the variation has unlimited stock (that is, never runs out)
price
number
Variation price. Omitted if the variation inherits the base product's price
isShippingRequired
boolean
true if variation requires shipping, false otherwise
wholesalePrices
Array<WholesalePrice>
Sorted array of the variation's wholesale price tiers (quantity limit and price). Omitted if the variation inherits the base product's tiered price settings
costPrice
number
Purchase price (the price at which the seller bought the product from the supplier). A positive number, 0 by default. The field is not shown in the UI and can be used for reports and profit calculations
weight
number
Variation weight in the units defined in store settings. Omitted if the variation inherits the base product's weight.
warningLimit
number
The minimum 'warning' amount of the product items in stock for this variation, if set. When the variation in stock amount reaches this level, the store administrator gets an email notification. Omitted if the variation inherits the base product's settings
attributes
Array<AttributeValue>
Variation's UPC attribute and its value
compareToPrice
number
Variation's sale price displayed strike-out in the customer frontend Omitted if empty
externalReferenceId
string
External ID for products synced from external services (e.g. POS)
minPurchaseQuantity
number
Sets minimum product variation purchase quantity. Default value is taken from a base product.
maxPurchaseQuantity
number
Sets maximum product variation purchase quantity. Default value is taken from a base product.
OptionValue
Field
Type
Description
name
string
Option name
nameTranslated
<Translations>
Available translations for product option name
value
string
Option value
valueTranslated
<Translations>
Available translations for product option value
Translations
Field
Type
Description
<ISO_LANG_CODE>
string
Translations for each available language. If no other translations are provided, the default language translation is returned. See available languages in store language settings
WholesalePrice
Field
Type
Description
quantity
number
Number of product items on this wholesale tier
price
number
Product price on the tier
AttributeValue
Field
Type
Description
id
number
Unique attribute ID. See Product Classes for the information on attribute IDs
alias
string
One of UPC, BRAND. This can be used instead of id to quickly update the basic variation attributes without numeric id: UPC and brand
type
string
Supported special values: UPC, BRAND, PRICE_PER_UNIT, UNITS_IN_PRODUCT,CUSTOM
value
string
Attribute value
Response
A JSON object of type 'CreateStatus' with the following fields:
CreateStatus
Field
Type
Description
id
number
ID of the created variation
Errors
In case of error, Ecwid responds with an error HTTP status code
HTTP codes
HTTP Status
Meaning
400
Request parameters are malformed
402
The "Product Variations" feature are not available on the merchant plan
404
The product is not found
409
The specified sku or options variation already exists
415
Unsupported content-type: expected application/json or text/json
500
Cannot get the variation because of an error on the server