Try our conversational search powered by Generative AI!



Hi everyone !

I would like to use a csv file including prices for items, this file will be updated via ftp, I'd like to know how to include the price in episerver trade, create products in catalogs?

Thanks for your help !

Feb 15, 2013 15:05

The answer is more that one sentence, but in general what you should do is to create mapping xml files which will describe mapping from CSV file structure to corresponding entities in the Commerce. "Product" may consist of more that just one record in DB. It may be product or variation, ir may have records in inventory (stock availability), pricing, associations and even SEO settings, etc.

I would recoemmend you to look in Commerce Manager -> Catalog Management -> Import / Export -> CSV Import Catalog. Using this section you are able to "train" import process to understand your CSV file structure and map CSV data to Commerce entities.

You can get more info in this guide:

Feb 18, 2013 17:36

Tks for your answer.

Feb 20, 2013 10:25

DO you have any examples of doing this as an import via a webservice  - I need to find a way how to set up the new products, thier variants together with Prices and Inventory.

Feb 12, 2014 17:23

I bet that "via webservice" would be pretty lenghty reply, but I can share snippet for creating products and part of sales prices under inventory:

var entry = CatalogContext.Current.GetCatalogEntryDto(importEntry.EntryCode, catalogEntryResponseGroup);
var entryRow = entry.CatalogEntry.Count == 0 ? entry.CatalogEntry.NewCatalogEntryRow() : entry.CatalogEntry[0];
var inventoryRow = entry.Inventory.Count == 0 ? entry.Inventory.NewInventoryRow() : entry.Inventory[0];

// do stuff with entry
entryRow.ApplicationId = AppContext.Current.ApplicationId;
entryRow.CatalogId = catalogId;
if (entryRow.IsNew())
    entryRow.Code = entryCode;
    entryRow.Name = entryName;

// create or update variation data
var variationRow = entry.Variation.Count == 0 ? entry.Variation.NewVariationRow() : entry.Variation[0];
variationRow.CatalogEntryId = entryRow.CatalogEntryId;
if (variationRow.IsNew())
    variationRow.ListPrice = importEntry.UnitPrice.GetValueOrDefault(0);
    variationRow.MaxQuantity = 100;

// update inventory
inventoryRow.ApplicationId = AppContext.Current.ApplicationId;
inventoryRow.SkuId = skuId;
inventoryRow.AllowBackorder = true;

// save entry


Also you need to bind associations between entry and any other catalog nodes if needed. Following code snippet should give you some hints:

// add association
private CatalogRelationDto.NodeEntryRelationRow AddNodeRelation(
        CatalogRelationDto relation,
        int catalogEntryId,
        ImportEntry importEntry,
        int catalogId,
        int catalogNodeId)
    var nodeRelation = relation.NodeEntryRelation.NewNodeEntryRelationRow();
    nodeRelation.CatalogId = catalogId;
    nodeRelation.CatalogEntryId = catalogEntryId;
    nodeRelation.CatalogNodeId = catalogNodeId;

    if (nodeRelation.IsNew())
        nodeRelation.SortOrder = importEntry.SortOrder.GetValueOrDefault(0);
        if (this.schema.IsSortOrderSupplied && importEntry.SortOrder.HasValue)
            nodeRelation.SortOrder = (int)importEntry.SortOrder;

    if (nodeRelation.IsNew())

    return nodeRelation;



When it comes to "via webservice" - my guess is that this is just a matter of *where* exactly import logic is located and who is initiator of the process. Other than that - Commerce logic and code should remain the same regardless via which "integration interface" products are pushed into the commerce db...

Feb 13, 2014 0:42

HI, this is great. Many thanks.

Feb 13, 2014 9:03
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.