Enrol a Customer to Loyalty Promotion

Enrol & issue promotions, also referred to as LOYALTY_EARNING in the backend, require customers to opt-in or be enrolled before receiving the promotion for a specific activity. Upon meeting the requirements outlined in the issued promotion, customers earn the associated benefits. This API is used to enrol or issue a promotion (associated with the Enrol&Issue promotion type) to customers.

🚧

Note

This API is an old API and it is recommended to use the new Enrol API for enrolling a single or multiple customers to a promotion.

API endpoint example

https://eucrm.cc.capillarytech.com/v2/promotion/issue?identifierName=mobile&identifierValue=18767431754&source=INSTORE

Prerequisites

  • Authentication - Basic or OAuth authentication
  • Access group resource - Write access to customer group resource
  • The promotion type should be LOYALTY_EARNING

Resource information

URI/v2/promotion/issue
HTTP methodPOST
Pagination supported?NA
Rate limitNA
Batch supportNA

Query Parameters

Parameter
(Parameters marked with * are mandatory)
Data typeDescription
identifierName*EnumIdentifier type to identify the customer. Values allowed: email, mobile, externalId, id
identifierValue*StringValue of the identifier.
source*EnumSpecifies the source from where customer details are retrieved. Values allowed: FACEBOOK, WEB_ENGAGE, INSTORE, MARTJACK, TMALL, TAOBAO, JD, ECOMMERCE, WEBSITE, LINE, MOBILE_APP
typeEnumType of entity. Values allowed: CUSTOMER.
accountIdStringUnique account ID of the customer.

Body Parameters

Parameter
(Parameters marked with * are mandatory)
Data typeDescription
programId*LongUnique ID for the program associated with the promotion.
promotionId*LongUnique ID for the promotion into which enrol or issue occurs.
{
    "programId": 469,
    "promotionId": 65777
}

Response parameters

Parameter NameData TypeDescription
warningsObjectA list of warnings, if any, in the response.
errorsObjectA list of errors, if any, in the response.
sideEffectsObjectResultant object generated on running the API. This includes details related to the promotion and program on which promotion issued.
- programIdLongUnique ID for the program associated with the promotion.
- issualIdIntegerInternal ID generated when a customer is enrolled to a promotion.
- promotionIdLongUnique ID for the promotion into which enrol or issue occurs.
- typeStringThe value of the field is Points promotion. This parameter is not valid.
{
    "warnings": [],
    "errors": [],
    "sideEffects": [
        {
            "programId": 469,
            "issualId": 3,
            "promotionId": 57099,
            "type": "Points promotion"
        }
    ]
}
{
    "warnings": [
        {
            "status": false,
            "code": 8890,
            "message": "promotion not issued due to config issues or customer exhausted limits"
        }
    ],
    "errors": [],
    "sideEffects": []
}
{
    "warnings": [],
    "errors": [
        {
            "status": false,
            "message": "invalid programId passed",
            "code": 1101
        }
    ]
}
{
    "warnings": [],
    "errors": [
        {
            "status": false,
            "message": "promotion id passed is invalid",
            "code": 8874
        }
    ]
}
{
    "warnings": [],
    "errors": [
        {
            "message": "identifierName, identifierValue, source can not be empty",
            "code": 11013,
            "status": false
        }
    ]
}
{
    "warnings": [],
    "errors": [
        {
            "status": false,
            "code": 8015,
            "message": "Customer not found for the given identifiers"
        }
    ]
}

API-specific error codes

Error CodeDescription
11013Mandatory parameters identifierName, identifierValue, or source missing.
1212Entity type invalid.
8874Promotion ID is invalid.
1101Program ID is invalid.
Language
Authorization
Basic
base64
:
URL
Click Try It! to start a request and see the response here!