updateProductTypeVariant
put
/ccadmin/v1/productVariants/{id}
Update Product Type Variant. Update a variant. **Requires the x-ccasset-language header so translated content can be set for a specific language.**
Request
Supported Media Types
- application/json
Path Parameters
- id
-
Type:
string
Required:true
The ID of the product type variant.
Header Parameters
- X-CCAsset-Language
-
Type:
string
Required:true
The asset language of the request
Body Parameter
Root Schema : updateProductTypeVariant_request
{
"listingVariant":true,
"values":[
"Blue",
"Brown",
"Green",
"Red"
],
"variantBasedDisplay":true,
"id":"color",
"label":"Color",
"productTypeId":"MensApparel"
}
- label
-
Type:
string
Required:true
The variant display name. - productTypeId
-
Type:
string
Required:true
The ID of the product type. - values
-
Type:
array
valuesRequired:true
Additional Properties Allowed:The enumerated variant options. Can also be a map with key being the original value, and value being the localized value for the given asset locale of the request.
Nested Schema : values
Type:
array
The enumerated variant options. Can also be a map with key being the original value, and value being the localized value for the given asset locale of the request.
-
Type:
string
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : updateProductTypeVariant_response
- count
-
Type:
integer
Number of products of the current user-defined product type. - id
-
Type:
string
ID of product type. - variants
-
Type:
array
variantsAdditional Properties Allowed:List of variants for user-defined product type.
Nested Schema : variants
Nested Schema : items
Type:
object
- default
-
Type:
string
Default value of variant. - dimension
-
Type:
string
Dimension of variant. - editableAttributes
-
Type:
array
editableAttributesAdditional Properties Allowed:List of editable attributes - id
-
Type:
string
ID of variant. - internalOnly
-
Type:
boolean
Whether variant is internal. - itemType
-
Type:
string
Item type for user-defined product type. - label
-
Type:
string
Label for new product type. - listingVariant
-
Type:
boolean
Whether listing should be done based on this variant. - textSearchable
-
Type:
boolean
Whether text is searchable or not. - type
-
Type:
string
Data type of variant. - values
-
Type:
array
valuesAdditional Properties Allowed:Values for variant. - variantBasedDisplay
-
Type:
boolean
Whether this variant based display should be allowed - wildcardSearchable
-
Type:
boolean
Whether wildcard is searchable or not. - writable
-
Type:
string
Whether writable or not.
Nested Schema : editableAttributes
Nested Schema : values
Nested Schema : items
Type:
object
- default
-
Type:
string
Default editable attribute. - dimension
-
Type:
string
Dimensions of item type. - hidden
-
Type:
boolean
Whether item is hidden. - internalOnly
-
Type:
boolean
Whether variant is internal. - label
-
Type:
string
Label for the item type. - listingVariant
-
Type:
boolean
Whether listing should be done based on this variant. - order
-
Type:
integer
Order count of item type. - required
-
Type:
boolean
Whether it is required or not. - searchable
-
Type:
boolean
Whether item searchable or not. - textSearchable
-
Type:
boolean
Whether variant is searchable or not. - variantBasedDisplay
-
Type:
boolean
Whether this variant based display should be allowed - wildcardSearchable
-
Type:
boolean
Whether wildcard searchable or not.
Example application/json
{
"count":4,
"id":"MensApparel",
"variants":[
{
"itemType":"sku-MensApparel",
"localizedValues":{
"Red":"Rojo",
"Brown":"Marr??n",
"Blue":"Azul",
"Green":"Verde"
},
"hidden":false,
"values":[
"Blue",
"Brown",
"Green",
"Red"
],
"length":19,
"variantBasedDisplay":"true",
"wildcardSearchable":null,
"label":"Color",
"type":"enumerated",
"required":false,
"searchable":null,
"writable":"true",
"uiEditorType":null,
"internalOnly":"false",
"default":null,
"listingVariant":"true",
"textSearchable":null,
"id":"color",
"dimension":null,
"editableAttributes":[
"dimension",
"multiSelect",
"textSearchable",
"default",
"internalOnly",
"order",
"listingVariant",
"hidden",
"label",
"required",
"variantBasedDisplay",
"wildcardSearchable",
"searchable"
],
"multiSelect":null,
"order":null
}
],
"productTypeId":"MensApparel"
}
Default Response
The error response.
The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud:
|Error Code|Description|
|------------------|------------------|
|20112|Attempted to update property data without providing new property data|
|20023|invalid listing and display variant combination|
|20111|Attempt to update type of existing property|
|20022|Product Type cannot have multiple display variants|
|20021|Error while updating the listing variant|
|20020|Error while updating the display variant|
|20581|Could not find product type|
|20019|Product Type cannot have multiple listing variants|
|20017|Product Type Internal Error|
|26041|Cannot set enumerated values to a non-array value|
|26046|Could not determine asset locale while setting localized enumerated values|
|20580|Get Product Type Internal Error|
|20170|Create Product Type Internal Error|
|20191|No product type id provided|
|26070|Error while updating SKU with listing configurations|
|26071|Error while creating the listing configurations|
Body
Root Schema : errorModel
Type:
object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - errors
-
Type:
array
errorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code - type
-
Type:
string
The URI to the HTTP state code definition
Nested Schema : errors
Nested Schema : items
Type:
object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code
Examples
Sample Request:
{ "listingVariant": true, "values": [ "Blue", "Brown", "Green", "Red" ], "variantBasedDisplay": true, "id": "color", "label": "Color", "productTypeId": "MensApparel" }
Sample Response Payload returned by endpoint:
{ "count": 4, "id": "MensApparel", "variants": [{ "itemType": "sku-MensApparel", "localizedValues": { "Red": "Rojo", "Brown": "Marr??n", "Blue": "Azul", "Green": "Verde" }, "hidden": false, "values": [ "Blue", "Brown", "Green", "Red" ], "length": 19, "variantBasedDisplay": "true", "wildcardSearchable": null, "label": "Color", "type": "enumerated", "required": false, "searchable": null, "writable": "true", "uiEditorType": null, "internalOnly": "false", "default": null, "listingVariant": "true", "textSearchable": null, "id": "color", "dimension": null, "editableAttributes": [ "dimension", "multiSelect", "textSearchable", "default", "internalOnly", "order", "listingVariant", "hidden", "label", "required", "variantBasedDisplay", "wildcardSearchable", "searchable" ], "multiSelect": null, "order": null }], "productTypeId": "MensApparel" }