post https://{host}/v2/promotion/issue
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 method | POST |
Pagination supported? | NA |
Rate limit | NA |
Batch support | NA |
Query Parameters
Parameter (Parameters marked with * are mandatory) | Data type | Description |
---|---|---|
identifierName* | Enum | Identifier type to identify the customer. Values allowed: email, mobile, externalId, id |
identifierValue* | String | Value of the identifier. |
source* | Enum | Specifies the source from where customer details are retrieved. Values allowed: FACEBOOK, WEB_ENGAGE, INSTORE, MARTJACK, TMALL, TAOBAO, JD, ECOMMERCE, WEBSITE, LINE, MOBILE_APP |
type | Enum | Type of entity. Values allowed: CUSTOMER. |
accountId | String | Unique account ID of the customer. |
Body Parameters
Parameter (Parameters marked with * are mandatory) | Data type | Description |
---|---|---|
programId* | Long | Unique ID for the program associated with the promotion. |
promotionId* | Long | Unique ID for the promotion into which enrol or issue occurs. |
{
"programId": 469,
"promotionId": 65777
}
Response parameters
Parameter Name | Data Type | Description |
---|---|---|
warnings | Object | A list of warnings, if any, in the response. |
errors | Object | A list of errors, if any, in the response. |
sideEffects | Object | Resultant object generated on running the API. This includes details related to the promotion and program on which promotion issued. |
- programId | Long | Unique ID for the program associated with the promotion. |
- issualId | Integer | Internal ID generated when a customer is enrolled to a promotion. |
- promotionId | Long | Unique ID for the promotion into which enrol or issue occurs. |
- type | String | The 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 Code | Description |
---|---|
11013 | Mandatory parameters identifierName, identifierValue, or source missing. |
1212 | Entity type invalid. |
8874 | Promotion ID is invalid. |
1101 | Program ID is invalid. |