Create unified target group

👍

Note

For detailed information about our APIs and for hands-on testing, refer documentation in API overview and step-by-step guide on making your first API call in Make your first API call .


API endpoint example

https://eu.api.capillarytech.com/v3/targetGroups

Prerequisites

  • Authentication: Basic authentication details
  • Access group resource: WRITE access to target loyalty access group resource

Resource information

URI/v3/targetGroups
HTTP methodPOST
Rate limitNA
Batch supportNA

Request body parameters

ParameterData TypeDescription
activeBooleanIndicates whether the group is active or not.
descriptionStringA brief description of the group.
fromDateStringThe start date and time of the target.
nameStringThe name of the target group.
The character limit for the name is 200 characters.
preferredTillIdIntegerTILL that needs to be associated with points issued on completing the target.
toDateStringThe end date and time of the target.
trackingType*EnumDefines the type of activity tracking in the target. Supported values: UNIFIED, DEFAULT, STREAKS, CAPPING.
Unified: Unified targets where brands can configure multiple targets in a single milestone.
Default: The milestone contains only one target.
Streaks: A type of gamification tracking that indicates the user to do something continuously until the streak value.
Capping: Used when the milestone created is used to apply capping on benefits to customers.
totalPeriodsIntegerThe total number of periods in the group.
frequencyIntegerThe frequency of the target.
recurringCyclesIntegerThe number of cycles the user configures in the group. It is set in case of CYCLIC_WINDOW or PERIOD_AGNOSTIC_WINDOW.
periodsArrayAn array of period objects detailing specific periods within the target.
activeBooleanIndicates whether the specific period is active.
descriptionStringA brief description of the period.
endDateStringThe end date and time of the period, in ISO 8601 format.
periodStatusEnumThe status of the unified target. Supported values: RUNNING,ENDED,NOT_STARTED
refCodeStringReference code of the target period.
startDateStringThe start date and time of the period.
targetsArrayAn array of target objects detailing specific targets within the group.
activeBooleanIndicates if the specific target is active.
descriptionStringA brief description of the target.
expressionStringA representation of the target's condition rule.
esxpressionJsonStringA JSON body that represents the target's rule.
filtersArrayAn array of filter objects applied to the target.
entityTypeEnumThe type of entity the filter applied. Supported values: Transaction and Line item.
entityIdsArrayAn array of entity IDs to which the filter applies.
nameStringThe name of the target.
targetEntityEnumEntity to define target condition. Supported values: TRANSACTION, LINEITEM, POINTS. For example, pass LINEITEM to define the condition on the transaction line item.
enrolmentMethodEnumMethod to enroll customers and add target values. Supported values: TRANSACTION (enroll loyalty customers who transact during the target period), IMPORT (to import a list of customers with custom target value).
targetTypeEnumTransaction parameter to consider for the target. Supported values: QUANTITY, SALES, COUNT, VISIT.
defaultValuesObject An array of objects specifying default values.
defaultValueIntegerThe actual target value user wants to set for the period.
combinationType*EnumA logical operator between the specified targets. Supported values: ANY (If any 1 target needs to be achieved) and ALL (All the targets in a unified target group need to be achieved).
unifiedTargetExpressionObjectAn object representing a unified expression for target evaluation.
aggregationEnumThe type of aggregation used in the unified target expression. Supported values: SUM and COUNT.
thresholdValueIntegerThe threshold value is used in the unified target expression for evaluation. This field is mandatory if you have defined value for aggregation parameter.
{
    "active": true,
    "description": "unified group",
    "fromDate": "2023-09-25T13:45:12.063",
    "name": "demo-unified1",
    "preferredTillId": 50679771,
    "toDate": "2024-10-31T08:41:00.529Z",
    "trackingType": "UNIFIED",
    "totalPeriods": 1,
    "frequency": 0,
    "recurringCycles": 0,
    "periods": [
        {
            "active": true,
            "description": "p1",
            "endDate": "2023-10-31T23:45:12.063",
            "periodStatus": "RUNNING",
            "refCode": "period44",
            "startDate": "2023-09-25T13:45:12.063"
        }
    ],
    "targets": [
        {
            "active": true,
            "description": "uni15",
            "expression": "currentTxn.value>500",
            "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\">\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"500\",\"type\":\"number:primitive\"}]}",
            "filters": [
                {
                    "entityType": "STORE",
                    "entityIds": [
                        50679757,50679770
                    ]
                }
            ],
            "name": "t4",
            "targetEntity": "TRANSACTION",
            "enrolmentMethod": "TRANSACTION",            
            "targetType": "SALES",
            "defaultValues": [
                {
                    "defaultValue": 2000
                }
            ]
        },
        {
            "active": true,
            "description": "uni25",
            "expression": "true",
            "expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
            "filters": [
                {
                    "entityType": "STORE",
                    "entityIds": [
                      50679757,50679770
                    ]
                }
            ],
            "name": "t5",
            "targetEntity": "TRANSACTION",
            "enrolmentMethod": "TRANSACTION",
            "targetType": "SALES",
            "defaultValues": [
                {
                    "defaultValue": 2000
                }
            ]
        },
        {
            "active": true,
            "description": "uni35",
            "expression": "currentTxn.value<1000",
            "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\"<\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"1000\",\"type\":\"number:primitive\"}]}",
            "filters": [
                {
                    "entityType": "STORE",
                    "entityIds": [
                      50679757,50679770
                    ]
                }
            ],
            "name": "t6",
            "targetEntity": "TRANSACTION",
            "enrolmentMethod": "TRANSACTION",
            "targetType": "SALES",
            "defaultValues": [
                {
                    "defaultValue": 2000
                }
            ]
        }
    ],
    "combinationType": "ALL",
    "unifiedTargetExpression":{
        "aggregation":"SUM",
        "thresholdValue":5000
    }
}
{
    "active": true,
    "description": "unified group",
    "fromDate": "2023-09-25T13:45:12.063",
    "name": "demo-unified2",
    "preferredTillId": 50679771,
    "toDate": "2024-10-31T08:41:00.529Z",
    "trackingType": "UNIFIED",
    "totalPeriods": 1,
    "frequency": 0,
    "recurringCycles": 0,
    "periods": [
        {
            "active": true,
            "description": "p1",
            "endDate": "2023-10-31T23:45:12.063",
            "periodStatus": "RUNNING",
            "refCode": "period44",
            "startDate": "2023-09-25T13:45:12.063"
        }
    ],
    "targets": [
        {
            "active": true,
            "description": "uni15",
            "expression": "currentTxn.value>500",
            "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\">\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"500\",\"type\":\"number:primitive\"}]}",
            "filters": [
                {
                    "entityType": "STORE",
                    "entityIds": [
                        50679757,50679770
                    ]
                }
            ],
            "name": "t123",
            "targetEntity": "TRANSACTION",
            "enrolmentMethod": "TRANSACTION",            
            "targetType": "SALES",
            "defaultValues": [
                {
                    "defaultValue": 2000
                }
            ]
        },
        {
            "active": true,
            "description": "uni25",
            "expression": "true",
            "expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
            "filters": [
                {
                    "entityType": "STORE",
                    "entityIds": [
                      50679757,50679770
                    ]
                }
            ],
            "name": "t2656",
            "targetEntity": "TRANSACTION",
            "enrolmentMethod": "TRANSACTION",
            "targetType": "SALES",
            "defaultValues": [
                {
                    "defaultValue": 2000
                }
            ]
        },
        {
            "active": true,
            "description": "uni35",
            "expression": "currentTxn.value<1000",
            "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\"<\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"1000\",\"type\":\"number:primitive\"}]}",
            "filters": [
                {
                    "entityType": "STORE",
                    "entityIds": [
                      50679757,50679770
                    ]
                }
            ],
            "name": "t344",
            "targetEntity": "TRANSACTION",
            "enrolmentMethod": "TRANSACTION",
            "targetType": "SALES",
            "defaultValues": [
                {
                    "defaultValue": 2000
                }
            ]
        }
    ],
    "combinationType": "ALL"

}
{
    "active": true,
    "description": "unified group",
    "fromDate": "2023-09-25T13:45:12.063",
    "name": "demo-unified3",
    "preferredTillId": 50679771,
    "toDate": "2024-10-31T08:41:00.529Z",
    "trackingType": "UNIFIED",
    "totalPeriods": 1,
    "frequency": 0,
    "recurringCycles": 0,
    "periods": [
        {
            "active": true,
            "description": "p1",
            "endDate": "2023-10-31T23:45:12.063",
            "periodStatus": "RUNNING",
            "refCode": "period44",
            "startDate": "2023-09-25T13:45:12.063"
        }
    ],
    "targets": [
        {
            "active": true,
            "description": "uni15",
            "expression": "currentTxn.value>500",
            "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\">\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"500\",\"type\":\"number:primitive\"}]}",
            "filters": [
                {
                    "entityType": "STORE",
                    "entityIds": [
                        50679757,50679770
                    ]
                }
            ],
            "name": "T790",
            "targetEntity": "TRANSACTION",
            "enrolmentMethod": "TRANSACTION",            
            "targetType": "SALES",
            "defaultValues": [
                {
                    "defaultValue": 2000
                }
            ]
        },
        {
            "active": true,
            "description": "uni25",
            "expression": "true",
            "expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
            "filters": [
                {
                    "entityType": "STORE",
                    "entityIds": [
                      50679757,50679770
                    ]
                }
            ],
            "name": "T423",
            "targetEntity": "TRANSACTION",
            "enrolmentMethod": "TRANSACTION",
            "targetType": "SALES",
            "defaultValues": [
                {
                    "defaultValue": 2000
                }
            ]
        },
        {
            "active": true,
            "description": "uni35",
            "expression": "currentTxn.value<1000",
            "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\"<\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"1000\",\"type\":\"number:primitive\"}]}",
            "filters": [
                {
                    "entityType": "STORE",
                    "entityIds": [
                      50679757,50679770
                    ]
                }
            ],
            "name": "T980",
            "targetEntity": "TRANSACTION",
            "enrolmentMethod": "TRANSACTION",
            "targetType": "SALES",
            "defaultValues": [
                {
                    "defaultValue": 2000
                }
            ]
        }
    ],
    "combinationType": "ANY"

}

