Synerise objects

Synerise object fields are powerful tools which let you access data from other Synerise modules.

Common field properties

These properties exist in multiple field types:

  • Display name: A human-readable name for the field, shown in the record editor.
  • API name: A system name for the field.
    • In the {{ record.APIname }} insert, this name is the APIname
    • When retrieving/creating/updating a record with the API, this name is the identifier of the field.
    • When generating an object from a record, this is the name of the key that stores the field’s value.
  • Description: A human-readable description of the field’s purpose, shown in the record editor.

Synerise object field summary

When creating schemas and defining records, you can leverage existing data within Synerise by adding Synerise objects as fields. These objects enable advanced personalization and dynamic content, such as:

  • personalizing messages using expression or aggregate results
  • implementing social proof through metric insights
  • delivering AI-driven item recommendations
  • distributing discount codes
  • displaying detailed information stored in catalogs
Field name Stored values Primitive data type Can be searchable1 Can be unique2 Accepts Jinjava Nullable
AI Recommendations This field type lets you add a dropdown with list of AI recommendations. This way you can display the recommendation results in a record. Red checkmark Red checkmark Red checkmark Green checkmark Green checkmark
Aggregate This field type lets you add a dropdown with a list of aggregates. This way you can display an aggregate result in a record. Red checkmark Red checkmark Red checkmark Red checkmark Green checkmark
Catalog This field type lets you select a Synerise catalog as a context for data displayed in a record, for example, if you want to display information about a product. Red checkmark Red checkmark Red checkmark Red checkmark Green checkmark
Expression This field type lets you add a dropdown with a list of expressions. This way you can display an expression result in a record. Red checkmark Red checkmark Red checkmark Red checkmark Green checkmark
Metric This field type lets you add a dropdown with a list of metrics. This way, you can display a metric result in a record. Red checkmark Red checkmark Red checkmark Red checkmark Green checkmark
Voucher This field type lets you add a dropdown with a list of voucher pools and select a code from the pool. Red checkmark Red checkmark Red checkmark Green checkmark Green checkmark

1,2The number of fields with this setting is limited.

Synerise object field reference

Aggregate

This field type lets you select an aggregate. The result of the aggregate is calculated in context of a profile when generating an object from a record.

Field configuration in a schema

  1. From the Select aggregate dropdown list, select the aggregate whose result you want to get.
  2. Optionally, to return the full scope of information about the aggregate, select the Include details in results checkbox.

Object generation example

Aggregates don’t require extra parameters in the object generation request.
In the following example, the aggregate returns an item ID.

{
    "dateFilter": {
        "type": "RELATIVE",
        "duration": {
            "type": "DAYS",
            "value": 30
        },
        "offset": {
            "type": "DAYS",
            "value": 0
        },
        "timeZone": "Europe/Warsaw"
    },
    "clientId": 11804828266,
    "result": "WINDBREAKER ZEPHYR",
    "variables": [],
    "analyticVersion": null,
    "title": "Last seen item from jacket category",
    "aggregateUuid": "8c950378-82fd-320d-abec-b90cec5208d5",
    "aggregateId": "8c950378-82fd-320d-abec-b90cec5208d5"
}

AI recommendation

This field type lets you include AI recommendations.

For each record, you can select a recommendation and display its results while generating an object with the record result. If a selected recommendation model requires an item context, you must provide it. The system checks for the context item in the following order:

  1. ID provided in the object generation request.
  2. ID from the record.
  3. Default ID from the schema.

In the “Recommendation model summary” section, you can find a table in which you can check which recommendation models require an item context.

Field configuration in a schema

  1. From the Select recommendation dropdown list, select the default recommendation
  2. In the Parameters section, you can enter the default item ID. By clicking the icon next to the Product context field, you can change how the ID is inserted:
    • String to provide a static string.
    • Jinjava to provide an insert from which the ID will be extracted.
      The value can be changed per record or when generating an object from the record, but the type (static string or Jinjava) is enforced by the schema.
      See Recommendation model summary to learn when a context item ID is required.

Object generation example

When generating an object from a record, you can provide an item context. This overrides the default from the schema and the values saved in the record.
This data is provided in the fieldContext.FIELDNAME object.
You can also add any additional request properties described in the “Get recommendations by campaign” endpoint in the API reference. In the following example, additionalFilters is such a field.

"fieldContext": {
    "exampleRecommendation": {
        "itemId": "dd9f0a0e6ca8f385776c14de9dd277",
        "additionalFilters": "brand == exampleBrand"
    }
}

Catalog

This field type lets you select a Synerise catalog and an item from that catalog. The item’s data (without the item key) is included in the response when an object is generated from a record.

Field configuration in a schema

  1. From Select catalog dropdown list, select the default catalog from which data will be retrieved.
  2. In Primary key: By clicking the icon next to the text field, you can define how you will provide the context:
    • String to provide a default static ID of the product which will serve as the context.
    • Jinjava to provide a default insert from which the ID will be extracted.
      The values can be changed per record, but the type (static string or Jinjava) is enforced by the schema.

Object generation example

If the catalog item ID is inserted with the {{ context.keyName }} insert, provide the value for the key:

"context": {
    "keyName": "sku1234"
}

Expression

This field type lets you select an expression. The result of the expression is calculated in context of a profile when generating an object from a record.

Field configuration in a schema

  1. From the Select expression dropdown list, select the expression whose result you want to get.
  2. Optionally, to return the full scope of information about the expression, select the Include details in results checkbox.

Object generation example

Expressions don’t require extra parameters in the object generation request.
In the following example, an expression calculates the age of the customer.

{
    "name": "Demo calculate age",
    "clientId": 11804828266,
    "result": 26,
    "expressionId": "b2c5cc0b-2830-435f-82a6-a2f0ebadd6d9",
    "variables": [],
    "title": "Demo calculate age "
}

Metric

This field type lets you select a metric. The result of the metric is calculated in context of a profile when generating an object from a record.

Field configuration in a schema

  1. From the Select metric dropdown list, select the default metric to calculate.
  2. Optionally, to return the full scope of information about the aggregate , select the Include details in results checkbox.

Object generation example

Metrics don’t require extra parameters in the object generation request.

{
    "result": 10770077,
    "numberMetrics": [],
    "clientMetrics": [],
    "eventMetrics": []
}

Voucher

This field type lets you return a code from a voucher pool.

Field configuration in a schema

  1. From the Select voucher pool dropdown list, select a pool from which you will be able to select a code (but only while creating records).
  2. Optionally, to assign a voucher and always return the same voucher in subsequent requests for this profile, select the Assign to user checkbox.

Object generation example

The voucher code is returned in the barcode key.
Vouchers don’t require extra parameters in the object generation request.

{
    "barcode": "23123321321"
},

😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker