OptionDTO Object

Overview

The REST API makes extensive use of the OptionDTO object whenever working with a product that has one or more choices for a customer.  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. 

OptionDTO

The OptionDTO object will contain all of the details of a single choice or option for products in your Hotcakes Commerce store.

Members

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

Member Default Description
Bvin (empty string) The unique ID or primary key for the option.
IsShared False If true, this property will allow this choice to be used across multiple products.
IsVariant False If enabled, this property defines that the option can be used as a variants to create a new SKU, price options, and more.
Items List of OptionItemDTO Contains a list of items that belong to this option, such as individual sizes when this is a garment size option.
Name (empty string) This is the name of the option as you want it to appear to customers. This is a localizable property.
NameIsHidden False If a merchant sets this to true, the viewset should observe the setting and not chose the label.
OptionType 0 Returns a specific value to define what kind of option this is. This property is accessible through the Processor property as well. The possible values include:
  • Unknown = 0
  • DropDownList = 100
  • RadioButtonList = 200
  • Checkboxes = 300
  • Html = 400
  • TextInput = 500
  • FileUpload = 600
Settings List of OptionSettingDTO Used with the HTML OptionType when this is a Shared choice to save the default option value. All other OptionTypes will ignore this value.
StoreId 0 This is the ID of the Hotcakes store. Typically, this is 1, except in multi-tenant environments.

 

Example of OptionDTO

{
   "Errors":[

   ],
   "Content":{
      "Bvin":"dc2d6134-0dbe-422a-beae-096273787fd3",
      "StoreId":1,
      "OptionType":100,
      "Name":"Color",
      "NameIsHidden":false,
      "IsVariant":false,
      "IsShared":false,
      "Settings":[
         {
            "Key":"ERPID",
            "Value":"1234567890"
         }
      ],
      "TextSettings":[

      ],
      "Items":[
         {
            "Bvin":"92061e92-8680-47c0-a956-8c0e3152c852",
            "StoreId":1,
            "OptionBvin":"dc2d6134-0dbe-422a-beae-096273787fd3",
            "Name":"Red",
            "PriceAdjustment":0,
            "WeightAdjustment":0,
            "IsLabel":false,
            "SortOrder":1,
            "IsDefault":false
         },
         {
            "Bvin":"408dc399-ecdf-4dd0-816d-9ecd69fd8af7",
            "StoreId":1,
            "OptionBvin":"dc2d6134-0dbe-422a-beae-096273787fd3",
            "Name":"White",
            "PriceAdjustment":0,
            "WeightAdjustment":0,
            "IsLabel":false,
            "SortOrder":2,
            "IsDefault":false
         },
         {
            "Bvin":"ea17b0e3-4885-4e12-a44f-d7ce38f72f94",
            "StoreId":1,
            "OptionBvin":"dc2d6134-0dbe-422a-beae-096273787fd3",
            "Name":"Blue",
            "PriceAdjustment":0,
            "WeightAdjustment":0,
            "IsLabel":false,
            "SortOrder":3,
            "IsDefault":false
         }
      ]
   }
}
Have more questions? Submit a request

Need More Help?

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