# Variants

The Filter parameter is used when querying for variants.

This property allows for easily achieved specific variant lookups. It's possible to use the filter property on any attribute on the variants.

A FilterPair always consists of a "FieldAlias"(string) that defines what PIM attribute should be used for filtering and a "FilterValue"(string) defining what value should be filtered on.

In Addition the API comes with several system attributes that are usable through the filter. These are listed below:

  • PIM.IsArchived
  • PIM.ArchiveReason
  • PIM.ProductConfiguration
  • PIM.DefiningAttributeStatus
  • PIM.ExternalRef
  • PIM.ItemId
  • PIM.Name_ + language Id
  • PIM.NumVariants
  • PIM.PrimaryProductGroup
  • PIM.ProductGroupId
  • PIM.ProductGroupCount
  • PIM.ProductGroupPlacements
  • PIM.HierarchyPlacement. + hierarchy Id
  • PIM.HierarchyPlacementNum. + hierarchy Id
  • PIM.ProductType
  • PIM.VariantProductId

 

POST /GetVariantIds

Request

Body parameters: Filter
Filter
Property name Type Description
FilterPairs FilterPairs[] Array of filter key value pair
FilterPairs
Property name Type Description
FieldAlias string Unique alias of any custom attribute or system attribute
FilterValue string Value to filter on

Response status OK (200)

Return value: none
Property name Type Description
VariantIds int[] Array of variant ids

POST /GetUpdatedVariantIds

This endpoint return all variant ids of variants that were updated within a specified query.

Request

Body parameters: UpdatedIdsRequestModel
UpdatedIdsRequestModel
Property name Type Description
Since DateTimeOffset DateTime string with offset included
Filter Filter Filter for querying specific variants
ConsiderFields string[] Alias of specific fields to be checked to determine if variants had been updated (optional)
Filter
Property name Type Description
FilterPairs FilterPairs[] Array of filter key value pair
FilterPairs
Property name Type Description
FieldAlias string Unique alias of any custom attribute or system attribute
FilterValue string Value to filter on

Response status OK (200)

Return value: UpdatedVariantsDTO
UpdatedVariantsDTO
Property name Type Description
SystemTime DateTimeOffset Displays the system time for the time of the request
VariantIds int[] Array of variant ids

POST /GetVariants

This endpoint returns variant data based on variant ids. In addition it's possible to specify exactly which attributes to return and if they should be returned as rendered values.

Request

Body parameters: IdsRequestModel
IdsRequestModel
Property name Type Description
Ids int[] Array of variant ids for the request
AttributeAliases string[] Specify attributes to return, if none are specified, all will be returned
SpecificationAttributeAliases string[] Specify specificationattributes to return, if none are specified, all will be returned
IncludeRenderedValues boolean If rendered values for specified attributes should be returned
IncludeRenderedSpecificationValues boolean If rendered specification values for specified attributes should be returned
UnfoldRenditionOfAttributesWithAliases string[]
UnfoldRenditionOfSpecificationAttributesWithAliases string[]

Response status OK (200)

Return value: VariantResult
VariantResult
Property name Type Description
Variants VariantDTO[] Array of variants including metadata and values depending on request
Attributes Attributes Object of all relevant attributes as object
VariantDTO
Property name Type Description
Id int unique id of variant
ProductId int Id of the product that the variant belongs to
ExternalRef string External reference for the variant
Name string Localized name for the variant
Created DateTimeOffset Datetime string including offset of when the variant was created
LastModified DateTimeOffset Datetime string including offset of when the variant was last modified
DefiningAttributes DefiningAttributeDTO[] Attributes marked as defining for the variant
Values AttributeValue[] Array of different attribute values from the variant
SpecificationAttributes AttributeValue[] Array of different specification attribute values from the variant
RenderedSpecificationValues RenderedAttributeValue[] See Attribute section for more info
RenderedValues RenderedAttributeValue[] See Attribute section for more info
Attributes
Property name Type Description
Key guid Guid of attribute used as key
Value Attribute See Attribute section for more info
DefiningAttributeDTO
Property name Type Description
AttributeUid guid Unique identifier for attribute used as defining attribtue
AttributeValue
Property name Type Description
Uid guid Unique identifier for value
AttributeUid guid Unique identifier for attribute
AttributeValueType string Type of value as string
SortOrder int Sort order of value
AttributeAlias string Alias of the attribute. Properties for the AttributeValue will depend on this
IsTrue bool If value is true
CalculatedValue string Caluclated value if value can be calculated
LocalizedCalculatedValue TranslatedValue<string> localized value if the value is translateable
SubAttributeValues AttributeValue[] Array of sub attributes (ComplexAttributeValue)
DateTime DateTimeOffset Datetime value with timezone offset (DateTimeAttributeValue)
ReferencedAttributeValueUids guid[] Array of guids refering to another globallist attributevalues (FixedListAttributeValue)
ReferencedAttributeValues AttributeValue[] Array of attributevalues from another globallist (FixedListAttributeValue)
LocalizedImageId TranslatedValue<int> Localized value for image
ItemReferences ProductReference[] Array of productreferences (ProductAttributeValue)
LocalizedX TranslatedValue<decimal> translated decimal value. AttributeValueType: (LocalizedAreaAttributeValue, LocalizedRangeAttributeValue)
LocalizedY TranslatedValue<decimal> translated decimal value AttributeValueType: (LocalizedAreaAttributeValue, LocalizedRangeAttributeValue)
LocalizedZ TranslatedValue<decimal> translated decimal value AttributeValueType: (LocalizedAreaAttributeValue, LocalizedRangeAttributeValue)
LocalizedFrom TranslatedValue<decimal> translated decimal value
LocalizedTo TranslatedValue<decimal> translated decimal value
LocalizedMediaIds TranslatedValue<int[]> translated list of media ids
LocalizedContentIds TranslatedValue<int[]> translated list of content ids
From decimal
To decimal
LocalizedText TranslatedValue<string> Translated string values
Text string
X decimal AttributeValueType: (VolumeAttributeValue, AreaAttributeValue)
RenderedAttributeValue
Property name Type Description
Value TranslatedValue<string> Translated value as string
SortOrder int If attribute has been sorted, an integer will be included depicting it's sortorder
ProductReference
Property name Type Description
ItemId string Unique item id of referenced product
ItemName string Name of referenced product
ReferenceType int Reference type derived from Enum (ProductGroup = 10, Product = 20, Variant = 30, Collection = 40)
TranslatedValue<type>
Property name Type Description
LocalizedValues LocalizedValue[] List of translated names with language ids
LocalizedValue
Property name Type Description
LanguageId int Unique id of language
LocalizedVal type Value of variable type

