CategorySnapshotDTO Object

Overview

The REST API makes extensive use of the CategorySnapshotDTO object whenever working with a list of categories.  This article will help you to know the various members of this object.

Requirements

The following pre-requisites will be necessary to accomplish the goals of this article:

  • General understanding of REST and API’s
  • Understanding of C# and/or JavaScript

Getting Started

There are no tasks needed to get started with understanding this object. 

CategorySnapshotDTO

The CategorySnapshotDTO object will contain all of the most common details details of a single category for your Hotcakes Commerce store.  It is basically a smaller version of the CategoryDTO object. Due to the smaller size of CategorySnapshotDTO, it is most commonly returned when lists of categories are requested from the REST API.

Members

The following table gives you details on the various members of the CategorySnapshotDTO object.  The descriptions are based upon default functionality and the default Viewset included with Hotcakes.

Member Default Description
BannerImageUrl (empty string) If populated with a URL, the specified banner will be displayed in the category header.
Bvin (empty string) This is the ID of the category.
CustomPageOpenInNewWindow False If true and if using a category as a custom link, this will cause the link to be opened in a new window when the customer clicks on it. This is only used in the CategoryRotator content block.
CustomPageUrl (empty string) If populated with a URL, this value will be used as the URL for the category when clicked.
Description (empty string) If the description exists, it will be placed below the category banner.
Hidden False If true, the category will be hidden from the customer’s view.
ImageUrl (empty string) This is the image of the category that you want associated with it in the various views. It also is used to generate the category thumbnail.
Name (empty string) This is the name of the category that the customers will see in their views.
Operations Null Operations allow you to define external API endpoints that can be used to manage the category.
ParentId (empty string) Having an ID here will make this category a child or nested category of the category that matches this ID. This helps to create nested navigation and other features.
RewriteUrl (empty string) This is the slug of the URL, or the last part of the URL to be used to get to this category's landing page. It must be unique. If empty, the application will create one based upon the name of the category.
ShowInTopMenu False If true, this category will be shown in the initial list of categories in category lists.
SortOrder 0 Allows you to define how the products in this category will be ordered. The possible values are:
  • None = 0
  • ManualOrder = 1
  • ProductName = 2
  • ProductPriceAscending = 3
  • ProductPriceDescending = 4
  • ManufacturerName = 5
SourceType Manual (0) Allows you to define whether your category is a typical category or a placeholder link to another resource. The possible values are:
  • Manual = 0
  • Custom = 2
  • DrillDown = 4
StoreId 0 This is the ID of the Hotcakes store. Typically, this is 1, except in multi-tenant environments.

 

Example of CategorySnapshotDTO

{
   "Errors":[

   ],
   "Content":[
      {
         "Bvin":"da66d19c-cc4a-4406-96a4-b9fa977a3fd2",
         "StoreId":1,
         "ParentId":"",
         "Name":"Sample Products",
         "Description":"This is a sample category",
         "SourceType":0,
         "ImageUrl":"",
         "BannerImageUrl":"",
         "CustomPageUrl":"",
         "CustomPageOpenInNewWindow":false,
         "ShowInTopMenu":false,
         "Hidden":false,
         "RewriteUrl":"sample-products",
         "SortOrder":2,
         "MetaTitle":"Sample Products",
         "Operations":[

         ]
      }
}
Have more questions? Submit a request

Need More Help?

Do you need more assistance with this article? Please review your support options.