Hide menu Last updated: Oct 20 2016
Area: Episerver Service API Applies to versions: 2 and higher Previous versions: Not applicable

Catalog service

EPiServer.ServiceApi allows for bulk importing of catalog data into Episerver Commerce. See Setting up EPiServer.ServiceApi and Overview of EPiServer.ServiceApi, for information about installing and configuring the service API.

Catalog bulk import methods

Catalog bulk import with file

episerverapi/commerce/import/catalog
The following Catalog XML shows how to generate the XML needed for the method. For this method to work, you need to generate an XML file called Catalog.xml and place at the root of a zip file to be uploaded.

C#
using (var client = new HttpClient())
{
	client.BaseAddress = new Uri("https://mysite.com/");
	client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
	var content = new MultipartFormDataContent();
	var filestream = new FileStream(path, FileMode.Open);
	content.Add(new StreamContent(filestream), "file", "Catalog.zip");
	var response = client.PostAsync("/episerverapi/commerce/import/catalog", content).Result;
	if (response.StatusCode == HttpStatusCode.OK)
	{
		var returnString = response.Content.ReadAsStringAsync().Result;
		returnString = returnString.Replace("\"", "");
		Guid taskId = Guid.Empty;
		Guid.TryParse(returnString, out taskId);
	}
}
Response
"\"9e4bd26f-b263-488c-a5d3-3e4c9f87ac4f\""

Catalog bulk import with file upload identifier

episerverapi/commerce/import/catalog/{uploadId:guid}
The following Catalog XML shows how to generate the XML needed for the method. For this method to work, you need to a valid upload identifier of a catalog.zip file previously uploaded using the chunked upload methods.

C#
using (var client = new HttpClient())
{
	client.BaseAddress = new Uri("https://mysite.com/");
	client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
	var response = client.PostAsync(String.Format("episerverapi/commerce/import/catalog/{0}", uploadId), new FormUrlEncodedContent(new List<KeyValuePair<String, String>>())).Result;
	if (response.StatusCode == HttpStatusCode.OK)
	{
		var returnString = response.Content.ReadAsStringAsync().Result;
		returnString = returnString.Replace("\"", "");
		Guid taskId = Guid.Empty;
		Guid.TryParse(returnString, out taskId);
	}
}
Response
"\"9e4bd26f-b263-488c-a5d3-3e4c9f87ac4f\""

Catalog bulk export methods

Catalog bulk export

episerverapi/commerce/export/catalog/{name}
This method returns a zip file of the exported contents of the catalog specified in the name parameter.

C#
using (var client = new HttpClient())
{
    client.BaseAddress = new Uri("https://mysite.com/");
    client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
    var response = client.GetAsync("/episerverapi/commerce/export/catalog/{name}").Result;
    if (response.StatusCode == HttpStatusCode.OK)
    {
        var zip = response.Content.ReadAsStreamAsync().Result;
        zip.CopyTo(File.Create("output.zip"));
    }
}

Catalog XML

The mechanism for using bulk import is a catalog.xml file. This section explains how to create the file. You can download the XSD for the catalog.xml here.

Catalog element

The catalog XML starts with an XML tag followed by the Catalogs element which holds the key elements, as shown in the following example.

XML
<?xml version="1.0" encoding="utf-8" ?>
<Catalogs Version="1.0">
    
</Catalogs>

MetaDataScheme element

The MetaDataScheme element lets you add and update metaclasses and metafields, as shown in the following example.

XML
<Catalogs Version="1.0">
    <MetaDataScheme>  
        <MetaDataPlusBackup version="1.0">
            <MetaClass>
                .......
            </MetaClass>
            <MetaField>
                .......
            </MetaField>
        </MetaDataPlusBackup>  
    </MetaDataScheme>
    ........ 
</Catalogs>
The following example describes the two child element types MetaClass and MetaField.

MetaClass

XML
 <MetaClass>
    <Namespace></Namespace>
    <Name></Name>
    <FriendlyName></FriendlyName>
    <MetaClassType></MetaClassType>
    <ParentClass></ParentClass>
    <TableName></TableName>
    <Description/>
    <IsSystem></IsSystem>
    <IsAbstract></IsAbstract>
    <FieldListChangedSqlScript/>
    <Tag/>
    <Attributes/>
</MetaClass>
  • Namespace (required). Should always be Mediachase.Commerce.Catalog.User if you want to be able to delete from user interface.
  • Name (required). Name of metaclass should only contain letters, numbers, and underscore ( _ ). No spaces or special characters are allowed.
  • FriendlyName (required). Describes the class that is shown in the user interface.
  • MetaClassType (required). Should always be User.
  • ParentClass (required) . Either CatalogNode or CatalogEntry based on the type of MetaClass.
  • TableName (required). ParentClass + Ex_ + MetaClass Name (for example, CatalogEntryEx_import_product).
  • Description. Description of what the class is used for.
  • IsSystem (required). Should always be false.
  • IsAbstract (required). Should always be false.
  • FieldListChangedSqlScript. Should always be empty.
  • Tag. Should always be empty.
  • Attributes. Should always be empty.

MetaField

XML
<MetaField>
    <Namespace></Namespace>
    <Name></Name>
    <FriendlyName></FriendlyName>
    <Description/>
    <DataType></DataType>
    <Length></Length>
    <AllowNulls></AllowNulls>
    <SaveHistory></SaveHistory>
    <AllowSearch></AllowSearch>
    <MultiLanguageValue></MultiLanguageValue>
    <IsSystem></IsSystem>
    <Tag/>
    <Attributes>
        <Attribute>
            <Key></Key>
            <Value></Value>
        </Attribute>
        <Attribute>
            <Key></Key>
            <Value></Value>
        </Attribute>
    </Attributes>
    <OwnerMetaClass></OwnerMetaClass>
    <OwnerMetaClass>t</OwnerMetaClass>
