Create category via Litium.AdminWebApi

I am trying to create a category via the Litium.AdminWebApi following this example Api

The problem I am having is that I cannot populate any fields with data. I can see in the database and in litium backoffice that the category is created but it has no name, just systemid and the id I gave it. SO it only says translation missing when i look in the category tree.

This is my current attempt but it does not work. Any help/suggestions is appreciated

var category = new Category(fieldTemplate.SystemId, assortments.FirstOrDefault().SystemId)
    {
        Id = id
    }.MakeWritableClone();

foreach (var name in names){
    //category.Fields.AddOrUpdateValue(SystemFieldDefinitionConstants.Name, 
    //name.Key,name.Value); this did not work either 
    category.Localizations[name.Key].Name = name.Value;
}

var response = await _adminWebApi.CreateCategory(category); //calling this endpoint
//[Post("/Litium/api/admin/products/categories")]

Litium version: 8.14

is name.Key a culturecode?
Have you debugged so that you have a valid culturecode?

or tested to hardcoded a culture code?.AddOrUpdateValue(SystemFieldDefinitionConstants.Name, “sv-SE”, name.Value)

Yes, I have tried with hardcoded culture and value and I have also debugged and seen that it is the culture code.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.