POST /GetVariantIdsByProductIds

Request

Body parameters: IdsRequestModel
Property name Type Description
Ids int[] Array of product group ids

Response status OK (200)

Return value: VariantIdsByProductIds
VariantIdsByProductIds
Property name Type Description
ProductId int Id of the product
VariantIds int[] Ids of the variants associated with the product

GET /GetVariantIdsForProduct

Request

Query parameters:
Property name Type Description
productId int Id of the product in question

Response status OK (200)

Return value: none
Property name Type Description
VariantIds int[] Array of variant ids associated with the queried product

POST /GetInternalVariantIdToExternalRefMap

Request

Body parameters: ExternalRefListModel
ExternalRefListModel
Property name Type Description
ExternalRefs string[]

Response status OK (200)

Return value: InternalVariantIdToExternalRefMap
InternalVariantIdToExternalRefMap
Property name Type Description
Key string External reference of variant is given as key
Value int Product id is given as value

POST /GetConfigurationAliasByVariantExternalRef

Request

Body parameters: ExternalRefListModel
ExternalRefListModel
Property name Type Description
ExternalRefs string[]

Response status OK (200)

Return value: ConfigurationAliasByVariantExternalRef

POST /GetVariantsWithAssociatedProducts

When requesting this endpoint the return type will contain both product and variant data in the form of the "ProductResult"-object and "VariantResult"-object. What these objects contain is specified using the query model.

Request

Body parameters: IdsRequestModel
IdsRequestModel
Property name Type Description
Ids int[] Array of variant ids for the request
AttributeAliases string[] Specify attributes to return, if none are specified, all will be returned
SpecificationAttributeAliases string[] Specify specificationattributes to return, if none are specified, all will be returned
IncludeRenderedValues boolean If rendered values for specified attributes should be returned
IncludeRenderedSpecificationValues boolean If rendered specification values for specified attributes should be returned
UnfoldRenditionOfAttributesWithAliases string[]
UnfoldRenditionOfSpecificationAttributesWithAliases string[]

Response status OK (200)

