Documentation
Feedback
Guides

Integration 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,6,7NoIntegernull
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

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

Body:

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

Header:

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

Response:

Status: 200 OK
{
  "Id": 1505,
  "SkuId": 1234568387,
  "FieldId": 193,
  "FieldValueId": 360,
  "Text": "Size 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
1
Photo of the contributor
+ 1 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Contributors
1
Photo of the contributor
+ 1 contributors
On this page