</MetaField>
  • Namespace (required). Should always be Mediachase.Commerce.Catalog if you want to be able to delete from user interface.
  • Name (required). Name of meta class should only contain letters, numbers, and underscore ( _ ). No spaces or special characters are allowed.
  • FriendlyName (required). Describes the class that is shown in the user interface.
  • Description. Description of what the field is used for.
  • DataType (required)
    • Boolean
    • Date
    • DateTime
    • Decimal
    • DictionaryMultiValue
    • DictionarySingleValue
    • Email
    • File
    • Float
    • LongHtmlString
    • ImageFile
    • Integer
    • LongString
    • Money
    • ShortString
    • StringDictionary
    • URL

      >Note: File and ImageFile are stored in the database.

  • Length (required)
    • Boolean. 1.
    • Date. 8.
    • DateTime. 8.
    • Decimal. 17.
    • DictionaryMultiValue. 4.
    • DictionarySingleValue. 4.
    • Email. 256.
    • File. 4.
    • Float. 8.
    • LongHtmlString. 16.
    • ImageFile. 4.
    • Integer. 4.
    • LongString. 16.
    • Money. 8.
    • ShortString. 512.
    • StringDictionary. 4.
    • URL. 512.
  • AllowNulls (required). True or False. This property cannot be changed after that fact so make sure to choose properly.
  • SaveHistory. Legacy and not used.
  • AllowSearch (required). True or False based on if you want the field to be searchable in configured search index.
  • MultiLanguageValue (required). True or False based on if you want the field to be culture-specific.
  • IsSystem (required). Should always be false.
  • Tag. Should always be empty.
  • Attributes. A collection of Attribute elements with key and values. Valid Attributes keys are:
    • useincomparing. True or False based on if you want the field to be used in comparisons.
    • Only use the attributes when AllowSearch property of metafield is set to true:
      • indexfield. tokenized based on if you want the field to be tokenized, the attribute should be removed if you no longer want tokenized.
      • indexsortable. True or False based on if you want the field to be able to sorted upon in search index.
      • indexstored. True or False based on if you want the field to be stored in the index.
      • includeindefaultsearch. True or False based on if you want the field to be used in default search.
    • Only use the attributes when DataType property of metafield is set to ImageFile:
      • autoresize. True or False based on if you want the image to be auto resized.
      • imageheight. Number of pixels for height when resizing image.
      • imagewidth. Number of pixels for width when resizing image.
      • stretchimage. True or False based on if you want the image to stretch if the resize is bigger than the image itself.
      • stretchthumbnail. True or False based on if you want the thumbnail image to stretch if the thumbnail resize is bigger than the image itself.
      • thumbnailheight. Number of pixels for height when resizing thumbnail image.
      • thumbnailwidth. Number of pixels for width when resizing thumbnail image.
  • OwnerMetaClass. Which metaclasses this field belongs to. The linkage is done on MetaClass Name.

Example

The following example shows the MetaDataScheme with three classes and every type of MetaField.

