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 --location 'https://eu.api.capillarytech.com/v3/targetGroups' \
--header 'Content-Type: application/json' \
--header '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' \
--header 'Authorization: Basic bWFkaHVU2YQ==' \
--data '{
"active": true,
"fromDate": "2025-10-07T00:00:00.529Z",
"name": "uatTargetGroup61",
"preferredTillId": 75155297,
"toDate": "2025-11-25T00:00:00.529Z",
"trackingType": "DEFAULT",
"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_61",
"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. |
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": 2708,
"name": "uatTargetGroup61",
"fromDate": "2025-10-07",
"toDate": "2025-11-25",
"active": true,
"preferredTillId": 75155297,
"periods": [
{
"id": 29658,
"attribution": {
"createdOn": "2025-10-07T08:53:46.000+0000",
"lastUpdatedOn": "2025-10-07T08:53:46.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"
}
},
"startDate": "2025-07-21",
"endDate": "2025-07-21",
"refCode": "Cycle_1",
"periodStatus": "ENDED",
"targetGroupId": 2708,
"description": "p1",
"active": true
},
{
"id": 29659,
"attribution": {
"createdOn": "2025-10-07T08:53:46.000+0000",
"lastUpdatedOn": "2025-10-07T08:53:46.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"
}
},
"startDate": "2025-07-22",
"endDate": "2025-07-23",
"refCode": "Cycle_2",
"periodStatus": "ENDED",
"targetGroupId": 2708,
"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",
"trackingType": "DEFAULT",
"targets": [
{
"id": 2931,
"attribution": {
"createdOn": "2025-10-07T08:53:45.719+0000",
"lastUpdatedOn": "2025-10-07T08:53:45.719+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": "uat_target_group_61",
"targetType": "ALL",
"targetEntity": "ALTERNATE_CURRENCIES",
"eventName": "TransactionAdd",
"targetGroupId": 2708,
"active": true,
"expression": "true",
"expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
"filters": [],
"enrolmentMethod": "IMPORT",
"defaultValues": [
{
"id": 126341,
"periodId": 29658,
"defaultValue": 2
},
{
"id": 126342,
"periodId": 29659,
"defaultValue": 3
}
],
"targetPeriodDefaultValuesMap": {
"29658": {
"id": 126341,
"periodId": 29658,
"defaultValue": 2
},
"29659": {
"id": 126342,
"periodId": 29659,
"defaultValue": 3
}
},
"extendedFieldInfo": {
"programId": 783,
"alternateCurrencyIdentifier": "DocCoin"
}
}
],
"leaderboardEnabled": false,
"userCreated": false
},
"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
| Parameter | 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 | Integer | Identifier for the preferred or primary POS till for the target. Note: All alternate currencies allocated for a milestone achievement will be tagged to the preferred till. |
periods | Object | An object containing details on target creation, updates, and time-frame. |
periods.id | Integer | Unique ID of the target period. |
periods.attribution | Object | An object containing details on the creation and update details of the target period. |
periods.attribution.createdOn | String | Date the target period was created in ISO 8601 format. Example: 2024-12-10T11:49:28.972+0000 |
periods.attribution.lastUpdatedOn | String | Date the target period was last updated in ISO 8601 format. Example: 2024-12-10T11:49:28.972+0000 |
periods.attribution.lastUpdatedBy | Object | An object containing details on the updates to the target period. |
periods.attribution.lastUpdatedBy.id | Integer | Unique ID of the user who last modified the target period. |
periods.attribution.lastUpdatedBy.code | String | Code of the user who last modified the target period. |
periods.attribution.lastUpdatedBy.description | String | Description of the user who last modified the target period. |
periods.attribution.lastUpdatedBy.name | String | Name of the user who last modified the target period. |
periods.attribution.lastUpdatedBy.type | String | Type of user who last modified the target period. |
periods.startDate | String | Start date of the target group in YYYY-MM-DD. Example: 2024-10-24 |
periods.endDate | String | End date of the target group in YYYY-MM-DD. Example: 2024-10-24 |
periods.refCode | Integer | Custom identifier used to identify a target. |
periods.periodStatus | Enum | Status of the target period: RUNNING, UPCOMING, NOT_STARTED, LIVE, ENDED. |
periods.targetGroupId | Integer | Unique ID of the target group. |
periods.description | String | Description of the target group. |
periods.active | Boolean | Status of the target period: true (active) or false (inactive). |
totalPeriods | Integer | Total number of periods for the target group. |
description | String | Description of the target period. |
targetEvaluationType | Enum | Evaluation type: FIXED_CALENDAR_WINDOW, CYCLIC_WINDOW, PERIOD_AGNOSTIC_WINDOW. |
recurringCycles | Integer | Number of cycles for the target group (max: 100). |
frequency | Integer | Units per selected frequencyType. |
targetCycleStartDate | String | Start of the target cycle in ISO 8601 format. |
targetCycleEndDate | String | End of the target cycle in ISO 8601 format. |
frequencyType | Enum | Frequency of target cycles: MONTHLY, QUARTERLY, HALF_YEARLY, YEARLY, WEEKLY, DAILY, CUSTOM. |
trackingType | Enum | Milestone tracking type: DEFAULT, STREAK, CAPPING. |
targets | Object | Details on targets in the target group. |
targets.id | Integer | Unique ID of the target. |
targets.attribution.createdOn | String | Target creation date in ISO 8601. |
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 |