Return value: VariantsWithProductsDTO
VariantsWithProductsDTO
Property name Type Description
ProductResult ProductResult Product data container
VariantResult VariantResult Product data container
ProductResult
Property name Type Description
Products ProductDTO[] Array of products including metadata and values depending on request
Attributes Attributes Object of all relevant attributes as object
VariantResult
Property name Type Description
Variants VariantDTO[] Array of variants including metadata and values depending on request
Attributes Attributes Object of all relevant attributes as object
ProductDTO
Property name Type Description
Id int unique id of product
ConfigurationAlias string Alias of the products product configuration
ProductTypeAlias string Alias of the products product type
ExternalRef string External reference for the product
Name string Localized name for the product
Created DateTimeOffset Datetime string including offset of when the product was created
LastModified DateTimeOffset Datetime string including offset of when the product was last modified
PrimaryGroupId int
ProductGroupIds int[]
ProductGroupSortings KeyValuePair If product groups are sorted, their sorting will be listed with group id as key and sort number as value
Values AttributeValue[] Array of different attribute values from the product
SpecificationAttributes AttributeValue[] Array of different specification attribute values from the product
RenderedSpecificationValues RenderedAttributeValue[] See Attribute section for more info
RenderedValues RenderedAttributeValue[] See Attribute section for more info
VariantDTO
Property name Type Description
Id int unique id of variant
ProductId int Id of the product that the variant belongs to
ExternalRef string External reference for the variant
Name string Localized name for the variant
Created DateTimeOffset Datetime string including offset of when the variant was created
LastModified DateTimeOffset Datetime string including offset of when the variant was last modified
DefiningAttributes DefiningAttributeDTO[] Attributes marked as defining for the variant
Values AttributeValue[] Array of different attribute values from the variant
SpecificationAttributes AttributeValue[] Array of different specification attribute values from the variant
RenderedSpecificationValues RenderedAttributeValue[] See Attribute section for more info
RenderedValues RenderedAttributeValue[] See Attribute section for more info
Attributes
Property name Type Description
Key guid Guid of attribute used as key
Value Attribute See Attribute section for more info
AttributeValue
Property name Type Description
Uid guid Unique identifier for value
AttributeUid guid Unique identifier for attribute
AttributeValueType string Type of value as string
SortOrder int Sort order of value
AttributeAlias string Alias of the attribute. Properties for the AttributeValue will depend on this
IsTrue bool If value is true
CalculatedValue string Caluclated value if value can be calculated
LocalizedCalculatedValue TranslatedValue<string> localized value if the value is translateable
SubAttributeValues AttributeValue[] Array of sub attributes (ComplexAttributeValue)
DateTime DateTimeOffset Datetime value with timezone offset (DateTimeAttributeValue)
ReferencedAttributeValueUids guid[] Array of guids refering to another globallist attributevalues (FixedListAttributeValue)
ReferencedAttributeValues AttributeValue[] Array of attributevalues from another globallist (FixedListAttributeValue)
LocalizedImageId TranslatedValue<int> Localized value for image
ItemReferences ProductReference[] Array of productreferences (ProductAttributeValue)
LocalizedX TranslatedValue<decimal> translated decimal value. AttributeValueType: (LocalizedAreaAttributeValue, LocalizedRangeAttributeValue)
LocalizedY TranslatedValue<decimal> translated decimal value AttributeValueType: (LocalizedAreaAttributeValue, LocalizedRangeAttributeValue)
LocalizedZ TranslatedValue<decimal> translated decimal value AttributeValueType: (LocalizedAreaAttributeValue, LocalizedRangeAttributeValue)
LocalizedFrom TranslatedValue<decimal> translated decimal value
LocalizedTo TranslatedValue<decimal> translated decimal value
LocalizedMediaIds TranslatedValue<int[]> translated list of media ids
LocalizedContentIds TranslatedValue<int[]> translated list of content ids
From decimal
To decimal
LocalizedText TranslatedValue<string> Translated string values
Text string
X decimal AttributeValueType: (VolumeAttributeValue, AreaAttributeValue)
RenderedAttributeValue
Property name Type Description
Value TranslatedValue<string> Translated value as string
SortOrder int If attribute has been sorted, an integer will be included depicting it's sortorder
ProductReference
Property name Type Description
ItemId string Unique item id of referenced product
ItemName string Name of referenced product
ReferenceType int Reference type derived from Enum (ProductGroup = 10, Product = 20, Variant = 30, Collection = 40)
TranslatedValue<type>
Property name Type Description
LocalizedValues LocalizedValue[] List of translated names with language ids
LocalizedValue
Property name Type Description
LanguageId int Unique id of language
LocalizedVal type Value of variable type

POST /CreateOrUpdateVariants

Request

Body parameters: VariantApiObject[]
VariantApiObject
Property name Type Description
ExternalRef string External reference for the product
AttributeValues ApiWriteObject[] Array of attribute values to create or update including meta data of the values
SpecificationAttributeValues ApiWriteObject[] Array of specification attribute values to create or update including meta data of the values
ProductRef ApiWriteObject[] Write object containing a product reference to which the variant belongs
ApiWriteObject
Property name Type Description
IsKey boolean If the value is the key for determining if there is a value that should be updated
IsParentKey boolean If object is a key of a parent
Alias string Alias to identify what field the value is representing
Value object The value itself, the API accepts object that match the setup of the global list
KeyHash string

Response status OK (200)

Return value: none

POST /UpdateVariants

Request

Body parameters: VariantApiObject[]
VariantApiObject
Property name Type Description
ExternalRef string External reference for the product
AttributeValues ApiWriteObject[] Array of attribute values to create or update including meta data of the values
SpecificationAttributeValues ApiWriteObject[] Array of specification attribute values to create or update including meta data of the values
ProductRef ApiWriteObject[] Write object containing a product reference to which the variant belongs
ApiWriteObject
Property name Type Description
IsKey boolean If the value is the key for determining if there is a value that should be updated
IsParentKey boolean If object is a key of a parent
Alias string Alias to identify what field the value is representing
Value object The value itself, the API accepts object that match the setup of the global list
KeyHash string

Response status OK (200)

Return value: none

POST /DeleteVariants

Request

Body parameters: ApiWriteObject[]
ApiWriteObject
Property name Type Description
IsKey boolean If the value is the key for determining if there is a value that should be updated
IsParentKey boolean If object is a key of a parent
Alias string Alias to identify what field the value is representing
Value object The value itself, the API accepts object that match the setup of the global list
KeyHash string

Response status OK (200)

Return value: none


© 2024 Struct - All rights reserved.