public void CreateWithCode() { string nodeName = "myNode"; string productName = "myProduct"; string skuName = "mySku"; // Get ReferenceConverter and LinksRepository ReferenceConverter refConv = ServiceLocator.Current.GetInstance <ReferenceConverter>(); ILinksRepository linksRep = ServiceLocator.Current.GetInstance <ILinksRepository>(); // Create Node ContentReference linkToParentNode = refConv.GetContentLink("Women_1"); var contentRepository = ServiceLocator.Current.GetInstance <IContentRepository>(); var newNode = contentRepository.GetDefault <FashionNode>(linkToParentNode, new CultureInfo("en")); newNode.Code = nodeName; newNode.SeoUri = nodeName; newNode.Name = nodeName; newNode.DisplayName = nodeName; ContentReference newNodeRef = contentRepository.Save (newNode, SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess); // Create Product var newProduct = contentRepository.GetDefault <BlouseProduct>(newNodeRef, new CultureInfo("en")); //Set some properties. newProduct.Code = productName; newProduct.SeoUri = productName; newProduct.Name = productName; newProduct.DisplayName = productName; newProduct.SeoInformation.Title = "SEO Title"; newProduct.SeoInformation.Keywords = "Some keywords"; newProduct.SeoInformation.Description = "A nice one"; newProduct.MainBody = new XhtmlString("This new product is great"); ContentReference newProductRef = contentRepository.Save (newProduct, SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess); // Create SKU var newSku = contentRepository.GetDefault <FashionVariation>(newNodeRef, new CultureInfo("en")); newSku.Code = skuName; newSku.SeoUri = skuName; newSku.Name = skuName; newSku.DisplayName = skuName; ContentReference newSkuRef = contentRepository.Save (newSku, SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess); // what differs from CMS ProductVariation prodVarRel = new ProductVariation(); prodVarRel.Target = newSkuRef; prodVarRel.Source = newProductRef; prodVarRel.SortOrder = 100; linksRep.UpdateRelation(prodVarRel); // done, but... /* ...still missing Market, Inventory, Pricing and Media + a few other things */ // ToDo: ...some redirect... somewhere }