XML
 <Catalogs Version="1.0">
    <MetaDataScheme>  
        <MetaDataPlusBackup version="1.0">
            <MetaClass>
                <Namespace>Mediachase.Commerce.Catalog.User</Namespace>
                <Name>import_node</Name>
                <FriendlyName>import_node</FriendlyName>
                <MetaClassType>User</MetaClassType>
                <ParentClass>CatalogNode</ParentClass>
                <TableName>CatalogNodeEx_import_node</TableName>
                <Description/>
                <IsSystem>False</IsSystem>
                <IsAbstract>False</IsAbstract>
                <FieldListChangedSqlScript/>
                <Tag/>
                <Attributes/>
            </MetaClass>
            <MetaClass>
                <Namespace>Mediachase.Commerce.Catalog.User</Namespace>
                <Name>import_node</Name>
                <FriendlyName>import_product</FriendlyName>
                <MetaClassType>User</MetaClassType>
                <ParentClass>CatalogEntry</ParentClass>
                <TableName>CatalogEntryEx_import_product</TableName>
                <Description/>
                <IsSystem>False</IsSystem>
                <IsAbstract>False</IsAbstract>
                <FieldListChangedSqlScript/>
                <Tag/>
                <Attributes/>
            </MetaClass>
            <MetaClass>
                <Namespace>Mediachase.Commerce.Catalog.User</Namespace>
                <Name>import_sku</Name>
                <FriendlyName>import_sku</FriendlyName>
                <MetaClassType>User</MetaClassType>
                <ParentClass>CatalogEntry</ParentClass>
                <TableName>CatalogEntryEx_import_sku</TableName>
                <Description/>
                <IsSystem>False</IsSystem>
                <IsAbstract>False</IsAbstract>
                <FieldListChangedSqlScript/>
                <Tag/>
                <Attributes/>
            </MetaClass>
            <MetaField>
                <Namespace>Mediachase.Commerce.Catalog</Namespace>
                <Name>import_boolean</Name>
                <FriendlyName>import_boolean</FriendlyName>
                <Description/>
                <DataType>Boolean</DataType>
                <Length>1</Length>
                <AllowNulls>True</AllowNulls>
                <SaveHistory>False</SaveHistory>
                <AllowSearch>False</AllowSearch>
                <MultiLanguageValue>False</MultiLanguageValue>
                <IsSystem>False</IsSystem>
                <Tag/>
                <Attributes>
                    <Attribute>
                        <Key>useincomparing</Key>
                        <Value>False</Value>
                    </Attribute>
                </Attributes>
                <OwnerMetaClass>import_node</OwnerMetaClass>
                <OwnerMetaClass>import_product</OwnerMetaClass>
                <OwnerMetaClass>import_sku</OwnerMetaClass>
            </MetaField>
            <MetaField>
                <Namespace>Mediachase.Commerce.Catalog</Namespace>
                <Name>import_date</Name>
                <FriendlyName>import_date</FriendlyName>
                <Description/>
                <DataType>Date</DataType>
                <Length>8</Length>
                <AllowNulls>True</AllowNulls>
                <SaveHistory>False</SaveHistory>
                <AllowSearch>False</AllowSearch>
                <MultiLanguageValue>False</MultiLanguageValue>
                <IsSystem>False</IsSystem>
                <Tag/>
                <Attributes>
                    <Attribute>
                        <Key>useincomparing</Key>
                        <Value>False</Value>
                    </Attribute>
                </Attributes>
                <OwnerMetaClass>import_node</OwnerMetaClass>
                <OwnerMetaClass>import_product</OwnerMetaClass>
                <OwnerMetaClass>import_sku</OwnerMetaClass>
            </MetaField>
            <MetaField>
                <Namespace>Mediachase.Commerce.Catalog</Namespace>
                <Name>import_datetime</Name>
                <FriendlyName>import_datetime</FriendlyName>
                <Description/>
                <DataType>DateTime</DataType>
                <Length>8</Length>
                <AllowNulls>True</AllowNulls>
                <SaveHistory>False</SaveHistory>
                <AllowSearch>True</AllowSearch>
                <MultiLanguageValue>False</MultiLanguageValue>
                <IsSystem>False</IsSystem>
                <Tag/>
                <Attributes>
                    <Attribute>
                        <Key>includeindefaultsearch</Key>
                        <Value>True</Value>
                    </Attribute>
                    <Attribute>
                        <Key>indexfield</Key>
                        <Value>tokenized</Value>
                    </Attribute>
                    <Attribute>
                        <Key>indexsortable</Key>
                        <Value>True</Value>
                    </Attribute>
                    <Attribute>
                        <Key>indexstored</Key>
                        <Value>True</Value>
                    </Attribute>
                    <Attribute>
                        <Key>useincomparing</Key>
                        <Value>False</Value>
                    </Attribute>
                </Attributes>
                <OwnerMetaClass>import_node</OwnerMetaClass>
                <OwnerMetaClass>import_product</OwnerMetaClass>
                <OwnerMetaClass>import_sku</OwnerMetaClass>
            </MetaField>
            <MetaField>
                <Namespace>Mediachase.Commerce.Catalog</Namespace>
                <Name>import_decimal</Name>
                <FriendlyName>import_decimal</FriendlyName>
                <Description/>
                <DataType>Decimal</DataType>
                <Length>17</Length>
                <AllowNulls>True</AllowNulls>
                <SaveHistory>False</SaveHistory>
                <AllowSearch>False</AllowSearch>
                <MultiLanguageValue>False</MultiLanguageValue>
                <IsSystem>False</IsSystem>
                <Tag/>
                <Attributes>
                    <Attribute>
                        <Key>mdpprecision</Key>
                        <Value>14</Value>
                    </Attribute>
                    <Attribute>
                        <Key>mdpscale</Key>
                        <Value>4</Value>
                    </Attribute>
                    <Attribute>
                        <Key>useincomparing</Key>
                        <Value>False</Value>
                    </Attribute>
                </Attributes>
                <OwnerMetaClass>import_node</OwnerMetaClass>
                <OwnerMetaClass>import_product</OwnerMetaClass>
                <OwnerMetaClass>import_sku</OwnerMetaClass>
            </MetaField>
            <MetaField>
                <Namespace>Mediachase.Commerce.Catalog</Namespace>
                <Name>import_dictionary</Name>
                <FriendlyName>import_dictionary</FriendlyName>
                <Description/>
                <DataType>DictionaryMultiValue</DataType>
                <Length>4</Length>
                <AllowNulls>True</AllowNulls>
                <SaveHistory>False</SaveHistory>
                <AllowSearch>True</AllowSearch>
                <MultiLanguageValue>True</MultiLanguageValue>
                <IsSystem>False</IsSystem>
                <Tag/>
                <Attributes>
                    <Attribute>
                        <Key>useincomparing</Key>
                        <Value>False</Value>
                    </Attribute>
                </Attributes>
                <OwnerMetaClass>import_node</OwnerMetaClass>
                <OwnerMetaClass>import_product</OwnerMetaClass>
                <OwnerMetaClass>import_sku</OwnerMetaClass>
            </MetaField>
            <MetaField>
                <Namespace>Mediachase.Commerce.Catalog</Namespace>
                <Name>import_email</Name>
                <FriendlyName>import_email</FriendlyName>
                <Description/>
                <DataType>Email</DataType>
                <Length>256</Length>
                <AllowNulls>True</AllowNulls>
                <SaveHistory>False</SaveHistory>
                <AllowSearch>True</AllowSearch>
                <MultiLanguageValue>False</MultiLanguageValue>
                <IsSystem>False</IsSystem>
                <Tag/>
                <Attributes>
                    <Attribute>
                        <Key>useincomparing</Key>
                        <Value>False</Value>
                    </Attribute>
                </Attributes>
                <OwnerMetaClass>import_node</OwnerMetaClass>
                <OwnerMetaClass>import_product</OwnerMetaClass>
                <OwnerMetaClass>import_sku</OwnerMetaClass>
            </MetaField>
            <MetaField>
                <Namespace>Mediachase.Commerce.Catalog</Namespace>
                <Name>import_File</Name>
                <FriendlyName>import_File</FriendlyName>
                <Description/>
                <DataType>File</DataType>
                <Length>4</Length>
                <AllowNulls>True</AllowNulls>
                <SaveHistory>False</SaveHistory>
                <AllowSearch>False</AllowSearch>
                <MultiLanguageValue>False</MultiLanguageValue>
                <IsSystem>False</IsSystem>
                <Tag/>
                <Attributes>
                    <Attribute>
                        <Key>useincomparing</Key>
                        <Value>False</Value>
                    </Attribute>
                </Attributes>
                <OwnerMetaClass>import_node</OwnerMetaClass>
                <OwnerMetaClass>import_product</OwnerMetaClass>
                <OwnerMetaClass>import_sku</OwnerMetaClass>
            </MetaField>
            <MetaField>
                <Namespace>Mediachase.Commerce.Catalog</Namespace>
                <Name>import_float</Name>
                <FriendlyName>import_float</FriendlyName>
                <Description/>
                <DataType>Float</DataType>
                <Length>8</Length>
                <AllowNulls>True</AllowNulls>
                <SaveHistory>False</SaveHistory>
                <AllowSearch>True</AllowSearch>
                <MultiLanguageValue>False</MultiLanguageValue>
                <IsSystem>False</IsSystem>
                <Tag/>
                <Attributes>
                    <Attribute>
                        <Key>indexstored</Key>
                        <Value>True</Value>
                    </Attribute>
                <Attribute>
                <Key>useincomparing</Key>
                <Value>False</Value>
                </Attribute>
                </Attributes>
                <OwnerMetaClass>import_node</OwnerMetaClass>
                <OwnerMetaClass>import_product</OwnerMetaClass>
                <OwnerMetaClass>import_sku</OwnerMetaClass>
            </MetaField>
            <MetaField>
                <Namespace>Mediachase.Commerce.Catalog</Namespace>
                <Name>import_htmlstring</Name>
                <FriendlyName>import_htmlstring</FriendlyName>
                <Description/>
                <DataType>LongHtmlString</DataType>
                <Length>16</Length>
                <AllowNulls>True</AllowNulls>
                <SaveHistory>False</SaveHistory>
                <AllowSearch>True</AllowSearch>
                <MultiLanguageValue>True</MultiLanguageValue>
                <IsSystem>False</IsSystem>
                <Tag/>
                <Attributes>
                    <Attribute>
                        <Key>indexfield</Key>
                        <Value>tokenized</Value>
                    </Attribute>
                    <Attribute>
                        <Key>indexsortable</Key>
                        <Value>True</Value>
                    </Attribute>
                    <Attribute>
                        <Key>useincomparing</Key>
                        <Value>True</Value>
                    </Attribute>
                </Attributes>
                <OwnerMetaClass>import_node</OwnerMetaClass>
                <OwnerMetaClass>import_product</OwnerMetaClass>
                <OwnerMetaClass>import_sku</OwnerMetaClass>
            </MetaField>
            <MetaField>
                <Namespace>Mediachase.Commerce.Catalog</Namespace>
                <Name>import_imagefile</Name>
                <FriendlyName>import_imagefile</FriendlyName>
                <Description/>
                <DataType>ImageFile</DataType>
                <Length>4</Length>
                <AllowNulls>True</AllowNulls>
                <SaveHistory>False</SaveHistory>
                <AllowSearch>False</AllowSearch>
                <MultiLanguageValue>False</MultiLanguageValue>
                <IsSystem>False</IsSystem>
                <Tag/>
                <Attributes>
                    <Attribute>
                        <Key>autoresize</Key>
                        <Value>True</Value>
                    </Attribute>
                    <Attribute>
                        <Key>createthumbnail</Key>
                        <Value>True</Value>
                    </Attribute>
                    <Attribute>
                        <Key>imageheight</Key>
                        <Value>300</Value>
                    </Attribute>
                    <Attribute>
                        <Key>imagewidth</Key>
                        <Value>220</Value>
                    </Attribute>
                    <Attribute>
                        <Key>stretchimage</Key>
                        <Value>True</Value>
                    </Attribute>
                    <Attribute>
                        <Key>stretchthumbnail</Key>
                        <Value>True</Value>
                    </Attribute>
                    <Attribute>
                        <Key>thumbnailheight</Key>
                        <Value>50</Value>
                    </Attribute>
                    <Attribute>
                        <Key>thumbnailwidth</Key>
                        <Value>50</Value>
                    </Attribute>
                    <Attribute>
                        <Key>useincomparing</Key>
                        <Value>False</Value>
                    </Attribute>
                </Attributes>
                <OwnerMetaClass>import_node</OwnerMetaClass>
                <OwnerMetaClass>import_product</OwnerMetaClass>
                <OwnerMetaClass>import_sku</OwnerMetaClass>
            </MetaField>
            <MetaField>
                <Namespace>Mediachase.Commerce.Catalog</Namespace>
                <Name>import_integer</Name>
                <FriendlyName>import_integer</FriendlyName>
                <Description/>
                <DataType>Integer</DataType>
                <Length>4</Length>
                <AllowNulls>True</AllowNulls>
                <SaveHistory>False</SaveHistory>
                <AllowSearch>True</AllowSearch>
                <MultiLanguageValue>False</MultiLanguageValue>
                <IsSystem>False</IsSystem>
                <Tag/>
                <Attributes>
                    <Attribute>
                        <Key>useincomparing</Key>
                        <Value>False</Value>
                    </Attribute>
                </Attributes>
                <OwnerMetaClass>import_node</OwnerMetaClass>
                <OwnerMetaClass>import_product</OwnerMetaClass>
                <OwnerMetaClass>import_sku</OwnerMetaClass>
            </MetaField>
            <MetaField>
                <Namespace>Mediachase.Commerce.Catalog</Namespace>
                <Name>import_longstring</Name>
                <FriendlyName>import_longstring</FriendlyName>
                <Description/>
                <DataType>LongString</DataType>
                <Length>16</Length>
                <AllowNulls>False</AllowNulls>
                <SaveHistory>False</SaveHistory>
                <AllowSearch>False</AllowSearch>
                <MultiLanguageValue>False</MultiLanguageValue>
                <IsSystem>False</IsSystem>
                <Tag/>
                <Attributes>
                    <Attribute>
                        <Key>useincomparing</Key>
                        <Value>False</Value>
                    </Attribute>
                </Attributes>
                <OwnerMetaClass>import_node</OwnerMetaClass>
                <OwnerMetaClass>import_product</OwnerMetaClass>
                <OwnerMetaClass>import_sku</OwnerMetaClass>
            </MetaField>
            <MetaField>
                <Namespace>Mediachase.Commerce.Catalog</Namespace>
                <Name>import_money</Name>
                <FriendlyName>import_money</FriendlyName>
                <Description/>
                <DataType>Money</DataType>
                <Length>8</Length>
                <AllowNulls>True</AllowNulls>
                <SaveHistory>False</SaveHistory>
                <AllowSearch>False</AllowSearch>
                <MultiLanguageValue>False</MultiLanguageValue>
                <IsSystem>False</IsSystem>
                <Tag/>
                <Attributes>
                    <Attribute>
                        <Key>includeindefaultsearch</Key>
                        <Value>True</Value>
                    </Attribute>
                    <Attribute>
                        <Key>useincomparing</Key>
                        <Value>False</Value>
                    </Attribute>
                </Attributes>
                <OwnerMetaClass>import_node</OwnerMetaClass>
                <OwnerMetaClass>import_product</OwnerMetaClass>
                <OwnerMetaClass>import_sku</OwnerMetaClass>
            </MetaField>
            <MetaField>
                <Namespace>Mediachase.Commerce.Catalog</Namespace>
                <Name>import_shortstring</Name>
                <FriendlyName>import_shortstring</FriendlyName>
                <Description/>
                <DataType>ShortString</DataType>
                <Length>512</Length>
                <AllowNulls>True</AllowNulls>
                <SaveHistory>False</SaveHistory>
                <AllowSearch>False</AllowSearch>
                <MultiLanguageValue>True</MultiLanguageValue>
                <IsSystem>False</IsSystem>
                <Tag/>
                <Attributes>
                    <Attribute>
                        <Key>useincomparing</Key>
                        <Value>True</Value>
                    </Attribute>
                </Attributes>
                <OwnerMetaClass>import_node</OwnerMetaClass>
                <OwnerMetaClass>import_product</OwnerMetaClass>
                <OwnerMetaClass>import_sku</OwnerMetaClass>
            </MetaField>
            <MetaField>
                <Namespace>Mediachase.Commerce.Catalog</Namespace>
                <Name>import_stringdictionary</Name>
                <FriendlyName>import_stringdictionary</FriendlyName>
                <Description>testing description</Description>
                <DataType>StringDictionary</DataType>
                <Length>4</Length>
                <AllowNulls>True</AllowNulls>
                <SaveHistory>False</SaveHistory>
                <AllowSearch>True</AllowSearch>
                <MultiLanguageValue>True</MultiLanguageValue>
                <IsSystem>False</IsSystem>
                <Tag/>
                <Attributes>
                    <Attribute>
                        <Key>useincomparing</Key>
                        <Value>False</Value>
                    </Attribute>
                </Attributes>
                <OwnerMetaClass>import_node</OwnerMetaClass>
                <OwnerMetaClass>import_product</OwnerMetaClass>
                <OwnerMetaClass>import_sku</OwnerMetaClass>
            </MetaField>
            <MetaField>
                <Namespace>Mediachase.Commerce.Catalog</Namespace>
                <Name>import_url</Name>
                <FriendlyName>import_url</FriendlyName>
                <Description/>
                <DataType>URL</DataType>
                <Length>512</Length>
                <AllowNulls>True</AllowNulls>
                <SaveHistory>False</SaveHistory>
                <AllowSearch>False</AllowSearch>
                <MultiLanguageValue>False</MultiLanguageValue>
                <IsSystem>False</IsSystem>
                <Tag/>
                <Attributes>
                    <Attribute>
                        <Key>indexfield</Key>
                        <Value>tokenized</Value>
                    </Attribute>
                    <Attribute>
                        <Key>indexsortable</Key>
                        <Value>True</Value>
                    </Attribute>
                    <Attribute>
                        <Key>useincomparing</Key>
                        <Value>False</Value>
                    </Attribute>
                </Attributes>
                <OwnerMetaClass>import_node</OwnerMetaClass>
                <OwnerMetaClass>import_product</OwnerMetaClass>
                <OwnerMetaClass>import_sku</OwnerMetaClass>
            </MetaField>
        </MetaDataPlusBackup>  
    </MetaDataScheme>
    ........ 
