Enrol or issue loyalty promotion

Enrol or issue promotion to a specified customer based on the promotion type.

This API is used to enrol or issue a promotion to a customer based on the promotion type. This API operates differently depending on the type of promotion being processed.

If the promotion type is,

  • Direct Issue - The API issues the promotion to the customer.
  • Enrol and Issue - The API enrols the customer to the promotion, but does not issue.

The API adjusts its behaviour based on the promotion type being handled.

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

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, WECHAT, INSTORE, MARTJACK, TMALL, TAOBAO, JD, ECOMMERCE, WEBSITE, LINE, MOBILE_APP
typeEnumType of entity. Values allowed: CUSTOMER, USERGROUP2.
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.
curl --location 'https://eucrm.cc.capillarytech.com/v2/promotion/issue?identifierName=mobile&identifierValue=18767431754&source=INSTORE' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic XZ5TZjM2M0Y2NmY2OWZmZmR==' \
--header 'Cookie: CS=17999bae3c0f41269ea0947f75896090' \
--data '{
    "programId": 469,
    "promotionId": 57099
}'
curl --location 'https://eucrm.cc.capillarytech.com/v2/promotion/issue?identifierName=externalId&identifierValue=000003873354&source=INSTORE' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YTEyThMWNlYzdiNmY2g==' \
--header 'Cookie: CS=17999bae3c0f41269ea0947f75896090' \
--data '{
    "programId": 469,
    "promotionId": 57099
}'
curl --location 'https://eucrm.cc.capillarytech.com/v2/promotion/issue?identifierName=email&identifierValue=test%40capillarytech.com&source=INSTORE' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic yMzpjM2MMWNlYzdiNmY2==' \
--header 'Cookie: CS=17999bae3c0f41269ea0947f75896090' \
--data '{
    "programId": 469,
    "promotionId": 57099
}'
curl --location 'https://eucrm.cc.capillarytech.com/v2/promotion/issue?identifierName=id&identifierValue=555380204&source=INSTORE&type=CUSTOMER' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic TEyMzpkNGFiY2UxNTZjM2Yzg==' \
--header 'Cookie: CS=17999bae3c0f41269ea0947f75896090' \
--data '{
    "programId": 469,
    "promotionId": 57099
}'

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 promotion is issued.
- 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": [],
    "errors": [],
    "sideEffects": [
        {
            "programId": 469,
            "issualId": 3,
            "promotionId": 57099,
            "type": "Points promotion"
        }
    ]
}
{
    "warnings": [],
    "errors": [],
    "sideEffects": [
        {
            "programId": 469,
            "issualId": 3,
            "promotionId": 57099,
            "type": "Points promotion"
        }
    ]
}
{
    "warnings": [],
    "errors": [],
    "sideEffects": [
        {
            "programId": 469,
            "issualId": 3,
            "promotionId": 57099,
            "type": "Points promotion"
        }
    ]
}

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!