put https://{host}/v3/targetGroups//unifiedTargets
NoteFor 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 .
Example request
curl --location --request PUT 'https://eu.api.capillarytech.com/v3/targetGroups/2697/unifiedTargets' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bWFk2YQ==' \
--header 'Cookie: _cfuvid=Moihiv.qXJ9Hz7qisjNQAhjyR9dJVYj.1pY8Xy9o1ks-1759740373963-0.0.1.1-604800000' \
--data '{
"unifiedTargetExpression": {
"thresholdValue": 40000
},
"targets": [
{
"id": 2926,
"attribution": {
"createdOn": "2025-10-06T08:56:39.024+0000",
"lastUpdatedOn": "2025-10-06T08:56:39.024+0000",
"lastUpdatedBy": {
"id": 75197372,
"code": "madhu_rima",
"description": "madhurima'\''s till",
"name": "madhurima",
"type": "TILL"
},
"createdBy": {
"id": 75197372,
"code": "madhu_rima",
"description": "madhurima'\''s till",
"name": "madhurima",
"type": "TILL"
}
},
"name": "uatUnifiedTarget71",
"emfRuleSetId": 126442714,
"targetType": "SALES",
"targetEntity": "TRANSACTION",
"eventName": "TransactionAdd",
"targetGroupId": 2697,
"description": "uatUnifiedTargets65",
"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\"}]}",
"enrolmentMethod": "TRANSACTION",
"defaultValues": [
{
"id": 126333,
"periodId": 29635,
"defaultValue": 2000.000
}
],
"targetPeriodDefaultValuesMap": {
"29635": {
"id": 126333,
"periodId": 29635,
"defaultValue": 2000.000
}
}
}
],
"deactivateTargetIds": [
]
}'Prerequisites
- Authentication: Basic authentication details
- Access group resource: WRITE access to target loyalty access group resource
Resource information
| URI | /v3/targetGroups/{targetGroupId}/unifiedTargets |
| HTTP method | POST |
| Rate limit | NA |
| Batch support | NA |
Request Body Parameters
| Parameter | DataType | Description |
|---|---|---|
unifiedTargetExpression | Object | Contains the threshold value for a unified target expression |
- thresholdValue | Integer | The threshold value above which the target expression is considered true |
targets | Array of Objects | Array of targets, each target has several properties as described below |
- id | Integer | Unique identifier for the target |
- name | String | The name identifier for the target group. The character limit for the name is 200 characters. |
- emfRuleSetId | Integer | Identifier for the rule set associated with this target |
- targetType | Enum | Target type on which the target is set. Supported values: Transactional activities: QUANTITY, SALES (SUM), COUNT, VISIT Behavioral events: EVENT_ATTRIBUTE You can create multiple targets using any combination of the supported target types. |
- targetEntity | Enum | Entity to define target condition. Supported values: To track transactions: TRANSACTION, LINEITEM, POINTS To track behavioural events: EVENT To track alternate currencies: ALTERNATE_CURRENCIES To track points: REWARDS You can mix and match target entities. Refer to: Customer (EMF) events Behavioural events Alternate currencies |
- targetGroupId | Integer | Group identifier which this target belongs to |
- description | String | Description of the target |
- active | Boolean | Status to indicate whether the target is active or not. |
- expression | String | A representation of the target's condition rule. |
- expressionJson | JSON String | A JSON body that represents the target's rule. |
- filters | Array of Objects | Array of filters to apply to the target |
-- entityType | String | Type of entity the filter applies to, e.g., STORE |
-- entityIds | Array of Integers | Array of entity identifiers which the filter applies to |
- enrolmentMethod | String | Method used for enrolment of customers and add target values. Supported values: TRANSACTION - Enroll loyalty customers who transact during the target period IMPORT - Import a list of customers with custom target value |
- defaultValues | Array of Objects | Array of default values, each with its own set of properties |
-- id | Integer | Identifier for the default value |
-- periodId | Integer | Identifier for the period associated with the default value |
-- defaultValue | Integer | The actual default value |
Example response
{
"data": {
"unifiedTargetExpression": {
"aggregation": "SUM",
"thresholdValue": 40000,
"ruleExpression": "(2926 & 2927)"
},
"targets": [
{
"id": 2926,
"attribution": {
"createdOn": "2025-10-06T08:56:39.000+0000",
"lastUpdatedOn": "2025-10-06T08:56:39.000+0000",
"lastUpdatedBy": {
"id": 75197372,
"code": "madhu_rima",
"description": "madhurima's till",
"name": "madhurima",
"type": "TILL"
},
"createdBy": {
"id": 75197372,
"code": "madhu_rima",
"description": "madhurima's till",
"name": "madhurima",
"type": "TILL"
}
},
"name": "uatUnifiedTarget71",
"emfRuleSetId": 126442714,
"targetType": "SALES",
"targetEntity": "TRANSACTION",
"eventName": "TransactionAdd",
"targetGroupId": 2697,
"description": "uatUnifiedTargets65",
"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\"}]}",
"enrolmentMethod": "TRANSACTION",
"defaultValues": [
{
"id": 126333,
"periodId": 29635,
"defaultValue": 2000.000
}
],
"targetPeriodDefaultValuesMap": {
"29635": {
"id": 126333,
"periodId": 29635,
"defaultValue": 2000.000
}
}
}
],
"deactivateTargetIds": []
},
"errors": null,
"warnings": null
}Response parameters
| Parameter | DataType | Description |
|---|---|---|
| data | Object | The main data object that contains all the response details |
| unifiedTargetExpression | Object | Object that defines the unified target expression |
| aggregation | String | The method of aggregation for the target expression |
| thresholdValue | Integer | The value at which the target expression is considered to meet criteria |
| ruleExpression | String | A logical expression involving target IDs |
| targets | Array of Objects | Array of target objects |
| id | Integer | Unique identifier of the target |
| attribution | Object | Object containing attribution details |
| createdOn | String (Date-Time) | Timestamp of when the target was created |
| lastUpdatedOn | String (Date-Time) | Timestamp of the last update to the target |
| lastUpdatedBy | Object | Object with details of who last updated the target |
| id | Integer | Identifier of the last updater |
| code | String | Code associated with the last updater |
| description | String | Description associated with the last updater |
| name | String | Name of the last updater |
| type | String | Type of entity the last updater is (e.g., TILL) |
| createdBy | Object | Object with details of who created the target |
| name | String | Name of the target |
| emfRuleSetId | Integer | Identifier for the rule set associated with the target |
| targetType | String | Type of target (e.g., SALES) |
| targetEntity | String | Entity targeted (e.g., TRANSACTION) |
| targetGroupId | Integer | Group ID associated with the target |
| description | String | Description of the target |
| active | Boolean | Indicates if the target is active |
| expression | String | Logical expression as a string for target condition |
| expressionJson | String (JSON) | JSON string representing the logical expression in more detail |
| filters | Array of Objects | Array of filter objects to apply to the target |
| entityType | String | Type of entity the filter applies to |
| entityIds | Array of Integers | Array of entity IDs the filter applies to |
| enrolmentMethod | String | Method of enrolment for the target |
| defaultValues | Array of Objects | Array of objects each with default values for the target |
| id | Integer | Identifier for the default value entry |
| periodId | Integer | Period ID associated with the default value |
| defaultValue | Integer | The default value set for the target |
| deactivateTargetIds | Array of Integers | Array of target IDs to be deactivated |
| errors | Object | Object containing details of any errors in the request |
| warnings | Object | Object 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
}