Update unified target

👍

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 .

Prerequisites

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

Resource information

URI/v3/targetGroups/{targetGroupId}/unifiedTargets
HTTP methodPOST
Rate limitNA
Batch supportNA

API endpoint example

https://eu.api.capillarytech.com/v3/targetGroups/{targetGroupId}/unifiedTargets

Request body parameters

ParameterDataTypeDescription
unifiedTargetExpressionObjectContains the threshold value for a unified target expression
thresholdValueIntegerThe threshold value above which the target expression is considered true
targetsArray of ObjectsArray of targets, each target has several properties as described below
idIntegerUnique identifier for the target
nameStringThe name identifier for the target group.

The character limit for the name is 200 characters.
emfRuleSetIdIntegerIdentifier for the rule set associated with this target
targetTypeEnumTransaction type for the target.
Supported values: QUANTITY, SALES, COUNT, VISIT.
targetEntityEnumThe entity that is targeted, e.g., TRANSACTION
targetGroupIdIntegerGroup identifier which this target belongs to
descriptionStringDescription of the target
activeBooleanStatus to indicate whether the target is active or not.
expressionStringA representation of the target's condition rule.
expressionJsonJSON StringA JSON body that represents the target's rule.
filtersArray of ObjectsArray of filters to apply to the target
entityTypeStringType of entity the filter applies to, e.g., STORE
entityIdsArray of IntegersArray of entity identifiers which the filter applies to
enrolmentMethodStringMethod used for enrolment of 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).
defaultValuesArray of ObjectsArray of default values, each with its own set of properties
idIntegerIdentifier for the default value
periodIdIntegerIdentifier for the period associated with the default value
defaultValueIntegerThe actual default value
deactivateTargetIdsArray of IntegersArray of target identifiers that should be deactivated
{
    "unifiedTargetExpression": {
           "thresholdValue": 40000
        },
        "targets": [
    {
                "id": 10461,
                "name": "UTG-editTest11111",
                "emfRuleSetId": 1248820,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6668,
                "description": "unfied01",
                "active": true,
                "expression": "true",
                "expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50670140,
                            50670144,
                            50671644
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 11652,
                        "periodId": 7521,
                        "defaultValue": 10000
                    },
                    {
                        "id": 11653,
                        "periodId": 7522,
                        "defaultValue": 20000
                    }
                ]
            }
        ],
        "deactivateTargetIds": [10462
        ]
    
}

Response parameters

ParameterDataTypeDescription
dataObjectThe main data object that contains all the response details
unifiedTargetExpressionObjectObject that defines the unified target expression
aggregationStringThe method of aggregation for the target expression
thresholdValueIntegerThe value at which the target expression is considered to meet criteria
ruleExpressionStringA logical expression involving target IDs
targetsArray of ObjectsArray of target objects
idIntegerUnique identifier of the target
attributionObjectObject containing attribution details
createdOnString (Date-Time)Timestamp of when the target was created
lastUpdatedOnString (Date-Time)Timestamp of the last update to the target
lastUpdatedByObjectObject with details of who last updated the target
idIntegerIdentifier of the last updater
codeStringCode associated with the last updater
descriptionStringDescription associated with the last updater
nameStringName of the last updater
typeStringType of entity the last updater is (e.g., TILL)
createdByObjectObject with details of who created the target
nameStringName of the target
emfRuleSetIdIntegerIdentifier for the rule set associated with the target
targetTypeStringType of target (e.g., SALES)
targetEntityStringEntity targeted (e.g., TRANSACTION)
targetGroupIdIntegerGroup ID associated with the target
descriptionStringDescription of the target
activeBooleanIndicates if the target is active
expressionStringLogical expression as a string for target condition
expressionJsonString (JSON)JSON string representing the logical expression in more detail
filtersArray of ObjectsArray of filter objects to apply to the target
entityTypeStringType of entity the filter applies to
entityIdsArray of IntegersArray of entity IDs the filter applies to
enrolmentMethodStringMethod of enrolment for the target
defaultValuesArray of ObjectsArray of objects each with default values for the target
idIntegerIdentifier for the default value entry
periodIdIntegerPeriod ID associated with the default value
defaultValueIntegerThe default value set for the target
deactivateTargetIdsArray of IntegersArray of target IDs to be deactivated
errorsObjectObject containing details of any errors in the request
warningsObjectObject containing details of any warnings in the request
{
    "data": {
        "unifiedTargetExpression": {
            "aggregation": "SUM",
            "thresholdValue": 40000,
            "ruleExpression": "(10461 & 10463)"
        },
        "targets": [
            {
                "id": 10461,
                "attribution": {
                    "createdOn": "2023-10-04T16:30:28.000+0530",
                    "lastUpdatedOn": "2023-10-04T16:30:28.000+0530",
                    "lastUpdatedBy": {
                        "id": 50670145,
                        "code": "tillhg",
                        "description": "",
                        "name": "tillhg",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50670145,
                        "code": "tillhg",
                        "description": "",
                        "name": "tillhg",
                        "type": "TILL"
                    }
                },
                "name": "UTG-editTest11111",
                "emfRuleSetId": 1248820,
                "targetType": "SALES",
                "targetEntity": "TRANSACTION",
                "targetGroupId": 6668,
                "description": "unfied01",
                "active": true,
                "expression": "true",
                "expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
                "filters": [
                    {
                        "entityType": "STORE",
                        "entityIds": [
                            50670140,
                            50670144,
                            50671644
                        ]
                    }
                ],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 11652,
                        "periodId": 7521,
                        "defaultValue": 10000
                    },
                    {
                        "id": 11653,
                        "periodId": 7522,
                        "defaultValue": 20000
                    }
                ]
            }
        ],
        "deactivateTargetIds": [
            10462
        ]
    },
    "errors": null,
    "warnings": null
}
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!