# Categories

Stelace provides hierarchical Asset Categories out of the box, if needed.

Categories and subcategories offer a convenient way to organize your Assets, offering a simple and efficient filter to use in Search.

const category = await stelace.categories.create({
  name: 'Cars'
})

const subcategory = await stelace.categories.create({
  name: 'Sport',
  parentId: category.id
})

await stelace.assets.create({
  name: 'Gran Torino',
  description: 'Muscle car, 1972',
  categoryId: subcategory.id
})

# Categories and Asset Types

Category object is a descriptive and universal way to organize your Assets for your end-users, while an Asset Type is used to apply settings internally, depending on pricing and availability requirements.

Category and Asset Type can be combined in many ways. For instance:

  • A marketplace offering cars to rent may have SUV, Compact, Sedan, Hatchback, Coupe Categories.
  • “Hourly rental” and “Lease” could be appropriate Asset Types for a car, depending on owner’s choice.