Documentation
Feedback
Guides
API Reference

Guides
Catalog
SKU specifications

SKU specifications are necessary to be able to choose the SKU, that is, the variation of the product. Example: Color, Size, Voltage. The SKU Selector can be found in the search result or on the product page.

If you wish to implement color variation in your products, we recommend you do not use SKU specifications. Instead, see this tutorial about How to implement product color variation.

VTEX Admin says that if a new SKU Specification field is created, all the SKUs associated will be deactivated. However, if created, products will keep activated.

Data Model

FieldDescriptionRequiredTypeDefault
IdID of Specification. This ID is used to delete/update the specificationNoIntegerAutoIncrement
SkuIdID of SKUYesInteger-
FieldIdField IDYesInteger-
FieldValueIdID of FieldValue. Required only for FieldTypeId 5,6YesIntegernull
TextValue of specification. Only for FieldTypeId different from 5,6,7NoStringnull

Implementation

Create SKU Specification

To create a SKU specification, simply use the API below. Remember that you must have saved the ID of the field for which you want to create, and the FieldId of the value created for the field.

POST


_10
https://{{accountName}}.vtexcommercestable.com.br/api/catalog/pvt/stockkeepingunit/{{skuId}}/specification/

Body:


_10
{
_10
"FieldId": 13,
_10
"FieldValueId": 101
_10
}

Header:


_10
Accept: application/json
_10
Content-Type: application/json
_10
X-VTEX-API-AppToken: {{X-VTEX-API-AppToken}}
_10
X-VTEX-API-AppKey: {{X-VTEX-API-AppKey}}

Response:


_10
Status: 200 OK


_10
{
_10
"Id": 1505,
_10
"SkuId": 1234568387,
_10
"FieldId": 193,
_10
"FieldValueId": 360,
_10
"Text": "Size 10"
_10
}

Remove an SKU Specification

To remove a specification from an SKU, use the Delete SKU specification API endpoint.

Remove all specifications of specific SKU

To remove all specifications of one SKU, use the Delete all SKU specifications endpoint

Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
+ 3 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
+ 3 contributors
On this page