# Variants

Variants are sub elements of products that define different variations a product exist in, ex. different colors, sizes etc. Variants cannot exist on its own as they need to be attached to a product. Variants have defining attributes which defines the attributes variants of a product vary on, ex. color and size, with and length etc.

GET /variants Get basic models for variants

No more than 5000 variants can be requested at a time. If no limit is provided, the default limit of 1000 will be used. By default, archived variants are not returned

Request parameters

Property name Parameter type Data type Description
includeArchived query boolean
limit query integer
afterId query integer

Response status OK (200)

object : VariantsResultSet
VariantsResultSet
Property name Data type Description
Variants array : VariantModel

Variants in result set

Total integer

The total number of items

Remaining integer

The remaining items that lie after the last id of the item in this result set

LastId integer

The id of the last item in this result set

VariantModel
Property name Data type Description
Id integer

Id of variant

Name object

Display name of variant (Dictionary of ISO culture code and name) Note: Available from 3.7.0

ProductId integer

Id of product to which variant is attached

SortOrder integer

#Available from v.3.2.0 The sort order of the variant compared to other variants of this product

VariantGroupId integer

#Available from v.3.11.0 The variant group this variant is connected to, if any

VariantGroupSortOrder integer

#Available from v.3.11.0 The sortorder relative to other variants connected to the same variant group

Created string

Timestamp of variant creation

CreatedBy string

Username of the user who created the variant

LastModified string

Timestamp of the last variant update

LastModifiedBy string

Username of the user who made the last change to the variant

IsArchived boolean

Indicates whether the variant is archived

ArchiveReason string

The uid of the archive reason selected when the variant was archived

ProductStructureUid string

The product structure used by this variant

DefiningAttributes array

The unique ids of the attributes acting as defining attributes for this variant

WorkflowStateUid string

The uid of the workflow state of the variant


POST /variants Create new variants

A maximum of 5000 variants can be created in one request

Request parameters

Property name Parameter type Data type Description
variants body array : CreateVariantModel

Variants

CreateVariantModel
Property name Data type Description
ProductId integer

Id of product to attach variant to

SortOrder integer

Sort order of variant compared to other variants of the product (when null, variant is placed after existing variants)

VariantGroupSortOrder integer

Sort order of variant compared to other variants in same variant group

WorkflowStateUid string

Workflow state to set on the variant

Values object

Dictionary of attribute alias and the corresponding attribute value as an object representation

The table below shows how different attributes translates to this value model.

Attribute type data type
Text attribute string
Number attribute decimal
Boolean attribute bool
Fixedlist attribute value/value[] (depending on whether attribute allows selecting multiple global list values). The datatype of this value model depends on the underlying attribute for the global list of the refernced global list value(s)
Media attribute string/string[] (depending on whether attribute allows selecting multiple medias)
Datetime attribute DateTimeOffset
Category attribute int/int[] (depending on whether attribute allows selecting multiple categories)
Product attribute int/int[] (depending on whether attribute allows selecting multiple products)
Variant attribute int/int[] (depending on whether attribute allows selecting multiple variants)
Collection attribute uuid/uuid[] (depending on whether attribute allows selecting multiple collections)
Attribute attribute string/string[] (depending on whether attribute allows selecting multiple attributes)
Complex attribute object (Each property of the object corresponds to each sub attribute of the complex attribute. The value of each property then corresponds to the data type of that sub attribute)
List attribute value[] (Each value in the array represents each row in the list. The model of each row corresponds to the datatype of the row template set up on the list attribute)

Response status OK (200)

array : integer

DELETE /variants Delete multiple variants

Request parameters

Property name Parameter type Data type Description
variantIds body array : integer

Ids of variants to delete

Response status OK (200)

No body message is returned

PATCH /variants Update multiple variants

Request parameters

Property name Parameter type Data type Description
variants body array : BatchUpdateVariantModel

Update model

BatchUpdateVariantModel
Property name Data type Description
VariantId integer

Id of variant to update

UpdateModel object : UpdateVariantModel

Model containing updates to make on variant (properties with null values are ignored and does not cause an update)

UpdateVariantModel
Property name Data type Description
ProductId integer

Id of product to move variant to

#Available from 3.2.0

IsArchived boolean

Indicate whether the product shall be archived or un-archived

