Create target group based on alternate currencies

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
❗️

This API is being phased out and will no longer be available for creating new milestones.

To create a new milestone, use the Create a Loyalty Promotion API


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

ParameterValue
URIv3/targetGroups
HTTP MethodPOST
PaginationNo
Rate LimitNo
Batch SupportNo

Request Body Parameters

Parameter Name (Fields marked with * are mandatory)Data TypeDescription
activeBooleanIndicate if target tracking is active. Default value: true
descriptionStringBrief description of the target group.
The character limit for the description is 255 characters and special characters are supported.
name*StringName for the target group.
The name can be up to 200 characters long, supports special characters, and is case-insensitive.
preferredTillIdIntegerIdentifier 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.
timeZoneNameStringIANA time zone name for
the target group; defaults
to system time zone when
omitted.
targetCycleStartDateISOString

Defines the target’s start date in ISO 8601 format with the region offset.

For example:
The start date is at 14:30:45 on December 16, 2025, in India

Format for the request parameter:
2025-12-16T14:30:45+05:30

targetCycleEndDateISOString

Defines the target’s end date in ISO 8601 format with the region offset.

For example:
The start date is at 14:30:45 on December 16, 2025, in India

Format for the request parameter:
2025-12-16T14:30:45+05:30

trackingType*EnumType of tracking the milestone is created for. Supported values:
DEFAULT: Track a single target
STREAK: Track multiple targets as a streak.
CAPPING: Track the number of points a user has got over a period, so that capping can be applied.

Creating a target based on alternate currencies is not supported for unified targets.
Refer to the documentation on milestones, unified targets, streaks, and capping for more information.
targetEvaluationType*EnumDefines the type of time frame used for evaluating the target.
Supported values:
FIXED_CALENDAR_WINDOW: Each cycle runs for a fixed, predefined time period (for example, one month or one year) from the selected start date.
CYCLIC_WINDOW: Each cycle can have individual time periods.
PERIOD_AGNOSTIC_WINDOW: The cycle ends as soon as the user achieves the target, regardless of the time taken. There’s no set time frame for the cycle.

Refer to the documentation on milestone cycles for more details.
totalPeriods*IntegerTotal number of period cycles for the target group.
frequencyType*EnumFrequency of each cycle in which the user has to achieve the target value.
Supported values: MONTHLY, QUARTERLY, HALF_YEARLY, YEARLY, WEEKLY, DAILY, CUSTOM.
frequency*IntegerNumber of units corresponding to the selected frequencyType
For example: If frequencyType is DAILY and frequency is 10, the cycle spans ten days.
recurringCycles*IntegerTotal number of cycles defined for the target group. Once a cycle is complete, the target is reset for the new cycle.
A maximum of 100 cycles can be defined for a target group.
periodsObjectAn object containing details on the target period creation, updates, and time-frame.
activeBooleanIndicate if the period is active. Default value: true
  • description
StringBrief description of the period.
The character limit for the description is 255 characters and special characters are supported.
  • endDate*
StringEnd date and time of the period in ISO 8601 YYYY-MM-DDTHH:mm:ss.SSS format. Example: 2024-10-24T23:59:00.000.
  • periodStatus
EnumIndicate if the cycle of the Milestone is running or upcoming.
Supported values: RUNNING, UPCOMING, NOT_STARTED, LIVE, ENDED.
  • refCode*
StringA reference code for the period.
  • startDate*
StringStart date and time of the period in ISO 8601 YYYY-MM-DDTHH:mm:ss.SSS format. Example: 2024-10-24T00:00:00.000
targetsObjectAn object containing details on the targets in the target group.
  • active
BooleanIndicate if the target is active. Default value: true
  • description
StringBrief description of the target.
The character limit for the description is 255 characters and special characters are supported.
  • expression
BooleanIndicate if the target has an expression for evaluation. Default value: true
  • expressionJson
StringA JSON expression that specifies the conditions required to achieve the target. The expression is generated in the backend.
  • filters
ObjectAn object containing details on the scope filters active on the target.
  • name*
StringName for the target.
The name can be up to 200 characters long, supports special characters, and is case-insensitive.
  • targetEntity*
EnumKPI on which the target is tracked.
For alternate currencies, the value is ALTERNATE_CURRENCIES.
  • enrolmentMethod