</Catalogs> 

Dictionaries element

The Dictionaries element lets you add dictionaries to support catalogs, as shown in the following example.

XML
<Catalogs Version="1.0">
    <MetaDataScheme>
        .........  
    </MetaDataScheme>
    <Dictionaries>
        <Merchants/>
        <Packages></Packages>
        <TaxCategories></TaxCategories>
        <Warehouses></Warehouses>
        <AssociationTypes></AssociationTypes>
        <Markets></Markets>
    </Dictionaries>
    .........
</Catalogs> 

The following describes the child element types Merchants, Packages, Tax Categories, Warehouses, AssociationTypes and Markets.

Merchants

XML
<Merchants/>

This is a legacy element and is not used.

Packages

XML
<Packages>
    <Package>
        <Name></Name>
        <Description/>
        <Width></Width>
        <Length></Length>
        <Height></Height>
    </Package>
    <Package>
        <Name></Name>
        <Description/>
        <Width></Width>
        <Length></Length>
        <Height></Height>
    </Package>    
</Packages>
  • Name. Name of the package / box.
  • Description. Describes the intended use of the package / box.
  • Width. Width of the package / box.
  • Length. Length of the package / box.
  • Height. Height of the package / box.

TaxCategories

XML
<TaxCategories>
    <TaxCategory>
        <Name></Name>
    </TaxCategory>
    <TaxCategory>
        <Name></Name>
    </TaxCategory>    