ArchiveReason string

Reference to the archive reason when archiving variant (if IsArchived is true)

SortOrder integer

Sort order of variant compared to other variants of the product

VariantGroupSortOrder integer

Sort order of variant compared to other variants in same variant group

WorkflowStateUid string

Workflow state to set on the variant

Values object

Dictionary of attribute alias and the corresponding attribute value as an object representation

The table below shows how different attributes translates to this value model.

Attribute type data type
Text attribute string
Number attribute decimal
Boolean attribute bool
Fixedlist attribute value/value[] (depending on whether attribute allows selecting multiple global list values). The datatype of this value model depends on the underlying attribute for the global list of the refernced global list value(s)
Media attribute string/string[] (depending on whether attribute allows selecting multiple medias)
Datetime attribute DateTimeOffset
Category attribute int/int[] (depending on whether attribute allows selecting multiple categories)
Product attribute int/int[] (depending on whether attribute allows selecting multiple products)
Variant attribute int/int[] (depending on whether attribute allows selecting multiple variants)
Collection attribute uuid/uuid[] (depending on whether attribute allows selecting multiple collections)
Attribute attribute string/string[] (depending on whether attribute allows selecting multiple attributes)
Complex attribute object (Each property of the object corresponds to each sub attribute of the complex attribute. The value of each property then corresponds to the data type of that sub attribute)
List attribute value[] (Each value in the array represents each row in the list. The model of each row corresponds to the datatype of the row template set up on the list attribute)

Response status OK (200)

No body message is returned

GET /variants/{id} Get basic model for a variant

Request parameters

Property name Parameter type Data type Description
id path integer

Id of variant

Response status OK (200)

object : VariantModel
VariantModel
Property name Data type Description
Id integer

Id of variant

Name object

Display name of variant (Dictionary of ISO culture code and name) Note: Available from 3.7.0

ProductId integer

Id of product to which variant is attached

SortOrder integer

#Available from v.3.2.0 The sort order of the variant compared to other variants of this product

VariantGroupId integer

#Available from v.3.11.0 The variant group this variant is connected to, if any

VariantGroupSortOrder integer

#Available from v.3.11.0 The sortorder relative to other variants connected to the same variant group

Created string

Timestamp of variant creation

CreatedBy string

Username of the user who created the variant

LastModified string

Timestamp of the last variant update

LastModifiedBy string

Username of the user who made the last change to the variant

IsArchived boolean

Indicates whether the variant is archived

ArchiveReason string

The uid of the archive reason selected when the variant was archived

ProductStructureUid string

The product structure used by this variant

DefiningAttributes array

The unique ids of the attributes acting as defining attributes for this variant

WorkflowStateUid string

The uid of the workflow state of the variant


DELETE /variants/{id} Delete a variant

Request parameters

Property name Parameter type Data type Description
id path integer

Id of variant to delete

Response status OK (200)

No body message is returned

PATCH /variants/{id} Update a variant

Request parameters

Property name Parameter type Data type Description
id path integer

Id of variant

model body object : UpdateVariantModel

Update model

UpdateVariantModel
Property name Data type Description
ProductId integer

Id of product to move variant to

#Available from 3.2.0

IsArchived boolean

Indicate whether the product shall be archived or un-archived

ArchiveReason string

Reference to the archive reason when archiving variant (if IsArchived is true)

SortOrder integer

Sort order of variant compared to other variants of the product

VariantGroupSortOrder integer

Sort order of variant compared to other variants in same variant group

WorkflowStateUid string

Workflow state to set on the variant

Values object

Dictionary of attribute alias and the corresponding attribute value as an object representation

The table below shows how different attributes translates to this value model.

Attribute type data type
Text attribute string
Number attribute decimal
Boolean attribute bool
Fixedlist attribute value/value[] (depending on whether attribute allows selecting multiple global list values). The datatype of this value model depends on the underlying attribute for the global list of the refernced global list value(s)
Media attribute string/string[] (depending on whether attribute allows selecting multiple medias)
Datetime attribute DateTimeOffset
Category attribute int/int[] (depending on whether attribute allows selecting multiple categories)
Product attribute int/int[] (depending on whether attribute allows selecting multiple products)
Variant attribute int/int[] (depending on whether attribute allows selecting multiple variants)
Collection attribute uuid/uuid[] (depending on whether attribute allows selecting multiple collections)
Attribute attribute string/string[] (depending on whether attribute allows selecting multiple attributes)
Complex attribute object (Each property of the object corresponds to each sub attribute of the complex attribute. The value of each property then corresponds to the data type of that sub attribute)
List attribute value[] (Each value in the array represents each row in the list. The model of each row corresponds to the datatype of the row template set up on the list attribute)

