Create a target group/milestone based on alternate currencies.
Alternate Currency Based Target Group API
Alternate currencies are a flexible rewards system functioning like points but customized to brand-specific needs (e.g., stars or custom coins). A target group based on alternate currencies tracks the alternate currencies earned by customers and rewards them upon reaching the target.
For more information, see the alternate currencies documentation.
Example request
curl -L 'https://eu.api.capillarytech.com/v3/targetGroups' \
-H 'Content-Type: application/json' \
-H 'Cookie: _cfuvid=aidEostKQWmdskBHmh1pchvz2wSoA1O27JghNUFOpHw-1728306311172-0.0.1.1-604800000; _cfuvid=2ieM2eqBqFdNAAdfQMYR0zNvTd6WWmQxVVyU.OyFiEw-1728475108732-0.0.1.1-604800000; _cfuvid=kYnuHywd2SuhkmuOi2_c7.Ie8_QvI8s1bFiaSPpP.8M-1759827226073-0.0.1.1-604800000; _cfuvid=4yQ.rawpbQf4P30QMM55R316xFW18w5eFCc.rEOnRfQ-1764071843446-0.0.1.1-604800000' \
-H 'Authorization: Basic ZlY2I2MmEy' \
-d '{
"active": true,
"fromDate": "2025-10-07T00:00:00.529Z",
"name": "uatTargetGroup96",
"preferredTillId": 75155297,
"toDate": "2025-11-25T00:00:00.529Z",
"trackingType": "DEFAULT",
"timeZoneName": "Asia/Kolkata",
"totalPeriods": 2,
"frequency": 2,
"recurringCycles": 2,
"targetEvaluationType": "FIXED_CALENDAR_WINDOW",
"targetCycleStartDate": "2025-07-23T00:00:00.529Z",
"periods": [
{
"active": true,
"description": "p1",
"endDate": "2025-07-21T23:00:00.529Z",
"periodStatus": "RUNNING",
"refCode": "Cycle_1",
"startDate": "2025-07-21T00:00:00.529Z"
},
{
"active": true,
"description": "p2",
"endDate": "2025-07-23T00:00:00.529Z",
"periodStatus": "NOT_STARTED",
"refCode": "Cycle_2",
"startDate": "2025-07-22T00:00:00.529Z"
}
],
"targets": [
{
"targetEntity": "ALTERNATE_CURRENCIES",
"targetType": "ALL",
"extendedFieldInfo": {
"alternateCurrencyIdentifier": "DocCoin",
"programId": 783
},
"defaultValues": [
{
"defaultValue": "2"
},
{
"defaultValue": "3"
}
],
"targetMilestoneTriggers": [],
"expression": "true",
"expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
"filters": [],
"name": "uat_target_group_96",
"enrolmentMethod": "IMPORT"
}
]
}'Prerequisites
- Authentication: Basic or OAuth
- Default access group
Resource Information
| Parameter | Value |
|---|---|
| URI | v3/targetGroups |
| HTTP Method | POST |
| Pagination | No |
| Rate Limit | No |
| Batch Support | No |
Request Body Parameters
Parameter Name (Fields marked with * are mandatory) | Data Type | Description |
|---|---|---|
active | Boolean | Indicate if target tracking is active. Default value: |
description | String | Brief description of the target group. |
name* | String | Name for the target group. |
preferredTillId | Integer | Identifier for the preferred or primary POS till for the target. |
timeZoneName | String | IANA time zone name for |
trackingType* | Enum | Type of tracking the milestone is created for. Supported values: |
targetEvaluationType* | Enum | Defines the type of time frame used for evaluating the target. |
totalPeriods* | Integer | Total number of period cycles for the target group. |
frequencyType* | Enum | Frequency of each cycle in which the user has to achieve the target value. |
frequency* | Integer | Number of units corresponding to the selected |
recurringCycles* | Integer | Total number of cycles defined for the target group. Once a cycle is complete, the target is reset for the new cycle. |
periods | Object | An object containing details on the target period creation, updates, and time-frame. |
active | Boolean | Indicate if the period is active. Default value: |
| String | Brief description of the period. |
| String | End date and time of the period in ISO 8601 |
| Enum | Indicate if the cycle of the Milestone is running or upcoming. |
| String | A reference code for the period. |
| String | Start date and time of the period in ISO 8601 |
targets | Object | An object containing details on the targets in the target group. |
| Boolean | Indicate if the target is active. Default value: |
| String | Brief description of the target. |
| Boolean | Indicate if the target has an expression for evaluation. Default value: |
| String | A JSON expression that specifies the conditions required to achieve the target. The expression is generated in the backend. |
| Object | An object containing details on the scope filters active on the target. |
| String | Name for the target. |
| Enum | KPI on which the target is tracked. |
| Enum | Method of enrolment for the target. Supported values: |
| Enum | Type of target |
| Object | An object containing details of the default values for the target. |
-- defaultValue | Float | Default value for the target. |
| Object | An object containing details on the extended field information for the target group. |
-- alternateCurrencyIdentifier* | String | Unique identifier of the alternate currency that is generated when creating an alternate currency. |
-- programId* | Integer | Unique ID of the loyalty program that includes the alternate currency. |
Example response
{
"data": {
"id": 2779,
"name": "uatTargetGroup96",
"fromDate": "2025-10-07",
"toDate": "2025-11-25",
"active": true,
"preferredTillId": 75155297,
"periods": [
{
"id": 30186,
"attribution": {
"createdOn": "2025-11-25T11:57:23.000+0000",
"createdOnISO": "2025-11-25T11:57:23Z",
"lastUpdatedOn": "2025-11-25T11:57:23.000+0000",
"lastUpdatedOnISO": "2025-11-25T11:57:23Z",
"lastUpdatedBy": {
"id": 75152721,
"code": "naman_doc",
"description": "",
"name": "naman",
"type": "TILL"
},
"createdBy": {
"id": 75152721,
"code": "naman_doc",
"description": "",
"name": "naman",
"type": "TILL"
}
},
"startDate": "2025-07-21",
"endDate": "2025-07-21",
"refCode": "Cycle_1",
"periodStatus": "ENDED",
"targetGroupId": 2779,
"description": "p1",
"active": true
},
{
"id": 30187,
"attribution": {
"createdOn": "2025-11-25T11:57:23.000+0000",
"createdOnISO": "2025-11-25T11:57:23Z",
"lastUpdatedOn": "2025-11-25T11:57:23.000+0000",
"lastUpdatedOnISO": "2025-11-25T11:57:23Z",
"lastUpdatedBy": {
"id": 75152721,
"code": "naman_doc",
"description": "",
"name": "naman",
"type": "TILL"
},
"createdBy": {
"id": 75152721,
"code": "naman_doc",
"description": "",
"name": "naman",
"type": "TILL"
}
},
"startDate": "2025-07-22",
"endDate": "2025-07-23",
"refCode": "Cycle_2",
"periodStatus": "ENDED",
"targetGroupId": 2779,
"description": "p2",
"active": true
}
],
"totalPeriods": 2,
"targetEvaluationType": "FIXED_CALENDAR_WINDOW",
"recurringCycles": 2,
"frequency": 2,
"targetCycleStartDate": "2025-07-21T00:00:00.000Z",
"targetCycleEndDate": "2025-07-23T23:59:59.000Z",
"targetCycleStartDateISO": "2025-07-21T00:00:00Z",
"targetCycleEndDateISO": "2025-07-23T23:59:59Z",
"trackingType": "DEFAULT",
"targets": [
{
"id": 3026,
"attribution": {
"createdOn": "2025-11-25T11:57:23.217+0000",
"createdOnISO": "2025-11-25T11:57:23Z",
"lastUpdatedOn": "2025-11-25T11:57:23.217+0000",
"lastUpdatedOnISO": "2025-11-25T11:57:23Z",
"lastUpdatedBy": {
"id": 75152721,
"code": "naman_doc",
"description": "",
"name": "naman",
"type": "TILL"
},
"createdBy": {
"id": 75152721,
"code": "naman_doc",
"description": "",
"name": "naman",
"type": "TILL"
}
},
"name": "uat_target_group_96",
"targetType": "ALL",
"targetEntity": "ALTERNATE_CURRENCIES",
"eventName": "TransactionAdd",
"targetGroupId": 2779,
"active": true,
"expression": "true",
"expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
"filters": [],
"enrolmentMethod": "IMPORT",
"defaultValues": [
{
"id": 127093,
"periodId": 30186,
"defaultValue": 2
},
{
"id": 127094,
"periodId": 30187,
"defaultValue": 3
}
],
"targetPeriodDefaultValuesMap": {
"30186": {
"id": 127093,
"periodId": 30186,
"defaultValue": 2
},
"30187": {
"id": 127094,
"periodId": 30187,
"defaultValue": 3
}
},
"extendedFieldInfo": {
"programId": 783,
"alternateCurrencyIdentifier": "DocCoin"
}
}
],
"leaderboardEnabled": false,
"userCreated": false,
"timeZoneName": "Asia/Kolkata"
},
"errors": null,
"warnings": null
}{
"data": null,
"errors": [
{
"code": 310033,
"message": "Invalid target entity and target type combination"
}
],
"warnings": null
}{
"data": null,
"errors": [
{
"code": 310146,
"message": "Invalid program id"
}
],
"warnings": null
}{
"data": null,
"errors": [
{
"code": 310094,
"message": "Target rule metadata is required in case of EXTENDED_FIELD/ALTERNATE_CURRENCIES target type"
}
],
"warnings": null
}{
"data": null,
"errors": [
{
"code": 310147,
"message": "Invalid or null Alternate Currency Identifier for target rule"
}
],
"warnings": null
}Response parameters
Field | Data Type | Description |
|---|---|---|
id | Integer | Unique ID of the target group |
name | String | Unique name of the target group. |
active | Boolean | Indicates if target tracking is active. |
preferredTillId | Number | Identifier for the preferred POS till. |
trackingType | Enum | The type of tracking the milestone is created for. Supported values: |
frequency | Number | Frequency count, based on the |
recurringCycles | Number | Number of cycles for which the tracking recurs. |
periods | Object | Details on target creation, updates, and time-frame. |
-id | Integer | The unique ID of the target period. |
-attribution | Object | Details on the creation and update details of the target period. |
-- createdOn | String | Date the target period was created in ISO 8601 |
-- createdOnISO | String | Date the target period was created in ISO 8601 |
--lastUpdatedOn | String | Date the target period was last updated in ISO 8601 |
--lastUpdatedOnISO | String | Date the target period was last updated in ISO 8601 |
--lastUpdatedBy | Object | Details on updates to the target period. |
---id | Integer | Unique ID of the user who last modified the target period. |
---code | String | Code of the user who last modified the target period. |
---description | String | Description of the user who last modified the target period. |
---name | String | Name of the user who last modified the target period. |
---type | String | Type of user who last modified the target period. |
-startDate | String | Start date of the target group, in |
-endDate | String | End date of the target group, in |
-refCode | Integer | Reference code of the target period. |
-periodStatus | String | Current status of the target period. Supported values |
-targetGroupId | Integer | Unique ID of the target group. |
-description | String | Description of the target group. |
-active | Boolean | Current active status of the target period. If true, the target is currently active, else the target is inactive. |
totalPeriods | Integer | Total number of periods for the target group. |
description | String | Description of the target period. |
targetEvaluationType | ENUM | Evaluation strategy for the target. |
recurringCycles | Integer | Number of cycles for which the tracking recurs. |
targetCycleStartDate | String | Start date of the target cycle in ISO 8601 |
targetCycleEndDate | String | End date of the target cycle in ISO 8601 |
targetCycleStartDateISO | String | Start date of the target cycle in ISO 8601 |
targetCycleEndDate | String | End date of the target cycle in ISO 8601 |
frequencyType | String | The frequency of each cycle in which the user has to achieve the target value. |
trackingType | Enum | The type of tracking the milestone is created for. |
targets | Object | Details on creation of the target. |
-id | Boolean | Unique ID of the target. |
-attribution | Object | Details on the creation and update details of the target. |
-- createdOn | String | Date the target was created in ISO 8601 |
-- createdOnISO | String | Date the target was created in ISO 8601 |
-- lastUpdatedOn | String | Date the target was last updated in ISO 8601 |
-- lastUpdatedOnISO | String | Date the target was last updated in ISO 8601 |
-- lastUpdatedBy | Object | Details on updates to the target. |
--- id | Integer | Unique ID of the user who last modified the target. |
--- code | Integer | Code of the user who last modified the target. |
-- description | String | Description of the user who last modified the target. |
--- name | String | Name of the user who last modified the target. |
--- type | String | Type of user who last modified the target. |
-- createdBy | Object | Details on creation of the target. |
--- id | Integer | Unique ID of the user who created the target . |
--- code | Integer | Code of the user who created the target. |
--- description | String | Description of the user who created the target. |
--- name | String | Name of the user who created the target. |
--- type | String | Type of user who created the target. |
---name | String | Unique name for the target. |
--targetType | String | The type of target |
--targetEntity | Enum | The KPI on which the target is tracked. |
--eventName | String | Name of the event that triggers the target. |
--targetGroupId | Integer | Unique ID of the target group associated with the target. |
--description | String | Description of the target. |
--active | Boolean | Current active status of the target. If true, the target is currently active, else the target is inactive. |
-- expression | Boolean | Indicates if the target has an expression for evaluation. |
-- expressionJson | String | A JSON expression that specifies the conditions required to achieve the target. |
-- filters | Object | Details on the scope filters active on the target. |
-- enrolmentMethod | Enum | The method of enrolment for the target. Supported values: |
-- defaultValues | Object | Details on the default values for the target. |
--- defaultValue | Float | A default value used in the target evaluation. |
-- targetPeriodDefaultValuesMap | Object | Details on the default values for the target period. |
-- extendedFieldInfo | Object | Details on extended field information for the target group. |
-- programId | Integer | Unique ID of the loyalty program |
-- alternateCurrencyIdentifier | String | Unique ID of the alternate currency. |
leaderboardEnabled | Boolean | Indicates if the leaderboard feature is enabled. |
userCreated | Boolean | Indicates if the target is a user-created target. |
timezoneName | String | IANA time zone name for |
errors | null or Object | Contains error details if any occurred during the API request. |
warnings | null or Object | Contains warning details if any occurred during the API request. |
API error codes
| Code | Description |
|---|---|
| 310069 | Target group name already exists |
| 300004 | Invalid input, check all values and ensure they are correct. |
| 310008 | Length of Target rule name cannot exceed 200 |
| 310033 | Invalid target entity and target type combination |
| 310146 | Invalid program id |
| 310094 | Target rule metadata is required in case of EXTENDED_FIELD/ALTERNATE_CURRENCIES target type |
| 310147 | Invalid or null Alternate Currency Identifier for target rule |