</TaxCategories>
  • Name . Name of the tax category.

Warehouses

XML
<Warehouses>
    <Warehouse>
	    <Name></Name>
	    <IsActive></IsActive>
	    <IsPrimary></IsPrimary>
	    <SortOrder></SortOrder>
	    <Code></Code>
	    <IsFulfillmentCenter></IsFulfillmentCenter>
	    <IsPickupLocation></IsPickupLocation>
	    <IsDeliveryLocation></IsDeliveryLocation>
	    <FirstName></FirstName>
	    <LastName></LastName>
	    <Organization></Organization>
	    <Line1></Line1>
	    <Line2></Line2>
	    <City></City>
	    <State></State>
	    <CountryCode></CountryCode>
	    <CountryName></CountryName>
	    <PostalCode></PostalCode>
	    <RegionCode></RegionCode>
	    <RegionName></RegionName>
	    <DaytimePhoneNumber></DaytimePhoneNumber>
	    <EveningPhoneNumber></EveningPhoneNumber>
	    <FaxNumber></FaxNumber>
	    <Email></Email>
    </Warehouse>
        <Warehouse>
	    <Name></Name>
	    <IsActive></IsActive>
	    <IsPrimary></IsPrimary>
	    <SortOrder></SortOrder>
	    <Code></Code>
	    <IsFulfillmentCenter></IsFulfillmentCenter>
	    <IsPickupLocation></IsPickupLocation>
	    <IsDeliveryLocation></IsDeliveryLocation>
	    <FirstName></FirstName>
	    <LastName></LastName>
	    <Organization></Organization>
	    <Line1></Line1>
	    <Line2></Line2>
	    <City></City>
	    <State></State>
	    <CountryCode></CountryCode>
	    <CountryName></CountryName>
	    <PostalCode></PostalCode>
	    <RegionCode></RegionCode>
	    <RegionName></RegionName>
	    <DaytimePhoneNumber></DaytimePhoneNumber>
	    <EveningPhoneNumber></EveningPhoneNumber>
	    <FaxNumber></FaxNumber>
	    <Email></Email>
    </Warehouse>    