Response status OK (200)

No body message is returned

GET /variants/{id}/attributevalues Get attribute values for a variant

Request parameters

Property name Parameter type Data type Description
id path integer

Id of variant

globalListValueReferencesOnly query boolean

Indicate if only uids of referenced to global list values shall be returned instead of the materialized values

Response status OK (200)

object : VariantAttributeValuesModel
VariantAttributeValuesModel
Property name Data type Description
VariantId integer

Id of variant

Values object

Dictionary of attribute alias and the corresponding attribute value as an object representation

The table below shows how different attributes translates to this value model.

Attribute type data type
Text attribute string
Number attribute decimal
Boolean attribute bool
Fixedlist attribute value/value[] (depending on whether attribute allows selecting multiple global list values). The datatype of this value model depends on the underlying attribute for the global list of the refernced global list value(s)
Media attribute string/string[] (depending on whether attribute allows selecting multiple medias)
Datetime attribute DateTimeOffset
Category attribute int/int[] (depending on whether attribute allows selecting multiple categories)
Product attribute int/int[] (depending on whether attribute allows selecting multiple products)
Variant attribute int/int[] (depending on whether attribute allows selecting multiple variants)
Collection attribute uuid/uuid[] (depending on whether attribute allows selecting multiple collections)
Attribute attribute string/string[] (depending on whether attribute allows selecting multiple attributes)
Complex attribute object (Each property of the object corresponds to each sub attribute of the complex attribute. The value of each property then corresponds to the data type of that sub attribute)
List attribute value[] (Each value in the array represents each row in the list. The model of each row corresponds to the datatype of the row template set up on the list attribute)

GET /variants/{id}/enrichmentinsights Get Enrichment Insights for a variant

#Available from v.3.5.0

Request parameters

Property name Parameter type Data type Description
id path integer

Id of variant to get insights for

Response status OK (200)

array : EntityEnrichmentInsight
EntityEnrichmentInsight
Property name Data type Description
EnrichmentInsightSetupUid string

Uid of enrichment insight

EntityId integer

Id of entity

Completeness integer

Completeness in percentage (0 - 100). Is null, if ignored is true

MissingData array : InsightDataReference

List of missing data for this entity to reach 100% completeness for this enrichment insight

Ignored boolean

Indicates whether the completeness is ignored for this entity and this enrichment insight

InsightDataReference
Property name Data type Description
Type string

Type of data reference

DataReference string

The data reference itself


PATCH /variants/{id}/enrichmentinsights/{enrichmentInsightSetupUid}/{ignore} Enable or disable an enrichment insight for a variant

#Available from v.3.5.0

Request parameters

Property name Parameter type Data type Description
id path integer

Id of variant

enrichmentInsightSetupUid path string

Uid of enrichment insight to toggle ignore for

ignore path boolean

Indicate whether to ignore the insight for the given enrichment insight and variant

Response status OK (200)

No body message is returned

GET /variants/{id}/references Get references to a variant

#Available from v.3.5.0

Request parameters

Property name Parameter type Data type Description
id path integer

Id of variant

Response status OK (200)

object : VariantReferences
VariantReferences
Property name Data type Description
VariantId integer

Id of the referenced variant

ReferencingCategories array : EntityReferenceDetail

List of categories referencing this variant

ReferencingProducts array : EntityReferenceDetail

List of products referencing this variant

ReferencingVariantGroups array : EntityReferenceDetail

List of variant groups referencing this variant

ReferencingVariants array : EntityReferenceDetail

List of variants referencing this variant

ReferencingGlobalListValues array

List of global list values referencing this variant

EntityReferenceDetail
Property name Data type Description
EntityId integer

The id of the referencing entity

AttributeUid string

The attribute on the referencing entity that holds the reference


POST /variants/batch Get basic model for a range of variants

Request parameters

Property name Parameter type Data type Description
ids body array : integer