EnumMethod of enrolment for the target. Supported values: TRANSACTION, IMPORT.
  • targetType*
EnumType of target
Supported values:
ALL: Tracks points earned from both loyalty programs and promotions.
REGULAR: Tracks only loyalty program points.
PROMOTION: Tracks only promotional points.
  • defaultValues
ObjectAn object containing details of the default values for the target.
-- defaultValueFloatDefault value for the target.
  • extendedFieldInfo*
ObjectAn object containing details on the extended field information for the target group.
-- alternateCurrencyIdentifier*StringUnique identifier of the alternate currency that is generated when creating an alternate currency.
-- programId*IntegerUnique ID of the loyalty program that includes the alternate currency.

Example response

{
    "data": {
        "id": 2909,
        "name": "uatTargetGroup132",
        "fromDate": "2026-01-01",
        "toDate": "2026-02-01",
        "active": true,
        "preferredTillId": 75155297,
        "periods": [
            {
                "id": 31619,
                "attribution": {
                    "createdOn": "2026-01-12T12:09:28.000+0000",
                    "createdOnISO": "2026-01-12T12:09:28Z",
                    "lastUpdatedOn": "2026-01-12T12:09:28.000+0000",
                    "lastUpdatedOnISO": "2026-01-12T12:09:28Z",
                    "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": 2909,
                "description": "p1",
                "active": true
            },
            {
                "id": 31620,
                "attribution": {
                    "createdOn": "2026-01-12T12:09:28.000+0000",
                    "createdOnISO": "2026-01-12T12:09:28Z",
                    "lastUpdatedOn": "2026-01-12T12:09:28.000+0000",
                    "lastUpdatedOnISO": "2026-01-12T12:09:28Z",
                    "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": 2909,
                "description": "p2",
                "active": true
            }
        ],
        "totalPeriods": 2,
        "targetEvaluationType": "FIXED_CALENDAR_WINDOW",
        "recurringCycles": 2,
        "frequency": 2,
        "targetCycleStartDate": "2025-07-23T00:00:00.529Z",
        "targetCycleEndDate": "2026-02-01T05:00:00.000Z",
        "targetCycleStartDateISO": "2025-07-23T00:00:00Z",
        "targetCycleEndDateISO": "2026-02-01T05:00:00Z",
        "trackingType": "DEFAULT",
        "targets": [
            {
                "id": 3146,
                "attribution": {
                    "createdOn": "2026-01-12T12:09:27.605+0000",
                    "createdOnISO": "2026-01-12T12:09:27Z",
                    "lastUpdatedOn": "2026-01-12T12:09:27.605+0000",
                    "lastUpdatedOnISO": "2026-01-12T12:09:27Z",
                    "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_132",
                "targetType": "ALL",
                "targetEntity": "ALTERNATE_CURRENCIES",
                "eventName": "TransactionAdd",
                "targetGroupId": 2909,
                "active": true,
                "expression": "true",
                "expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
                "filters": [],
                "enrolmentMethod": "IMPORT",
                "defaultValues": [
                    {
                        "id": 128499,
                        "periodId": 31619,
                        "defaultValue": 2
                    },
                    {
                        "id": 128500,
                        "periodId": 31620,
                        "defaultValue": 3
                    }
                ],
                "targetPeriodDefaultValuesMap": {
                    "31619": {
                        "id": 128499,
                        "periodId": 31619,
                        "defaultValue": 2
                    },
                    "31620": {
                        "id": 128500,
                        "periodId": 31620,
                        "defaultValue": 3
                    }
                },
                "extendedFieldInfo": {
                    "programId": 973,
                    "alternateCurrencyIdentifier": "DocCoin"
                }
            }
        ],
        "leaderboardEnabled": false,
        "userCreated": false,
        "timeZoneName": "GMT"
    },
    "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

FieldData TypeDescription
idIntegerUnique ID of the target group
nameStringUnique name of the target group.
activeBooleanIndicates if target tracking is active.
preferredTillIdNumberIdentifier for the preferred POS till.
trackingTypeEnumThe type of tracking the milestone is created for. Supported values:
DEFAULT: Track a single target
UNIFIED :Track multiple targets
STREAK: Track multiple targets as a streak.
CAPPING: Track the number of points a user has got over a period, so that capping can be applied.
frequencyNumberFrequency count, based on the frequencyType.
recurringCyclesNumberNumber of cycles for which the tracking recurs.
periodsObjectDetails on target creation, updates, and time-frame.
-idIntegerThe unique ID of the target period.
-attributionObjectDetails on the creation and update details of the target period.
-- createdOnStringDate the target period was created in ISO 8601 YYYY-MM-DDTHH:mm:ss.SSS format.
Note: This field will be deprecated in the future and is being replaced by createdOnISO.
-- createdOnISOString

Indicates the start date and time of the target period in ISO 8601 format, returned in the server time zone.

EU server example
2025-12-16T14:30:45Z → 16 December 2025, 14:30:45 (UTC)

India server example
2025-12-16T14:30:45+05:30 → 16 December 2025, 14:30:45 (IST)

Note: The response time zone always matches the server time zone, regardless of the time zone offset in the request.

--lastUpdatedOnStringDate the target period was last updated in ISO 8601 YYYY-MM-DDTHH:mm:ss.SSS format.
Note: This field will be deprecated in the future and is being replaced by lastUpdatedOnISO.
--lastUpdatedOnISOString

Indicates the last updated date and time of the target period in ISO 8601 format, returned in the server time zone.

EU server example
2025-12-16T14:30:45Z → 16 December 2025, 14:30:45 (UTC)

India server example
2025-12-16T14:30:45+05:30 → 16 December 2025, 14:30:45 (IST)

Note: The response time zone always matches the server time zone, regardless of the time zone offset in the request.

--lastUpdatedByObjectDetails on updates to the target period.
---idIntegerUnique ID of the user who last modified the target period.
---codeStringCode of the user who last modified the target period.
---descriptionStringDescription of the user who last modified the target period.
---nameStringName of the user who last modified the target period.
---typeStringType of user who last modified the target period.
-startDateStringStart date of the target group, in YYYY-MM-DD format.
-endDateStringEnd date of the target group, in YYYY-MM-DD format.
-refCodeIntegerReference code of the target period.
-periodStatusStringCurrent status of the target period. Supported values NOT_STARTED, LIVE and ENDED.
-targetGroupIdIntegerUnique ID of the target group.
-descriptionStringDescription of the target group.
-activeBooleanCurrent active status of the target period. If true, the target is currently active, else the target is inactive.
totalPeriodsIntegerTotal number of periods for the target group.
descriptionStringDescription of the target period.
targetEvaluationTypeENUMEvaluation strategy for the target.
recurringCyclesIntegerNumber of cycles for which the tracking recurs.
targetCycleStartDateStringStart date of the target cycle in ISO 8601 YYYY-MM-DDTHH:mm:ss.SSS format.
Note: This field will be deprecated in the future and is being replaced by targetCycleStartDateISO.
targetCycleEndDateStringEnd date of the target cycle in ISO 8601 YYYY-MM-DDTHH:mm:ss.SSS format.
Start date of the target cycle in ISO 8601 YYYY-MM-DDTHH:mm:ss.SSS format.
Note: This field will be deprecated in the future and is being replaced by targetCycleEndDateISO.
targetCycleStartDateISOString

Indicates the start date and time of the target in ISO 8601 format, returned in the server time zone.

EU server example
2025-12-16T14:30:45Z → 16 December 2025, 14:30:45 (UTC)

India server example
2025-12-16T14:30:45+05:30 → 16 December 2025, 14:30:45 (IST)

Note: The response time zone always matches the server time zone, regardless of the time zone offset in the request.

targetCycleEndDateISOString

Indicates the end date and time of the target in ISO 8601 format, returned in the server time zone.

EU server example
2025-12-16T14:30:45Z → 16 December 2025, 14:30:45 (UTC)

India server example
2025-12-16T14:30:45+05:30 → 16 December 2025, 14:30:45 (IST)

Note: The response time zone always matches the server time zone, regardless of the time zone offset in the request.

frequencyTypeStringThe frequency of each cycle in which the user has to achieve the target value.
trackingTypeEnumThe type of tracking the milestone is created for.
targetsObjectDetails on creation of the target.
-idBooleanUnique ID of the target.
-attributionObjectDetails on the creation and update details of the target.
-- createdOnStringDate the target was created in ISO 8601 YYYY-MM-DDTHH:mm:ss.SSS format.
Note: This field will be deprecated in the future and is being replaced by createdOnISO.
-- createdOnISOString

Indicates the creation date and time of the target in ISO 8601 format, returned in the server time zone.

EU server example
2025-12-16T14:30:45Z → 16 December 2025, 14:30:45 (UTC)

India server example
2025-12-16T14:30:45+05:30 → 16 December 2025, 14:30:45 (IST)

Note: The response time zone always matches the server time zone, regardless of the time zone offset in the request.

-- lastUpdatedOnStringDate the target was last updated in ISO 8601 YYYY-MM-DDTHH:mm:ss.SSS format.
Note: This field will be deprecated in the future and is being replaced by lastUpdatedOnISO.
-- lastUpdatedOnISOString

Indicates the last updated date and time of the target in ISO 8601 format, returned in the server time zone.

EU server example
2025-12-16T14:30:45Z → 16 December 2025, 14:30:45 (UTC)

India server example
2025-12-16T14:30:45+05:30 → 16 December 2025, 14:30:45 (IST)

Note: The response time zone always matches the server time zone, regardless of the time zone offset in the request.

-- lastUpdatedByObjectDetails on updates to the target.
--- idIntegerUnique ID of the user who last modified the target.
--- codeIntegerCode of the user who last modified the target.
-- descriptionStringDescription of the user who last modified the target.
--- nameStringName of the user who last modified the target.
--- typeStringType of user who last modified the target.
-- createdByObjectDetails on creation of the target.
--- idIntegerUnique ID of the user who created the target .
--- codeIntegerCode of the user who created the target.
--- descriptionStringDescription of the user who created the target.
--- nameStringName of the user who created the target.
--- typeStringType of user who created the target.
---nameStringUnique name for the target.
--targetTypeStringThe type of target

Supported values:
ALL: Tracks points that a customer earns across a loyalty program and from a loyalty promotion.
REGULAR: Track the points that a customer earns across a loyalty program. Points earned from promotions are excluded.
PROMOTION: Tracks the points that a customer earns from a loyalty promotion.
--targetEntityEnumThe KPI on which the target is tracked.
For the transactional KPIs, the supported value for this are TRANSACTION and LINEITEM.
For the Behavioural or EMF events, the supported value is EVENT.
For the tracking based on rewards such as points, the supported value is REWARDS.
--eventNameStringName of the event that triggers the target.
--targetGroupIdIntegerUnique ID of the target group associated with the target.
--descriptionStringDescription of the target.
--activeBooleanCurrent active status of the target. If true, the target is currently active, else the target is inactive.
-- expressionBooleanIndicates if the target has an expression for evaluation.
-- expressionJsonStringA JSON expression that specifies the conditions required to achieve the target.
-- filtersObjectDetails on the scope filters active on the target.
-- enrolmentMethodEnumThe method of enrolment for the target. Supported values: TRANSACTION, IMPORT.
-- defaultValuesObjectDetails on the default values for the target.
--- defaultValueFloatA default value used in the target evaluation.
-- targetPeriodDefaultValuesMapObjectDetails on the default values for the target period.
-- extendedFieldInfoObjectDetails on extended field information for the target group.
-- programIdIntegerUnique ID of the loyalty program
-- alternateCurrencyIdentifierStringUnique ID of the alternate currency.
leaderboardEnabledBooleanIndicates if the leaderboard feature is enabled.
userCreatedBooleanIndicates if the target is a user-created target.
timezoneNameStringIANA time zone name for
the target group; defaults
to system time zone when
omitted.
errorsnull or ObjectContains error details if any occurred during the API request.
warningsnull or ObjectContains warning details if any occurred during the API request.

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
310033Invalid target entity and target type combination
310146Invalid program id
310094Target rule metadata is required in case of EXTENDED_FIELD/ALTERNATE_CURRENCIES target type
310147Invalid or null Alternate Currency Identifier for target rule
Body Params
boolean
string
string
required
int32
string
enum
required
Allowed:
string
enum
required
Allowed:
int32
required
string
enum
required
Allowed:
int32
required
int32
required
string
required
string
enum
Allowed:
string
required
string
required
boolean
string
string
enum
required
Defaults to ALTERNATE_CURRENCIES
Allowed:
string
enum
Allowed:
string
enum
required
Allowed:
float
string
required
int32
required
Responses

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json