</Warehouses>
  • Name (required). Name of the warehouse.
  • IsActive (required). Whether the warehouse is active.
  • IsPrimary (required). Whether the warehouse is a primary location.
  • SortOrder (required). Sort order when retrieving warehouses.
  • Code (required). Unique identifier of warehouse must be unique.
  • IsFulfillmentCenter (required). Whether the warehouse is a fulfillment center location.
  • IsPickupLocation (required). Whether the warehouse is a pickup location.
  • IsDeliveryLocation (required). Whether the warehouse is a delivery location.
  • FirstName. First name of primary warehouse contact.
  • LastName. Last name of primary warehouse contact.
  • Organization. Company name of warehouse.
  • Line1. Line 1 address of warehouse.
  • Line2. Line 2 address of warehouse
  • City. City address of warehouse.
  • State. State address of warehouse.
  • CountryCode. Country code address of warehouse.
  • CountryName. Country name address of warehouse.
  • PostalCode. Postal code address of warehouse.
  • RegionCode. Region code address of warehouse.
  • RegionName. Region name address of warehouse.
  • DaytimePhoneNumber. Daytime phone number of warehouse.
  • EveningPhoneNumber. Evening phone number of warehouse.
  • FaxNumber. Fax number of warehouse.
  • Email. Email address of warehouse.

AssociationTypes

XML
<AssociationTypes>
	<AssociationType>
		<TypeId></TypeId>
		<Description/>
	</AssociationType>
	<AssociationType>
		<TypeId></TypeId>
		<Description></Description>
	</AssociationType>
</AssociationTypes>
  • TypeId. The association type.
  • Description. Description of association type.

Markets

XML
<Markets>
    <Market>
        <MarketId></MarketId>
        <IsEnabled></IsEnabled>
        <MarketName></MarketName>
        <MarketDescription></MarketDescription>
        <DefaultLanguage></DefaultLanguage>
        <DefaultCurrency></DefaultCurrency>
        <Currencies>
            <Currency></Currency>
            <Currency></Currency>
        </Currencies>
        <Languages>
            <Language></Language>
            <Language></Language>
        </Languages>
        <Countries>
            <Country></Country>
            <Country></Country>
        </Countries>
    </Market>
    <Market>
        <MarketId></MarketId>
        <IsEnabled></IsEnabled>
        <MarketName></MarketName>
        <MarketDescription></MarketDescription>
        <DefaultLanguage></DefaultLanguage>
        <DefaultCurrency></DefaultCurrency>
        <Currencies>
            <Currency></Currency>
            <Currency></Currency>
        </Currencies>
        <Languages>
            <Language></Language>
            <Language></Language>
        </Languages>
        <Countries>
            <Country></Country>
            <Country></Country>
        </Countries>
    </Market>
</Markets>
        • MarketId. The unique market ID.
        • IsEnabled. If the market is enabled.
        • MarketName. The name of the market.
        • MarketDescription. The description of the market.
        • DefaultLanguage. Default language of the market.
        • DefaultCurrency. Default currency of the market.
        • Currencies. Has collection of Currency elements.
          • Currency. The currency code.

Languages

          . Has collection of language elements.
          • Language. The language code.

Countries

        . Has collection of country elements.
        • Country. The country code.

Catalog element

The Catalog element lets you add and update catalogs, catalog nodes, and catalog entries, as shown in the following example.

XML
<Catalogs Version="1.0">
    <MetaDataScheme>  
        ........
    </MetaDataScheme>
    <Dictionaries>  
        ........
    </Dictionaries>
    <Catalog isActive="" sortOrder="" defaultLanguage="" weightBase="" defaultCurrency="" endDate="" startDate="" lastmodified="" name="">
        <Languages><Languages>
        <Nodes totalCount="1"></Nodes>
        <Entries totalCount="2"></Entries>
        <Relations></Relations>
        <Associations></Associations>
    </Catalog>
</Catalogs> 

The following describes the catalog element attributes and child elements types Languages, Nodes, Entries, Relations, and Associations.

Catalog Attributes

      • isActive (required). True or False based on if you want the catalog is active.
      • sortOrder (required). Order when returned from getting list of catalogs.
      • defaultLanguage (required). Default language of catalog.
      • weightBase (required). Default weight metric of catalog.
      • defaultCurrency (required). Default currency of catalog.
      • endDate (required). UTC date when catalog is no longer available.
      • startDate (required). UTC date when catalog is available.
      • lastmodified. Date when catalog was updated.
      • name (required). Name of catalog.

Languages Element

XML
<Languages>
	<Language>
		<LanguageCode></LanguageCode>
		<UriSegment></UriSegment>
	</Language>
	<Language>
		<LanguageCode></LanguageCode>
		<UriSegment></UriSegment>
	</Language>
</Languages>
      • LanguageCode (required). The language code.
      • UriSegment (required). The segment to the catalog language.

Nodes Element

XML
<Nodes totalCount="1">
	<Node>
		<Name></Name>
		<StartDate></StartDate>
		<EndDate></EndDate>
		<IsActive></IsActive>
		<SortOrder></SortOrder>
		<DisplayTemplate/>
		<Code></Code>
		<MetaData>
			<MetaClass>
				<Name></Name>
			</MetaClass>
			<MetaFields>
				<MetaField>
					<Name></Name>
					<Type></Type>
					<Data language="" value=""/>
				</MetaField>
				<MetaField>
					<Name></Name>
					<Type></Type>
   					</Data>
						<item value="" key="" />
						<item value="" key="" />
					</Data>
				</MetaField>
			</MetaFields>
		</MetaData>
		<ParentNode></ParentNode>
		<SeoInfo>
			<Seo>
				<LanguageCode></LanguageCode>
				<Uri></Uri>
				<Title/>
				<Description/>
				<Keywords/>
				<UriSegment></UriSegment>
			</Seo>
		</SeoInfo>
	</Node>
