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
Query Parameters
-
allowNonUnderscoreNames(optional): boolean
If true, allow the creation of custom property names that do not contain an underscore('_').
Header Parameters
-
X-CCAsset-Language: string
The asset language of the request
Root Schema : createProductTypeVariant_request
Type:
Show Source
object
-
productTypeId:
string
The ID of the product type.
Example:
{
"listingVariant":false,
"values":[
"Beige",
"Black"
],
"variantBasedDisplay":false,
"id":"color",
"label":"Color",
"productTypeId":"MensApparel"
}
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : createProductTypeVariant_response
Type:
Show Source
object
-
count(optional):
integer
Number of products of the current user-defined product type.
-
id(optional):
string
ID of product type.
-
variants(optional):
array variants
List of variants for user-defined product type.
Nested Schema : items
Type:
Show Source
object
-
default(optional):
string
Default value of variant.
-
dimension(optional):
string
Dimension of variant.
-
editableAttributes(optional):
array editableAttributes
List of editable attributes
-
id(optional):
string
ID of variant.
-
internalOnly(optional):
boolean
Whether variant is internal.
-
itemType(optional):
string
Item type for user-defined product type.
-
label(optional):
string
Label for new product type.
-
listingVariant(optional):
boolean
Whether listing should be done based on this variant.
-
textSearchable(optional):
boolean
Whether text is searchable or not.
-
type(optional):
string
Data type of variant.
-
values(optional):
array values
Values for variant.
-
variantBasedDisplay(optional):
boolean
Whether this variant based display should be allowed
-
wildcardSearchable(optional):
boolean
Whether wildcard is searchable or not.
-
writable(optional):
string
Whether writable or not.
Nested Schema : items
Type:
Show Source
object
-
default(optional):
string
Default editable attribute.
-
dimension(optional):
string
Dimensions of item type.
- hidden(optional): boolean
-
internalOnly(optional):
boolean
Whether variant is internal.
-
label(optional):
string
Label for the item type.
-
listingVariant(optional):
boolean
Whether listing should be done based on this variant.
-
order(optional):
integer
Order count of item type.
-
required(optional):
boolean
Whether it is required or not.
-
searchable(optional):
boolean
Whether item searchable or not.
-
textSearchable(optional):
boolean
Whether variant is searchable or not.
-
variantBasedDisplay(optional):
boolean
Whether this variant based display should be allowed
-
wildcardSearchable(optional):
boolean
Whether wildcard searchable or not.
Example Response (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.|
Root Schema : errorModel
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
errors(optional):
array errors
An optional list of errors if multiple errors were encountered
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code
-
type(optional):
string
The URI to the HTTP state code definition
Nested Schema : errors
Type:
array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code