Attributes

In a digital commerce platform, entities like Customer, Product, and Order have properties known as attributes. These attributes are crucial for setting up promotion rules. For instance, price is an attribute of a Product. There are two categories of attributes - Standard and Custom attributes.


Standard Attributes

These are the default attributes provided by Uniqodo to represent the important properties required for running promotions. Standard attributes come with a predefined API name and type. The mandatory standard attributes must be present in entities when sending them in a request.

🚧

Please note that Standard attributes cannot be modified.

Please refer to Settings > Attributes from the side menu in your account for the list of standard attributes for all supported entities.


Custom Attributes

In addition to the Standard attributes, you can add new properties that exist in your system to make them available for promotions.


Let's imagine you are selling cameras on your online store or mobile app and one of the attributes of your products is "Lens size", then you can create a Custom attribute lensSize for the Product enity. This makes it possible to start running promotions, such as giving a reward on cameras with certain lens sizes. Unlike Standard attributes, you can modify any Custom attributes in your account.

Creating Custom Attributes

  1. From the side menu, go to Settings > Attributes
  2. In the top right corner, click Add Attribute
  3. Select the entity you wish to create an attribute for
  4. Enter the Name, Type and API Property for the attribute.
    The Name you give an attribute is what will be displayed to users when selecting this attribute in promotion rules. Attribute Type can be a single-value type such as a number, string or date & time. It can also be a list of numbers or strings. If a List type is selected, you will be presented with a field to add multiple values.

    1. Please note that values supplied for a date & time attribute in an API request must be in an RRFC3339 or RFC3339 Extended format e.g. 2024-04-15T00:00:00+01:00.
    2. The API Property must match the property name in the JSON object that relates to this attribute whenever you send the entity in an API request. Let's imagine you are selling digital cameras and want to have a custom Product attribute for lens size, you could then give it an API Property lensSize and include it in the product entity of your request under the additionalProperties field as shown below.

      {	
        "id": 938373,
        "name": "Sony SXD Camera",
         "additionalProperties": {
           "lensSize": "20MP"
         }
         ...
      }	
      

  5. If this is a required attribute that will be sent with all requests then select the Mandatory checkbox.
  6. Click Save

Modifying Custom Attributes

From the Attributes list;

  1. Select the menu icon next to the custom attribute you would like to modify. Click Edit.
  2. Change the fields for the attribute as necessary.
  3. Click Update.

Sending Custom Attributes In Requests

To ensure the rule engine can evaluate any rule created using custom attributes, these attributes must be included in the relevant entity's JSON representation in the request body sent to the promotion engine APIs.

For instance, if you have created a custom attribute called size on the Product entity, you'll need to include it in the Product objectadditionalProperties field in the request body as below:

{	
  "id": 5245554,
  "name": "Running Trainers",
   "additionalProperties": {
     "size": "M"
   }
   ...
}