Ids of variants to get models for

Response status OK (200)

array : VariantModel
VariantModel
Property name Data type Description
Id integer

Id of variant

Name object

Display name of variant (Dictionary of ISO culture code and name) Note: Available from 3.7.0

ProductId integer

Id of product to which variant is attached

SortOrder integer

#Available from v.3.2.0 The sort order of the variant compared to other variants of this product

VariantGroupId integer

#Available from v.3.11.0 The variant group this variant is connected to, if any

VariantGroupSortOrder integer

#Available from v.3.11.0 The sortorder relative to other variants connected to the same variant group

Created string

Timestamp of variant creation

CreatedBy string

Username of the user who created the variant

LastModified string

Timestamp of the last variant update

LastModifiedBy string

Username of the user who made the last change to the variant

IsArchived boolean

Indicates whether the variant is archived

ArchiveReason string

The uid of the archive reason selected when the variant was archived

ProductStructureUid string

The product structure used by this variant

DefiningAttributes array

The unique ids of the attributes acting as defining attributes for this variant

WorkflowStateUid string

The uid of the workflow state of the variant


POST /variants/batch/attributevalues Get attribute values for multiple variants

No more than 5000 variants can be requested at a time.

Request parameters

Property name Parameter type Data type Description
model body object : VariantValuesRequestModel

Request model

VariantValuesRequestModel
Property name Data type Description
VariantIds array

Ids of products to return

IncludeValues string

Select if any source of values shall be returned

Scopes array

If IncludeValues is Scopes, define which scopes to return values for here

Aliases array

If IncludeValues is Aliases, define aliases of the attributes to include values for

Uids array

If IncludeValues is Uids, define uids of the attributes to include values for

LimitToCultureCodes array

Only return values for specific languages

LimitToSegments array

Only return values for specific dimension segments

GlobalListValueReferencesOnly boolean

Indicate if only uids of referenced to global list values shall be returned instead of the materialized values

FromTimestamp string

Get attribute values back in time

Response status OK (200)

array : VariantAttributeValuesModel
VariantAttributeValuesModel
Property name Data type Description
VariantId integer

Id of variant

Values object

Dictionary of attribute alias and the corresponding attribute value as an object representation

The table below shows how different attributes translates to this value model.

Attribute type data type
Text attribute string
Number attribute decimal
Boolean attribute bool
Fixedlist attribute value/value[] (depending on whether attribute allows selecting multiple global list values). The datatype of this value model depends on the underlying attribute for the global list of the refernced global list value(s)
Media attribute string/string[] (depending on whether attribute allows selecting multiple medias)
Datetime attribute DateTimeOffset
Category attribute int/int[] (depending on whether attribute allows selecting multiple categories)
Product attribute int/int[] (depending on whether attribute allows selecting multiple products)
Variant attribute int/int[] (depending on whether attribute allows selecting multiple variants)
Collection attribute uuid/uuid[] (depending on whether attribute allows selecting multiple collections)
Attribute attribute string/string[] (depending on whether attribute allows selecting multiple attributes)
Complex attribute object (Each property of the object corresponds to each sub attribute of the complex attribute. The value of each property then corresponds to the data type of that sub attribute)
List attribute value[] (Each value in the array represents each row in the list. The model of each row corresponds to the datatype of the row template set up on the list attribute)

POST /variants/batch/enrichmentinsights Get Enrichment Insights for a batch of variants

#Available from v.3.5.0

Request parameters

Property name Parameter type Data type Description
variantIds body array : integer

Ids of variants to get insights for

Response status OK (200)

array : EntityEnrichmentInsight
EntityEnrichmentInsight
Property name Data type Description
EnrichmentInsightSetupUid string

Uid of enrichment insight

EntityId integer

Id of entity

Completeness integer

Completeness in percentage (0 - 100). Is null, if ignored is true

MissingData array : InsightDataReference

List of missing data for this entity to reach 100% completeness for this enrichment insight

Ignored boolean

Indicates whether the completeness is ignored for this entity and this enrichment insight

InsightDataReference
Property name Data type Description
Type string

Type of data reference

DataReference string

The data reference itself


PATCH /variants/batch/enrichmentinsights/{enrichmentInsightSetupUid}/{ignore} Enable or disable an enrichment insight for a batch of variants

#Available from v.3.5.0