Response parameters

ParameterData TypeDescription
dataObjectThe main object containing all the details.
idIntegerThe unique identifier for the target.
nameStringThe name of the target.
fromDateStringThe start date for the target.
toDateStringThe end date for the target .
activeBooleanIndicates whether the target is active.
preferredTillIdIntegerA unique identifier of the till.
periodsArrayAn array of period objects detailing specific periods within the target.
idIntegerThe unique identifier for each target.
attributionObjectAn object containing attribution details for the target.
createdOnStringThe creation timestamp of the target.
lastUpdatedOnStringThe last update timestamp of the target.
lastUpdatedByObjectAn object containing details about who last updated the target.
createdByObjectAn object containing details about who created the target.
startDateStringThe start date of the target.
endDateStringThe end date of the target.
refCodeStringA reference code for the period.
periodStatusStringThe status of the target. (e.g., "RUNNING").
targetGroupIdIntegerThe ID of the target group associated with the target.
descriptionStringA brief description of the target.
activeBooleanIndicates whether the period is active.
totalPeriodsIntegerThe total number of periods within the target.
descriptionStringA brief description of the target.
targetEvaluationTypeStringThe type of target evaluation used.
recurringCyclesIntegerThe number of recurring cycles.
frequencyIntegerThe frequency of the target.
targetCycleStartDateStringThe start date of the target cycle.
targetCycleEndDateStringThe end date of the target cycle.
trackingTypeStringDefines the type of activity tracking in the target. Supported values: UNIFIED, DEFAULT, STREAKS, CAPPING.
targetsArrayAn array of target objects detailing specific targets.
idIntegerThe unique identifier for each target.
attributionObjectAn object containing attribution details for the target.
nameStringThe name of the target.
emfRuleSetIdIntegerThe ID of the rule set associated with the target.
targetTypeStringThe type of target.
targetEntityStringEntity to define target condition. Supported values: TRANSACTION, LINEITEM, POINTS. For example, pass LINEITEM to define condition on the transaction line item.
targetGroupIdIntegerThe ID of the target group associated with the target.
descriptionStringA brief description of the target.
activeBooleanIndicates whether the target is active.
expressionStringA textual representation of the target's condition or rule.
expressionJsonStringA JSON string representing the logical structure of the target's condition or rule.
filtersArrayAn array of filter objects applied to the target.
enrolmentMethodStringMethod to enroll customers and add target values. Supported values: TRANSACTION (enroll loyalty customers who transact during the target period), IMPORT (to import a list of customers with custom target value).
defaultValuesArrayAn array of objects specifying default values, likely for some calculations or thresholds.
idIntegerThe unique identifier for each default value.
periodIdIntegerThe ID of the period associated with the default value.
defaultValueIntegerA default value used within the target's context.
combinationTypeStringA logical operator between the specified targets. Supported values: ANY (If any 1 target needs to be achieved) and ALL (All the targets in a unified target group need to be achieved).
unifiedTargetExpressionObjectAn object representing a unified expression for target evaluation.
aggregationStringThe type of aggregation used in the unified target expression (e.g., "SUM").
thresholdValueIntegerThe threshold value used in the unified target expression for evaluation.
ruleExpressionStringA string representing the rule expression in the unified target expression.
{
    "data": {
        "id": 6104,
        "name": "demo-unified1",
        "fromDate": "2023-09-25",
        "toDate": "2024-10-31",
        "active": true,
        "preferredTillId": 50679771,
        "periods": [
            {
                "id": 6883,
                "attribution": {
                    "createdOn": "2023-09-25T17:26:26.320+0530",
                    "lastUpdatedOn": "2023-09-25T17:26:26.320+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "startDate": "2023-09-25",
                "endDate": "2023-10-31",
                "refCode": "period44",
                "periodStatus": "RUNNING",
                "targetGroupId": 6104,
                "description": "p1",
                "active": true
            }
        ],
        "totalPeriods": 1,
        "description": "unified group",
        "targetEvaluationType": "FIXED_CALENDAR_WINDOW",
        "recurringCycles": 0,
        "frequency": 0,
        "targetCycleStartDate": "2023-09-25T00:00:00.000Z",
        "targetCycleEndDate": "2023-10-31T23:59:59.000Z",
        "trackingType": "UNIFIED",
        "targets": [
            {
                "id": 9107,
                "attribution": {
                    "createdOn": "2023-09-25T17:26:26.340+0530",
                    "lastUpdatedOn": "2023-09-25T17:26:26.340+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "t4",
                "emfRuleSetId": 1246740,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6104,
                "description": "uni15",
                "active": true,
                "expression": "currentTxn.value>500",
                "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\">\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"500\",\"type\":\"number:primitive\"}]}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10123,
                        "periodId": 6883,
                        "defaultValue": 2000
                    }
                ]
            },
            {
                "id": 9108,
                "attribution": {
                    "createdOn": "2023-09-25T17:26:26.340+0530",
                    "lastUpdatedOn": "2023-09-25T17:26:26.340+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "t5",
                "emfRuleSetId": 1246741,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6104,
                "description": "uni25",
                "active": true,
                "expression": "true",
                "expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10124,
                        "periodId": 6883,
                        "defaultValue": 2000
                    }
                ]
            },
            {
                "id": 9109,
                "attribution": {
                    "createdOn": "2023-09-25T17:26:26.340+0530",
                    "lastUpdatedOn": "2023-09-25T17:26:26.340+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "t6",
                "emfRuleSetId": 1246742,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6104,
                "description": "uni35",
                "active": true,
                "expression": "currentTxn.value<1000",
                "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\"<\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"1000\",\"type\":\"number:primitive\"}]}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10125,
                        "periodId": 6883,
                        "defaultValue": 2000
                    }
                ]
            },
            {
                "id": 9110,
                "attribution": {
                    "createdOn": "2023-09-25T17:26:26.480+0530",
                    "lastUpdatedOn": "2023-09-25T17:26:26.480+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "t4_ReturnBill",
                "emfRuleSetId": 1246743,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6104,
                "description": "uni15",
                "active": true,
                "expression": "currentTxn.value>500",
                "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\">\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"500\",\"type\":\"number:primitive\"}]}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10126,
                        "periodId": 6883,
                        "defaultValue": 2000
                    }
                ]
            },
            {
                "id": 9111,
                "attribution": {
                    "createdOn": "2023-09-25T17:26:26.480+0530",
                    "lastUpdatedOn": "2023-09-25T17:26:26.480+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "t5_ReturnBill",
                "emfRuleSetId": 1246744,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6104,
                "description": "uni25",
                "active": true,
                "expression": "true",
                "expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10127,
                        "periodId": 6883,
                        "defaultValue": 2000
                    }
                ]
            },
            {
                "id": 9112,
                "attribution": {
                    "createdOn": "2023-09-25T17:26:26.480+0530",
                    "lastUpdatedOn": "2023-09-25T17:26:26.480+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "t6_ReturnBill",
                "emfRuleSetId": 1246745,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6104,
                "description": "uni35",
                "active": true,
                "expression": "currentTxn.value<1000",
                "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\"<\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"1000\",\"type\":\"number:primitive\"}]}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10128,
                        "periodId": 6883,
                        "defaultValue": 2000
                    }
                ]
            }
        ],
        "combinationType": "ALL",
        "unifiedTargetExpression": {
            "aggregation": "SUM",
            "thresholdValue": 5000,
            "ruleExpression": "(9107 & 9108 & 9109)"
        }
    },
    "errors": null,
    "warnings": null
}
{
    "data": {
        "id": 6107,
        "name": "demo-unified2",
        "fromDate": "2023-09-25",
        "toDate": "2024-10-31",
        "active": true,
        "preferredTillId": 50679771,
        "periods": [
            {
                "id": 6886,
                "attribution": {
                    "createdOn": "2023-09-25T17:27:24.471+0530",
                    "lastUpdatedOn": "2023-09-25T17:27:24.471+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "startDate": "2023-09-25",
                "endDate": "2023-10-31",
                "refCode": "period44",
                "periodStatus": "RUNNING",
                "targetGroupId": 6107,
                "description": "p1",
                "active": true
            }
        ],
        "totalPeriods": 1,
        "description": "unified group",
        "targetEvaluationType": "FIXED_CALENDAR_WINDOW",
        "recurringCycles": 0,
        "frequency": 0,
        "targetCycleStartDate": "2023-09-25T00:00:00.000Z",
        "targetCycleEndDate": "2023-10-31T23:59:59.000Z",
        "trackingType": "UNIFIED",
        "targets": [
            {
                "id": 9115,
                "attribution": {
                    "createdOn": "2023-09-25T17:27:24.483+0530",
                    "lastUpdatedOn": "2023-09-25T17:27:24.483+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "t123",
                "emfRuleSetId": 1246748,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6107,
                "description": "uni15",
                "active": true,
                "expression": "currentTxn.value>500",
                "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\">\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"500\",\"type\":\"number:primitive\"}]}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10131,
                        "periodId": 6886,
                        "defaultValue": 2000
                    }
                ]
            },
            {
                "id": 9116,
                "attribution": {
                    "createdOn": "2023-09-25T17:27:24.483+0530",
                    "lastUpdatedOn": "2023-09-25T17:27:24.483+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "t2656",
                "emfRuleSetId": 1246749,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6107,
                "description": "uni25",
                "active": true,
                "expression": "true",
                "expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10132,
                        "periodId": 6886,
                        "defaultValue": 2000
                    }
                ]
            },
            {
                "id": 9117,
                "attribution": {
                    "createdOn": "2023-09-25T17:27:24.483+0530",
                    "lastUpdatedOn": "2023-09-25T17:27:24.483+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "t344",
                "emfRuleSetId": 1246750,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6107,
                "description": "uni35",
                "active": true,
                "expression": "currentTxn.value<1000",
                "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\"<\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"1000\",\"type\":\"number:primitive\"}]}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10133,
                        "periodId": 6886,
                        "defaultValue": 2000
                    }
                ]
            },
            {
                "id": 9118,
                "attribution": {
                    "createdOn": "2023-09-25T17:27:24.632+0530",
                    "lastUpdatedOn": "2023-09-25T17:27:24.632+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "t123_ReturnBill",
                "emfRuleSetId": 1246751,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6107,
                "description": "uni15",
                "active": true,
                "expression": "currentTxn.value>500",
                "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\">\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"500\",\"type\":\"number:primitive\"}]}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10134,
                        "periodId": 6886,
                        "defaultValue": 2000
                    }
                ]
            },
            {
                "id": 9119,
                "attribution": {
                    "createdOn": "2023-09-25T17:27:24.632+0530",
                    "lastUpdatedOn": "2023-09-25T17:27:24.632+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "t2656_ReturnBill",
                "emfRuleSetId": 1246752,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6107,
                "description": "uni25",
                "active": true,
                "expression": "true",
                "expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10135,
                        "periodId": 6886,
                        "defaultValue": 2000
                    }
                ]
            },
            {
                "id": 9120,
                "attribution": {
                    "createdOn": "2023-09-25T17:27:24.632+0530",
                    "lastUpdatedOn": "2023-09-25T17:27:24.632+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "t344_ReturnBill",
                "emfRuleSetId": 1246753,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6107,
                "description": "uni35",
                "active": true,
                "expression": "currentTxn.value<1000",
                "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\"<\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"1000\",\"type\":\"number:primitive\"}]}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10136,
                        "periodId": 6886,
                        "defaultValue": 2000
                    }
                ]
            }
        ],
        "combinationType": "ALL",
        "unifiedTargetExpression": {
            "aggregation": null,
            "thresholdValue": null,
            "ruleExpression": "(9115 & 9116 & 9117)"
        }
    },
    "errors": null,
    "warnings": null
}
{
    "data": {
        "id": 6108,
        "name": "demo-unified3",
        "fromDate": "2023-09-25",
        "toDate": "2024-10-31",
        "active": true,
        "preferredTillId": 50679771,
        "periods": [
            {
                "id": 6887,
                "attribution": {
                    "createdOn": "2023-09-25T17:27:53.313+0530",
                    "lastUpdatedOn": "2023-09-25T17:27:53.313+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "startDate": "2023-09-25",
                "endDate": "2023-10-31",
                "refCode": "period44",
                "periodStatus": "RUNNING",
                "targetGroupId": 6108,
                "description": "p1",
                "active": true
            }
        ],
        "totalPeriods": 1,
        "description": "unified group",
        "targetEvaluationType": "FIXED_CALENDAR_WINDOW",
        "recurringCycles": 0,
        "frequency": 0,
        "targetCycleStartDate": "2023-09-25T00:00:00.000Z",
        "targetCycleEndDate": "2023-10-31T23:59:59.000Z",
        "trackingType": "UNIFIED",
        "targets": [
            {
                "id": 9121,
                "attribution": {
                    "createdOn": "2023-09-25T17:27:53.327+0530",
                    "lastUpdatedOn": "2023-09-25T17:27:53.327+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "T790",
                "emfRuleSetId": 1246754,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6108,
                "description": "uni15",
                "active": true,
                "expression": "currentTxn.value>500",
                "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\">\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"500\",\"type\":\"number:primitive\"}]}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10137,
                        "periodId": 6887,
                        "defaultValue": 2000
                    }
                ]
            },
            {
                "id": 9122,
                "attribution": {
                    "createdOn": "2023-09-25T17:27:53.327+0530",
                    "lastUpdatedOn": "2023-09-25T17:27:53.327+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "T423",
                "emfRuleSetId": 1246755,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6108,
                "description": "uni25",
                "active": true,
                "expression": "true",
                "expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10138,
                        "periodId": 6887,
                        "defaultValue": 2000
                    }
                ]
            },
            {
                "id": 9123,
                "attribution": {
                    "createdOn": "2023-09-25T17:27:53.327+0530",
                    "lastUpdatedOn": "2023-09-25T17:27:53.327+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "T980",
                "emfRuleSetId": 1246756,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6108,
                "description": "uni35",
                "active": true,
                "expression": "currentTxn.value<1000",
                "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\"<\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"1000\",\"type\":\"number:primitive\"}]}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10139,
                        "periodId": 6887,
                        "defaultValue": 2000
                    }
                ]
            },
            {
                "id": 9124,
                "attribution": {
                    "createdOn": "2023-09-25T17:27:53.539+0530",
                    "lastUpdatedOn": "2023-09-25T17:27:53.539+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "T790_ReturnBill",
                "emfRuleSetId": 1246757,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6108,
                "description": "uni15",
                "active": true,
                "expression": "currentTxn.value>500",
                "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\">\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"500\",\"type\":\"number:primitive\"}]}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10140,
                        "periodId": 6887,
                        "defaultValue": 2000
                    }
                ]
            },
            {
                "id": 9125,
                "attribution": {
                    "createdOn": "2023-09-25T17:27:53.539+0530",
                    "lastUpdatedOn": "2023-09-25T17:27:53.539+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "T423_ReturnBill",
                "emfRuleSetId": 1246758,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6108,
                "description": "uni25",
                "active": true,
                "expression": "true",
                "expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10141,
                        "periodId": 6887,
                        "defaultValue": 2000
                    }
                ]
            },
            {
                "id": 9126,
                "attribution": {
                    "createdOn": "2023-09-25T17:27:53.539+0530",
                    "lastUpdatedOn": "2023-09-25T17:27:53.539+0530",
                    "lastUpdatedBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50679771,
                        "code": "walmart_1",
                        "description": "",
                        "name": "walmart_1",
                        "type": "TILL"
                    }
                },
                "name": "T980_ReturnBill",
                "emfRuleSetId": 1246759,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6108,
                "description": "uni35",
                "active": true,
                "expression": "currentTxn.value<1000",
                "expressionJson": "{\"arity\":\"binary_operation\",\"value\":\"<\",\"type\":\"boolean:primitive\",\"operands\":[{\"arity\":\"object_dereference\",\"type\":\"real:object:primitive\",\"operands\":[{\"arity\":\"name\",\"value\":\"currentTxn\",\"type\":\"tx:object:primitive\"},{\"arity\":\"name\",\"value\":\"value\",\"type\":\"real:object:primitive\"}]},{\"arity\":\"literal\",\"value\":\"1000\",\"type\":\"number:primitive\"}]}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50679757,
                            50679770
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 10142,
                        "periodId": 6887,
                        "defaultValue": 2000
                    }
                ]
            }
        ],
        "combinationType": "ANY",
        "unifiedTargetExpression": {
            "aggregation": null,
            "thresholdValue": null,
            "ruleExpression": "(9121 | 9122 | 9123)"
        }
    },
    "errors": null,
    "warnings": null
}

API error codes

CodeDescription
310069Target group name already exists
300004Invalid input, check all values and ensure they are correct.
310008Length of Target rule name cannot exceed 200
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!