Enroll/Re-Enroll a Customer to a Milestone or Streak

This API enrolls or re-enrolls users into a milestone or streak in a connected organisation.

Enroll: The user is enrolling into a milestone or streak for the first time.

Re-enroll: The user was previously enrolled in a streak or milestone but is currently unenrolled. They now want to re-enroll and participate again.

Milestones and Streaks

A Milestone in Loyalty+ is a feature that lets brands set specific targets for their customers. When customers reach these defined targets, they are rewarded.

For more information refer to the documentation on Milestones.

A Streak in Loyalty+ refers to a series of consecutive customer actions or engagements. When customers complete a series of consecutive actions, they are rewarded.

For more information refer to the documentation on Streaks.

👍

Note

For detailed information about our APIs and for hands-on testing, refer to the documentation in API overview and step-by-step guide on making your first API call.

Prerequisites

  • Authentication: Basic or OAuth authentication
  • Default access group

Resource information

URI/targetGroups/{targetGroupId}/targets/{targetId}/enroll
HTTP MethodPOST
PaginationNo
Batch supportNo
Rate limit informationNone

API Endpoint Example

https://eucrm.cc.capillarytech.com/v3.1/targetGroups/{targetGroupId}/targets/{targetId}/enroll

Headers

HeaderDescription
DATA-SCOPE-ORGList of Organization IDs
DATA-SCOPEScopes define what data can be accessed using the API. You can use scopes to control access to data from a parent or child organization. Defining a scope ensures that the response contains only data from the respective organization.

Supported headers: SELF and OTHER.

Refer to connected orgs data scopes for more information.

Request Path Parameters

ParameterData typeDescription
targetGroupId*IntegerThe ID of the target group associated with the item. A target group is the primary entity under which individual targets can be created.
targetId*IntegerThe ID of the target. A target is a set of conditions or rules that need to be met to achieve a specific goal.

Request Body Parameters

ParameterData TypeDescription
customerId*IntegerThe unique identifier of the customer.
periodName*StringThe name of the period/cycle. The is used to identify to which period/cycle, the customer should be enrolled/re-enrolled in the case of milestones.
Note: For Streaks, It is not mandatory to enter the period name as the period is not applicable for streaks.
initialBalanceIntegerWhen a value is entered in this field, the user will enroll or re-enroll in the milestone's cycle or period, with the initial balance set to the user's target achieved value.

For re-enrollment, if this field is set to "NULL," the user's target achieved value will resume from the value at which the user last unenrolled.

This field does not apply to streaks and is applicable only to milestones.
resetStreakStatusbooleanThis field is only for streaks. If this field is set to false, the user will continue from the streak value before unenrolling. If this field is marked as true during re-enrollment, the streak value will be reset, effectively starting fresh.
[
  {       
       "customerId":345651201,  
       "periodName":"PERIOD_G_29463_1",
       "initialBalance":100,
  		 "resetStreakStatus":false
  }
]

// Maximum number records in the payload should be 1. For example, if there is a milestone with 10
// cycles & want to enroll a user, then this API needs to be called 10 times as this is for each cycle.

// In the case of streak, no need of period name & user will be enrolled into all the periods.

Response Parameters

ParameterData TypeDescription
dataIntegerThe unique identifier of the customer.
errorsArrayErrors during the API call, if any.
warningsArrayWarnings during the API call, if any.
{
    "data": 345651201,
    "errors": null,
    "warnings": null
}
{
    "data": null,
    "errors": [
      {
        "code": 310141,
        "message": 'Datascope 'ALL' is not supported for this 'API'
      }
      ],
    "warnings": null
}

API-Specific Errors

Error codeDescription
310119User already enrolled for the target.
310011Invalid userId. Check if the customerId is valid.
310019Target period not found. Check the target period ID to troubleshoot this error.
310017Target group not found or deactivated. Check the target group ID to troubleshoot this error.
310018Target rule not found. Check the target rule ID to troubleshoot this error.
300004Invalid input.
310141Datascope 'ALL' is not supported for this 'API
310144Connected Orgs not set properly in Headers.

- Check whether the target organisation is a connected organisation.
- Check the API endpoint.
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!