Edit streak

A streak refers to a consecutive series of actions or engagements by a customer, based on which loyalty benefits are provided.

Only the target-related part of the streak can be edited once the streak is created. The target-group-related section and the period-related section are not editable once created. So, to edit a create, first the target-group ID & the target ID needs to be figured out.

Then, by using the update target API, we can edit the following components of the streak.

  1. expression
  2. expressionJson
  3. filters (scope filters & rule filters)
  4. defaultValues

👍

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/OAuth authentication
  • Default access group

Resource information

URIv3/targetGroups\{groupId\}/targets\{targetIdd\}
HTTP methodPOST
PaginationNA
Rate limitNA
Batch supportNA

API endpoint example

https://eucrm.cc.capillarytech.com/v3/targetGroups\{groupId\}/targets\{targetIdd\}


{
    "data": {
        "id": 32,
        "name": "TGF19",
        "fromDate": "2021-05-27",
        "toDate": "2021-05-28",
        "active": true,
        "preferredTillId": 0,
        "periods": [
            {
                "id": 74,
                "attribution": {
                    "createdOn": "2022-03-28T13:28:32.602+0000",
                    "lastUpdatedOn": "2022-03-28T13:28:32.602+0000",
                    "lastUpdatedBy": {
                        "id": 75040399,
                        "code": "bukl.till",
                        "description": "",
                        "name": "bukl.till",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 75040399,
                        "code": "bukl.till",
                        "description": "",
                        "name": "bukl.till",
                        "type": "TILL"
                    }
                },
                "startDate": "2022-03-29",
                "endDate": "2022-05-29",
                "refCode": "string",
                "periodStatus": "NOT_STARTED",
                "targetGroupId": 32,
                "description": "string",
                "active": true
            }
        ],
        "activePeriod": {
            "startDate": "2022-03-28",
            "endDate": "2022-04-29",
            "refCode": "gdf123",
            "periodStatus": "RUNNING",
            "description": "Samplr description",
            "active": true
        },
        "totalPeriods": 0,
        "description": "TGF19",
        "recurringCycles": 2,
        "frequency": 5,
        "targetCycleStartDate": "2021-05-28T08:41:00.529Z"
    },
    "errors": null
}

Request Body Parameters

Parameter NameData TypeDescription
activeBooleanIndicates if the tracking is active or not.
descriptionStringA brief description of the target group or period.
nameStringThe name identifier for the target group or target.

Character limit: 200.
preferredTillIdNumberIdentifier for a preferred till.
trackingTypeStringType of tracking. Supported values:

- Default
- Unified
- Streak
- Capping
targetEvaluationTypeStringTarget evaluation strategy. Supported values:
- FIXED_CALENDAR_WINDOW
- CYCLIC_WINDOW
- PERIOD_AGNOSTIC_WINDOW
totalPeriodsNumberTotal number of periods to evaluate tracking.
frequencyTypeEnumFrequency of each cycle. Supported: Monthly, Quarterly, Half-yearly, Yearly, Weekly.
frequencyNumberFrequency count relevant to the frequencyType.
recurringCyclesNumberNumber of cycles for recurring tracking.
periodsObject[]Array of period objects, each with:
- active (Boolean)
- description (String)
- endDate (Date Time)
- periodStatus (String)
- refCode (String)
- startDate (Date Time)
targetsObject[]Array of target objects, each with:
- active (Boolean)
- description (String)
- expression* (String)
- expressionJson* (String)
- filters* (Object)
- entityType* (Enum: STORE, ZONE, CONCEPT)
- entityIds* (Array)
- name (String)
- targetEntity (Enum: TRANSACTION, LINEITEM, EVENT, REWARDS)
- eventName (String)
- targetType (Enum: QUANTITY, SALES, COUNT, VISIT, GROSS_SALES, REGULAR_POINTS, PROMOTIONAL_POINTS, ALL_POINTS, EXTENDED_FIELD, EVENT_ATTRIBUTE)
extendedFieldInfoObjectOnly for targetType = EVENT_ATTRIBUTE. Includes:
- name (String)
- aggregateFunction (Enum: SUM)
defaultValuesObject[]Array of objects with:
- defaultValue* (Integer)
streaksObject[]Array of streak objects with:
- name (String)
- targetCountOfSequence (Integer)