Request parameters

Property name Parameter type Data type Description
variantIds body array : integer

Ids of variants to toggle ignore for

enrichmentInsightSetupUid path string

Uid of enrichment insight to toggle ignore for

ignore path boolean

Indicate whether to ignore the insight for the given enrichment insight and variants

Response status OK (200)

No body message is returned

POST /variants/batch/enrichmentinsights/{enrichmentInsightUid} Get insights for a batch of variants and a specific Enrichment Insight

#Available from v.3.5.0

Request parameters

Property name Parameter type Data type Description
variantIds body array : integer

Ids of variants to get insights for

enrichmentInsightUid path string

Uid of enrichment insight to get for batch of variants

Response status OK (200)

array : EntityEnrichmentInsight
EntityEnrichmentInsight
Property name Data type Description
EnrichmentInsightSetupUid string

Uid of enrichment insight

EntityId integer

Id of entity

Completeness integer

Completeness in percentage (0 - 100). Is null, if ignored is true

MissingData array : InsightDataReference

List of missing data for this entity to reach 100% completeness for this enrichment insight

Ignored boolean

Indicates whether the completeness is ignored for this entity and this enrichment insight

InsightDataReference
Property name Data type Description
Type string

Type of data reference

DataReference string

The data reference itself


POST /variants/batch/identifiers Get internal ids of multiple variants from their identifier

Request parameters

Property name Parameter type Data type Description
model body object : IdentifierBatchModel

Specify alias of identifier type and the identifiers to return internal ids for

IdentifierBatchModel
Property name Data type Description
IdentifierAlias string

The alias of the identifier

Identifiers array

Array of identifiers to return internal ids for

Response status OK (200)

object

POST /variants/batch/references Get references to a batch of variants

#Available from v.3.5.0 No more than 5000 values can be requested at a time.

Request parameters

Property name Parameter type Data type Description
ids body array : integer

Ids of variants

Response status OK (200)

array : VariantReferences
VariantReferences
Property name Data type Description
VariantId integer

Id of the referenced variant

ReferencingCategories array : EntityReferenceDetail

List of categories referencing this variant

ReferencingProducts array : EntityReferenceDetail

List of products referencing this variant

ReferencingVariantGroups array : EntityReferenceDetail

List of variant groups referencing this variant

ReferencingVariants array : EntityReferenceDetail

List of variants referencing this variant

ReferencingGlobalListValues array

List of global list values referencing this variant

EntityReferenceDetail
Property name Data type Description
EntityId integer

The id of the referencing entity

AttributeUid string

The attribute on the referencing entity that holds the reference


GET /variants/identifiers/{identifierAlias} Get all identifiers and their internal ids for a specific identifier type

Request parameters

Property name Parameter type Data type Description
identifierAlias path string

Alias of identifier type

Response status OK (200)

object

GET /variants/identifiers/{identifierAlias}/{identifier} Get the internal id of a variant based on its identifier

Request parameters

Property name Parameter type Data type Description
identifierAlias path string

Alias of identifier type

identifier path string

Identifier value

Response status OK (200)

integer

GET /variants/ids Get ids of all variants in the system

By default, ids for archived variants are not returned

Request parameters

Property name Parameter type Data type Description
includeArchived query boolean

Include archived variants

Response status OK (200)

array : integer

GET /variants/queryfields Get all available query fields in the PIM installation

Response status OK (200)

array : QueryableField
QueryableField
Property name Data type Description
Uid string

Unique id of field in PIM

Name string

The display name of the field

SupportsSorting boolean

If true field can be used for sorting


POST /variants/search Get ids of variants matching certain criteria

Request parameters

Property name Parameter type Data type Description
model body object : SearchModel

Query model

SearchModel
Property name Data type Description
IncludeArchived boolean

Include archived items in result

QueryModel object : QueryModel

The actual query to get result for

QueryModel
This model is an abstract type and can attain any of the below concrete models. The QueryModelType property is used to define the actual model type
SimpleQueryModel
Simple query model used for querying specific fields
Property name Data type Description
Filters array : FieldFilterModel

List of filter conditions

BooleanOperator string

The operator of the query. Can be any of:

  • And / 0 (All conditions must match)
  • Or / 1 (At least one of the provided conditions must match)
QueryModelType string