</Nodes>
      • Name (required). The name of the node.
      • StartDate (required). The UTC date when the node becomes available.
      • EndDate (required). The UTC date when the node becomes unavailable.
      • IsActive (required). Whether or not the node is active.
      • SortOrder (required). The order in which the node is retrieved when getting list of nodes.
      • DisplayTemplate. Legacy not used anymore.
      • Code (required). The unique identifier of the node.
      • MetaData (required). This element is responsible for updating the meta data of the node.
        • MetaClass
          • Name (required). The name of the metaclass that the node is linked to.
        • MetaFields
          • MetaField
              • Name (required). The name of the metafield.
              • Type (required). The MetaDataType of the metafield.
                • Boolean
                • Date
                • DateTime
                • Decimal
                • DictionaryMultiValue
                • DictionarySingleValue
                • Email
                • File
                • Float
                • LongHtmlString
                • ImageFile
                • Integer
                • LongString
                • Money
                • ShortString
                • StringDictionary
                • URL
            Data 
              (required). The data element always has the language attribute to tell which language the metafield is. It also has an attribute value that is used if it is not a multi value dictionary or string dictionary.
              • Item. If the data type has multiple values list each key in value as an attribute of Item element.
      • ParentNode (required). The parent node code of the node.
      • SeoInfo (required). The SEO information about the node.
        • Seo (required). The SEO properties for a specific language of the URL.
          • LanguageCode (required). The language code for the SEO information of the node.
          • Uri (required). The URI of the node.
          • Title (required). The title for the page.
          • Keywords (required). The meta keywords for the page.
          • UriSegment (required). The URI segment for the page for routing.

Entries Element

XML
<Entries totalCount="">
	<Entry>
		<Name></Name>
		<StartDate></StartDate>
		<EndDate></EndDate>
		<IsActive>True</IsActive>
		<DisplayTemplate/>
		<Code></Code>
		<EntryType></EntryType>
		<MetaData>
			<MetaClass>
				<Name></Name>
			</MetaClass>
			<MetaFields>
				<MetaField>
					<Name></Name>
					<Type></Type>
					<Data language="" value=""/>
				</MetaField>
				<MetaField>
					<Name></Name>
					<Type></Type>
					<Data language="en">
						<item value="" key="" />
						<item value="" key="" />
					</Data>
				</MetaField>
			</MetaFields>
		</MetaData>
		<VariationInfo>
			<Variation>
				<MaxQuantity></MaxQuantity>
				<MinQuantity></MinQuantity>
				<TrackInventory></TrackInventory>
				<Weight></Weight>
			</Variation>
		</VariationInfo>
		<WarehouseInventories>
			<WarehouseInventory>
				<WarehouseCode></WarehouseCode>
				<AllowBackorder></AllowBackorder>
				<AllowPreorder></AllowPreorder>
				<BackorderAvailabilityDate></BackorderAvailabilityDate>
				<BackorderQuantity></BackorderQuantity>
				<InStockQuantity></InStockQuantity>
				<InventoryStatus></InventoryStatus>
				<PreorderAvailabilityDate></PreorderAvailabilityDate>
				<PreorderQuantity></PreorderQuantity>
				<ReorderMinQuantity></ReorderMinQuantity>
				<ReservedQuantity></ReservedQuantity>
			</WarehouseInventory>
		</WarehouseInventories>
		<Prices>
			<Price>
				<MarketId></MarketId>
				<CurrencyCode></CurrencyCode>
				<PriceTypeId></PriceTypeId>
				<PriceCode/>
				<ValidFrom></ValidFrom>
				<ValidUntil></ValidUntil>
				<MinQuantity></MinQuantity>
				<UnitPrice></UnitPrice>
			</Price>
		</Prices>
		<SeoInfo>
			<Seo>
				<LanguageCode></LanguageCode>
				<Uri></Uri>
				<Title/>
				<Description/>
				<Keywords/>
				<UriSegment></UriSegment>
			</Seo>
		</SeoInfo>
	</Entry>
</Entries>
      • Name (required). The name of the entry.
      • StartDate (required). The UTC date when the entry becomes available.
      • EndDate (required). The UTC date when the entry becomes unavailable.
      • IsActive (required). Whether or not the entry is active.t
      • EntryType(required). The entry type of the entry.
        • Product
        • Variation
        • Package
        • Bundle
        • DynamicPackage
      • DisplayTemplate. Legacy; not used anymore.
      • Code (required). The unique identifier of the entry.
      • MetaData (required). This element is responsible for updating the meta data of the entry.
        • MetaClass
          • Name (required). The name of the metaclass that the entry is linked to.
        • MetaFields
          • MetaField
          • Name (required). The name of the metafield.
          • Type (required). The MetaDataType of the metafield.
            • Boolean
            • Date
            • DateTime
            • Decimal
            • DictionaryMultiValue
            • DictionarySingleValue
            • Email
            • File
            • Float
            • LongHtmlString
            • ImageFile
            • Integer
            • LongString
            • Money
            • ShortString
            • StringDictionary
            • URL
          • Data(required). The data element always has the language attribute to tell which language the metafield is. It also has an attribute value which is used if it is not a multi value dictionary or string dictionary.
            • Item. If the data type has multiple values list each key in value as an attribute of Item element.
    • VariationInfo. VariationInfo only be used when entry type is Variation or Package.
      • Variation (required). Must have element if creating VariationInfo.
        • MaxQuantity (required). The max quantity that can be ordered at once for entry.
        • MinQuantity (required). The min quantity that can be ordered at once for entry.
        • TrackInventory (required). Whether or not to track inventory for entry.
        • Weight (required). How much the entry weighs based on the default catalog weight base.
    • WarehouseInventories. WarehouseInventories should only be used when entry type is Variation or Package.
      • WarehouseInventory. Element to add or update warehouse based on warehouse code.
        • WarehouseCode (required). The unique identifier of the warehouse.
        • AllowBackorder (required). Whether or not to allow back-order.
        • AllowPreorder (required). Whether or not to allow pre-order.
        • BackorderAvailabilityDate (required). The UTC date when back orders are available for this entry at this warehouse.
        • BackorderQuantity (required). The back order quantity on hand at this warehouse.
        • InStockQuantity (required). The in stock quantity on hand at this warehouse.
        • InventoryStatus (required). The status of the inventory of the entry at this warehouse.
        • PreorderAvailabilityDate (required). The UTC date when pre-orders are available for this entry at this warehouse.
        • PreorderQuantity (required). The pre-order quantity on hand at this warehouse.
        • ReorderMinQuantity (required). The reorder minimum quantity for this entry at this warehouse.
        • ReservedQuantity (required). The reserved quantity for this entry at this warehouse.
    • Prices. Prices only be used when entry type is Variation or Package.
      • Price. Element to add or update price.
        • MarketId (required). The market Id for the price.
        • CurrencyCode (required). The currency code for the price.
        • PriceTypeId(required). The price type.
          • 0. All Customers
          • 1. Customer
          • 2. Customer Price Group
        • PriceCode. The price code associated with the price.
        • ValidFrom (required). The UTC date when the price becomes available.
        • ValidUntil. The UTC date when the price becomes unavailable.
        • MinQuantity (required). The min quantity that has to be ordered to qualify for price.
        • UnitPrice (required). The actual price for the entry
    • SeoInfo (required). The SEO information about the node.
      • Seo (required). The SEO properties for a specific language of the URL.
        • LanguageCode (required). The language code for the SEO information of the node.
        • Uri (required). The URI of the node.
        • Title (required). The title for the page.
        • Keywords (required). The meta keywords for the page.
        • UriSegment (required). The URL segment for the page for routing.

