createProductTypeVariant
post
/ccadmin/v1/productVariants
Create Product Type Variant. Create a variant. **Requires the x-ccasset-language header so translated content can be set for a specific language.**
Request
Supported Media Types
- application/json
Header Parameters
- X-CCAsset-Language
-
Type:
stringRequired:trueThe asset language of the request
Body Parameter
Root Schema : createProductTypeVariant_request
{
"listingVariant":false,
"values":[
"Beige",
"Black"
],
"variantBasedDisplay":false,
"id":"color",
"label":"Color",
"productTypeId":"MensApparel"
}
- productTypeId
-
Type:
stringRequired:trueThe ID of the product type.
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : createProductTypeVariant_response
- count
-
Type:
integerNumber of products of the current user-defined product type. - id
-
Type:
stringID of product type. - variants
-
Type:
arrayvariantsAdditional Properties Allowed:List of variants for user-defined product type.
Nested Schema : variants
Nested Schema : items
Type:
object- default
-
Type:
stringDefault value of variant. - dimension
-
Type:
stringDimension of variant. - editableAttributes
-
Type:
arrayeditableAttributesAdditional Properties Allowed:List of editable attributes - id
-
Type:
stringID of variant. - internalOnly
-
Type:
booleanWhether variant is internal. - itemType
-
Type:
stringItem type for user-defined product type. - label
-
Type:
stringLabel for new product type. - listingVariant
-
Type:
booleanWhether listing should be done based on this variant. - textSearchable
-
Type:
booleanWhether text is searchable or not. - type
-
Type:
stringData type of variant. - values
-
Type:
arrayvaluesAdditional Properties Allowed:Values for variant. - variantBasedDisplay
-
Type:
booleanWhether this variant based display should be allowed - wildcardSearchable
-
Type:
booleanWhether wildcard is searchable or not. - writable
-
Type:
stringWhether writable or not.
Nested Schema : editableAttributes
Nested Schema : values
Nested Schema : items
Type:
object- default
-
Type:
stringDefault editable attribute. - dimension
-
Type:
stringDimensions of item type. - hidden
-
Type:
booleanWhether item is hidden. - internalOnly
-
Type:
booleanWhether variant is internal. - label
-
Type:
stringLabel for the item type. - listingVariant
-
Type:
booleanWhether listing should be done based on this variant. - order
-
Type:
integerOrder count of item type. - required
-
Type:
booleanWhether it is required or not. - searchable
-
Type:
booleanWhether item searchable or not. - textSearchable
-
Type:
booleanWhether variant is searchable or not. - variantBasedDisplay
-
Type:
booleanWhether this variant based display should be allowed - wildcardSearchable
-
Type:
booleanWhether wildcard searchable or not.
Example application/json
{
"count":4,
"id":"MensApparel",
"variants":[
{
"itemType":"sku-MensApparel",
"hidden":false,
"values":[
"Beige",
"Black"
],
"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
}
]
}
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|
|------------------|------------------|
|20123|No item descriptor name supplied when adding dynamic property|
|20023|invalid listing and display variant combination|
|20122|No property type supplied when adding dynamic property|
|20022|Product Type cannot have multiple display variants|
|20021|Error while updating the listing variant|
|20120|No property name supplied when adding dynamic property|
|20175|Create Product Type Null Properties Internal Error|
|20020|Error while updating the display variant|
|20196|No backing type found for UI property type {0}|
|20019|Product Type cannot have multiple listing variants|
|33015|Create Property ItemDescriptor Error|
|26034|Could not find type of {0}.|
|20170|Create Product Type Variant Internal Error|
|20191|No product type id provided.|
Body
Root Schema : errorModel
Type:
object- devMessage
-
Type:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - errors
-
Type:
arrayerrorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe HTTP status code - type
-
Type:
stringThe URI to the HTTP state code definition
Nested Schema : errors
Nested Schema : items
Type:
object- devMessage
-
Type:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe HTTP status code
Examples
Sample Request:
{
"listingVariant": false,
"values": [
"Beige",
"Black"
],
"variantBasedDisplay": false,
"id": "color",
"label": "Color",
"productTypeId": "MensApparel"
}
Sample Response Payload returned by endpoint:
{
"count": 4,
"id": "MensApparel",
"variants": [{
"itemType": "sku-MensApparel",
"hidden": false,
"values": [
"Beige",
"Black"
],
"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
}]
}