Adding or updating a product variation
Learn how to add or update a product variation
Last updated
Was this helpful?
Learn how to add or update a product variation
Last updated
Was this helpful?
You can add or update a product variation for a base product. Both calls result in the same response when specifying the same productId
. As long as you know the productId
for the product variation, you only need to update that product variation.
When adding or updating a product variation, note that:
The response returns an error if you add an attribute to a product variation that does not exist in the base product.
The request automatically adds the locales
object from the base product to each product variation. The response returns an error if the locales are inconsistent between the base product and the product variations. For example:
If en_GB
and en_US
exist in the base product and only en_US
exists in the product variation, the request will copy en_GB
to the product variation.
if en_GB
and en_US
exist in the base product and ja_JP
exists in the product variation, the request will return an error in the response
The following request creates a product variation for an existing product. To add a product variation, you must provide either the base product's or .
The following example adds a product variation to a base product with a baseProductId
. It also adds a product variation without setting any data. See the variations
resource for a description of the attributes.
An ERID request requires the x-erid-as-pid=true
header. It also adds a product variation without setting any data.
The following example updates a specific product variation with a productVariationId
. See the variations
resource for a description of the attributes.
An ERID
request requires the x-erid-as-pid=true
header.
Add the new attributes and replace existing attributes in the payload. For example, you can add or replace locales for a product variation.
The following example updates a specific product variation with a productId
for a base product. See the variations
resource for a description of the attributes.
An ERID request requires the x-erid-as-pid=true
header.
Add the new attributes and replace existing attributes in the payload. For example, you can add or replace locales for a product variation.
The following request updates on any supported attribute, such as the locale, for a specific product variation. To update a specific product variation, you must provide either the product variation identifier (productVariationId
) or the variation ERID (variationERID
).
The following request updates on any supported attribute, such as the locale, for a product variation associated with a particular base product ID. To update a specific product variation, you must provide either a or . for both the base product and product variation.