Relations Element

The Relations element allows for creating relationships between entries and nodes, nodes and other nodes, as well as entries and other entries. Below is an example of how the Relations element should look

XML
<Relations>
	<NodeEntryRelation>
		<EntryCode></EntryCode>
		<NodeCode></NodeCode>
		<SortOrder></SortOrder>
	</NodeEntryRelation>
	<EntryRelation>
		<ParentEntryCode></ParentEntryCode>
		<ChildEntryCode></ChildEntryCode>
		<RelationType></RelationType>
		<Quantity></Quantity>
		<GroupName></GroupName>
		<SortOrder></SortOrder>
	</EntryRelation>
	<NodeRelation>
		<ChildNodeCode></ChildNodeCode>
		<ParentNodeCode></ParentNodeCode>
		<SortOrder></SortOrder>
	</NodeRelation>
</Relations>
      • NodeEntryRelation . This relation creates entries in nodes/categories.
        • EntryCode (required). The entry code.
        • NodeCode (required). The node code.
        • SortOrder (required). The order in which relations are retrieved.
      • EntryRelation. This relation creates entry parent child relationships.
        • ParentEntryCode (required). The parent entry code.
        • ChildEntryCode (required). The child entry code.
        • RelationType(required). The entry relation type.
          • ProductVariation
          • PackageEntry
          • BundleEntry
        • Quantity. How many children belong to the parent.
        • GroupName.  A way to group items (for example, Motherboards).
        • SortOrder (required). The order in which relations are retrieved.
      • NodeRelation. This relation creates nodes in other nodes.
        • ChildNodeCode (required). The child node code.
        • ParentNodeCode (required). The parent node code.
        • SortOrder (required). The order in which relations are retrieved.

Associations Element

The Associations element lets you create static list of entries related to an entry, as shown in the following example.

XML
<Associations totalCount="">
	<CatalogAssociation>
		<Name></Name>
		<Description></Description>
		<SortOrder></SortOrder>
		<EntryCode></EntryCode>
		<Association>
			<EntryCode></EntryCode>
			<SortOrder></SortOrder>
			<Type></Type>
		</Association>
		<Association>
			<EntryCode></EntryCode>
			<SortOrder></SortOrder>
			<Type></Type>
		</Association>
	</CatalogAssociation>
	<CatalogAssociation>
		<Name></Name>
		<Description></Description>
		<SortOrder></SortOrder>
		<EntryCode></EntryCode>
		<Association>
			<EntryCode></EntryCode>
			<SortOrder></SortOrder>
			<Type></Type>
		</Association>
	</CatalogAssociation>
</Associations>
      • Associations. This element adds associations to the catalog.
        • CatalogAssociation. Element to add or update catalog association.
          • Name (required). The name of the association.
          • Description. The description of the association.
          • SortOrder (required). The order for which the associations are returned
          • EntryCode (required). The entry code for which this association belongs to.
          • Association. Element adds association links to the other entries.
            • EntryCode (required). The entry code of the entry you want to link to this association.
            • SortOrder (required). The order for which the associations are returned.
            • Type (required). The association type name that can be passed in the AssociationTypes in the Dictionaries Element.

CatalogItemAssets element

The CatalogItemAssets element lets you link assets to entries or nodes, as shown in the following example. For a linking to be created the media must exists at the path specified.

XML
<?xml version="1.0" encoding="utf-8"?>
<CatalogItemAssets totalCount="2">
    <CatalogItemAsset catalogItemType="node" catalogItemCode="node">
    <AssetPath></AssetPath>
    <AssetName>nodeAsset.jpg</AssetName>
    <AssetType>episerver.core.icontentimage</AssetType>
    <GroupName>small</GroupName>
    <SortOrder>0</SortOrder>
    </CatalogItemAsset>
    <CatalogItemAsset catalogItemType="entry" catalogItemCode="variation">
    <AssetPath></AssetPath>
    <AssetName>variationAsset.jpg</AssetName>
    <AssetType>episerver.core.icontentimage</AssetType>
    <GroupName>small</GroupName>
    <SortOrder>0</SortOrder>
    </CatalogItemAsset>
</CatalogItemAssets>
    • CatalogItemAssets. This element adds catalog asset links to the catalog.
      • CatalogItemAssets attributes:
        • totalCount (required). The number of assets to be linked.
      • CatalogItemAsset. Element to add or update catalog item asset.
        • CatalogItemAsset attributes:
          • catalogItemType (required). The item type (node,entry).
          • catalogItemCode (required). The code of the entry or node.
        • AssetPath. The path to the asset from the global asset root. If blank, the asset is understood to be directly under the global asset root.
        • AssetPath (required). The file name of the asset.
        • AssetType (required). The type of asset.
        • GroupName. Way to group assets together for node or entry, (for example, Additional Images).
        • SortOrder (required). The order in which the associations are returned.

Comments