Note: Parameters marked with * are required.

Response parameters

FieldDatatypeDescription
idintegerUnique identifier for the group.
namestringName of the group.
activebooleanIndicates if the group is active.
preferredTillIdintegerPreferred till ID, indicating no specific preference with 0.
totalPeriodsintegerTotal number of periods specified.
descriptionstringDescription of the /roup.
targetEvaluationTypestringType of target evaluation, e.g., "FIXED_CALENDAR_WINDOW".
targetCycleStartDatestring (date-time)Start date and time for the target cycle.
targetCycleEndDatestring (date-time)End date and time for the target cycle (if applicable).
frequencyTypestringFrequency type, e.g., "CUSTOM" (if applicable).
trackingTypestringType of tracking, e.g., "STREAKS" (if applicable).
fromDatestring (date)Start date for the setting (if applicable).
toDatestring (date)End date for the setting (if applicable).
recurringCyclesintegerNumber of recurring cycles specified (if applicable).
frequencyintegerFrequency value set for the setting (if applicable).
idintegerUnique identifier for each period.
startDatestring (date)Start date for each period.
endDatestring (date)End date for each period.
refCodestringReference code for each period.
periodStatusstringStatus of each period, e.g., "RUNNING", "NOT_STARTED".
targetGroupIdintegerIdentifier linking each period to a target group.
descriptionstringDescription of each period.
activebooleanIndicates if each period is active.
idintegerUnique identifier for each streak.
namestringName of each streak.
targetCountOfSequenceintegerTarget count of sequence for each streak.
idintegerUnique identifier for each target.
namestringName of each target.
targetTypestringType of each target, e.g., "SALES".
targetEntitystringType of entity targeted by each target, e.g.
eventNamestringName of the event associated with each target.
descriptionstringDescription of each target.
activebooleanIndicates if each target is active.
expressionstringExpression defining the criteria for each target.
expressionJsonstring (JSON)Target expression in JSON format for each target.
entityTypestringType of entity for the filter of each target.
entityIdsarray of integersIDs of entities for the filter of each target.
enrolmentMethodstringMethod of enrolment for each target.
defaultValuefloatSpecifies a default value for the target criteria for each target.
{
    "data": {
        "id": 32,
        "name": "TGF19",
        "fromDate": "2021-05-27",
        "toDate": "2021-05-28",
        "active": true,
        "preferredTillId": 0,
        "periods": [
            {
                "id": 74,
                "attribution": {
                    "createdOn": "2022-03-28T13:28:32.602+0000",
                    "lastUpdatedOn": "2022-03-28T13:28:32.602+0000",
                    "lastUpdatedBy": {
                        "id": 75040399,
                        "code": "bukl.till",
                        "description": "",
                        "name": "bukl.till",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 75040399,
                        "code": "bukl.till",
                        "description": "",
                        "name": "bukl.till",
                        "type": "TILL"
                    }
                },
                "startDate": "2022-03-29",
                "endDate": "2022-05-29",
                "refCode": "string",
                "periodStatus": "NOT_STARTED",
                "targetGroupId": 32,
                "description": "string",
                "active": true
            }
        ],
        "activePeriod": {
            "startDate": "2022-03-28",
            "endDate": "2022-04-29",
            "refCode": "gdf123",
            "periodStatus": "RUNNING",
            "description": "Samplr description",
            "active": true
        },
        "totalPeriods": 0,
        "description": "TGF19",
        "recurringCycles": 2,
        "frequency": 5,
        "targetCycleStartDate": "2021-05-28T08:41:00.529Z"
    },
    "errors": null
}
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!