The type of query model. Name matches exact name of concrete model implementation

BooleanQueryModel
Query wrapper for sub queries where the BooleanOperator operates between the sub queries. Allows for nested queries
Property name Data type Description
SubQueries array : QueryModel

Sub queries to execute

BooleanOperator string

The operator of the query. Can be any of:

  • And / 0 (All conditions must match)
  • Or / 1 (At least one of the provided conditions must match)
QueryModelType string

The type of query model. Name matches exact name of concrete model implementation

FieldFilterModel
Property name Data type Description
FieldUid string

Uid of field to query

QueryOperator string

Operator to use for query. Can be any of:

  • Equals / 0 (Value must start with FilterValue)
  • WildcardEquals / 1 (Value must be smaller than FilterValue)
  • SmallerThan / 2 (Value must be smaller than FilterValue)
  • LargerThan / 3 (Value must be larger than FilterValue)
  • IsEmpty / 4 (Value must be empty)
  • IsNotEmpty / 5 (Value must not be empty)
  • Contains / 6 (Value must contain FilterValue)
  • NotContains / 7 (Value must not contain FilterValue)
  • NotEquals / 8 (Value must not be exactly equal to FilterValue (not considering casing))
  • NotWildcardEquals / 9 (Value must not start with FilterValue)
  • InList / 10 (Item field value must match any of the in provided values in FilterList)
FilterValue object

Value to filter for using the QueryOperator. When QueryOperator is "InList", FilterValue must be an array of values to query for

Response status OK (200)

array : integer

POST /variants/search/paged Get paged result of variants matching certain criteria. Result mapped with headers and item results

Request parameters

Property name Parameter type Data type Description
model body object : SearchPagedModel

Query model

SearchPagedModel
Property name Data type Description
Page integer
PageSize integer
FieldUids array
SortByFieldUid string
SortDescending boolean
IncludeArchived boolean

Include archived items in result

QueryModel object : QueryModel

The actual query to get result for

QueryModel
This model is an abstract type and can attain any of the below concrete models. The QueryModelType property is used to define the actual model type
SimpleQueryModel
Simple query model used for querying specific fields
Property name Data type Description
Filters array : FieldFilterModel

List of filter conditions

BooleanOperator string

The operator of the query. Can be any of:

  • And / 0 (All conditions must match)
  • Or / 1 (At least one of the provided conditions must match)
QueryModelType string

The type of query model. Name matches exact name of concrete model implementation

BooleanQueryModel
Query wrapper for sub queries where the BooleanOperator operates between the sub queries. Allows for nested queries
Property name Data type Description
SubQueries array : QueryModel

Sub queries to execute

BooleanOperator string

The operator of the query. Can be any of:

  • And / 0 (All conditions must match)
  • Or / 1 (At least one of the provided conditions must match)
QueryModelType string

The type of query model. Name matches exact name of concrete model implementation

FieldFilterModel
Property name Data type Description
FieldUid string

Uid of field to query

QueryOperator string

Operator to use for query. Can be any of:

  • Equals / 0 (Value must start with FilterValue)
  • WildcardEquals / 1 (Value must be smaller than FilterValue)
  • SmallerThan / 2 (Value must be smaller than FilterValue)
  • LargerThan / 3 (Value must be larger than FilterValue)
  • IsEmpty / 4 (Value must be empty)
  • IsNotEmpty / 5 (Value must not be empty)
  • Contains / 6 (Value must contain FilterValue)
  • NotContains / 7 (Value must not contain FilterValue)
  • NotEquals / 8 (Value must not be exactly equal to FilterValue (not considering casing))
  • NotWildcardEquals / 9 (Value must not start with FilterValue)
  • InList / 10 (Item field value must match any of the in provided values in FilterList)
FilterValue object

Value to filter for using the QueryOperator. When QueryOperator is "InList", FilterValue must be an array of values to query for

Response status OK (200)

object : SearchResultModel
SearchResultModel
Property name Data type Description
TotalHits integer
Page integer
PageSize integer
TotalPages integer
ItemListHeaders array : ItemListHeader
ListItems array : ListItem
ItemListHeader
Property name Data type Description
FieldUid string
FieldName string
FieldType string
SupportsSearching boolean
SupportsSorting boolean
ListItem
Property name Data type Description
Id integer
ShownValues array