Enrol Members to a Loyalty Promotion

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

The Enrol Unified Promotions API allows you to directly manage member participation for specific, targeted campaigns. You can use this endpoint to manually register members or process specific opt-in requests, giving you precise control over who enters exclusive or invite-only promotions.

Example request

curl --location 'https://{host}/v3/promotions/enrol' \
--header 'Content-Type: application/json' \
--data '{
    "requestId": "some-test-id",
    "action": "ENROL",
    "promotion": {
        "id": "68c3f64bbd0a8a0aa705c793",
        
        "promotionId": 1133590053
    },
    "customer": {
        "identifierName": "id",
        "identifierValue": "388369579",
        "source": "INSTORE"
    },
    "programId": 3334
}'
curl --location 'https://eu.api.capillarytech.com/v3/promotions/enrol' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic DllZTk=' \
--header 'Cookie: _cfuvid=w9k84Tbu9Ahlvel7gyPLGv9wCGWeqg-1763442378135-0.0.1.1-604800000' \
--data '{
    "requestId": "some-test-id",
    "action": "OPT_IN",
    "promotion": {
        "id": "690ddfe45d4a900e2157f1c2",
        
        "promotionId": 1133595380
    },
    "customer": {
        "identifierName": "id",
        "identifierValue": "388519295",
        "source": "INSTORE"
    },
    "programId": 973
}'

API Quick Reference

{{promotions_enrol}}
   └─ {{EnrollmentRequest}}
      ├─ {{requestId}} (string)
      ├─ {{action}} (string)
      ├─ {{programId}} (integer)
      ├─ {{promotion}}
      │   ├─ {{promoHexId}} (string)
      │   └─ {{promoIntId}} (integer)
      └─ {{customer}}
          ├─ {{identifierName}} (string)
          ├─ {{identifierValue}} (string)
          └─ {{source}} (string)
{{promotions_enrol}}
   └─ {{OptInRequest}}
      ├─ {{requestId}} (string)
      ├─ {{action}} (string)
      ├─ {{programId}} (integer)
      ├─ {{promotion}}
      │   ├─ {{promoHexId}} (string)
      │   └─ {{promoIntId}} (integer)
      └─ {{customer}}
          ├─ {{identifierName}} (string)
          ├─ {{identifierValue}} (string)
          └─ {{source}} (string)

Prerequisites

  • Authentication: Basic or OAuth authentication.
  • Default access group

Body parameters

FieldTypeRequiredDescription
requestIdStringOptionalSpecifies a unique identifier for the request.
actionStringYesSpecifies the action to perform. Enum: ENROL, OPT_IN
promotionObjectYesDefines the promotion to enrol into.
..idStringYesSpecifies the unique string ID of the promotion.
..promotionIdNumberYesSpecifies the unique numeric ID of the promotion.
customerObjectYesDefines the customer to be enrolled.
..identifierNameStringYesThe identifier type for the customer. Supported identifiers: id (customer ID), mobile, and email.
..identifierValueStringYesSpecifies the value for the customer identifier.
Supported values: mobile, email, userid, externalId.
..sourceStringOptionalThe source of the customer's registration.
Supported values: FACEBOOK, WEB_ENGAGE, INSTORE, MARTJACK, TMALL, TAOBAO, JD, ECOMMERCE, WEBSITE, LINE, ALL.
programIdNumberYesSpecifies the unique ID of the loyalty program.

Example response

{
    "data": {
        "requestId": "some-test-id",
        "action": "ENROL",
        "customer": {
            "identifierName": "id",
            "identifierValue": "388369579",
            "customerId": 388369579
        },
        "enrollmentStatus": {
            "promotion": {
                "id": "68c3f64bbd0a8a0aa705c793",
                "identifier": "enr-58",
                "programId": 3334,
                "enrollmentId": "25286",
                "optinId": "25910"
            },
            "milestone": {
                "status": "SUCCESS",
                "milestones": [
                    {
                        "targetGroupId": 97829,
                        "targetRuleId": 151359,
                        "initialBalance": 0
                    }
                ]
            }
        },
        "status": "SUCCESS"
    },
    "errors": null,
    "warnings": null
}

Response parameters

FieldTypeDescription
dataObjectDefines the result of the enrollment request.
..requestIdStringSpecifies the request identifier, echoed from the request.
..actionStringSpecifies the action performed, echoed from the request.
..customerObjectDefines the customer details, including the resolved ID.
....identifierNameStringSpecifies the identifier type used.
....identifierValueStringSpecifies the identifier value used.
....customerIdNumberSpecifies the resolved unique customer ID.
..enrollmentStatusObjectDefines the details of the enrolment.
....promotionObjectDefines the promotion that was enrolled.
......idStringSpecifies the unique string ID of the promotion.
......identifierStringSpecifies the promotion's short identifier.
......programIdNumberSpecifies the program ID.
......enrollmentIdStringSpecifies the unique ID for this enrollment.
......optinIdStringSpecifies the unique ID for the opt-in record.
....milestoneObjectDefines the status of any associated milestones.
......statusStringIndicates the status of the milestone processing.
......milestonesArrayDefines a list of milestone details.
........targetGroupIdNumberSpecifies the target group ID for the milestone.
........targetRuleIdNumberSpecifies the target rule ID for the milestone.
........initialBalanceNumberSpecifies the customer's initial balance of the specified target amount, which serves as the starting point for the milestone target calculation.
..statusStringIndicates the overall status of the enrolment.
errorsObjectDefines any errors that occurred. null on success.
warningsObjectDefines any warnings generated. null if no warnings.

Warning messages

Warning messageDescription
Unable to enroll in promotions. Customer already enrolled or limit reached.The customer is already enrolled in the promotion or the maximum enrollment limit has been reached.
failed to enrol into milestonesThe main promotion enrollment was successful, but the system failed to enroll the customer into specific milestones.
Unable to enroll in promotions. No Response from EMF service.The primary enrollment action succeeded, but the downstream service did not return the expected confirmation IDs.

Error codes

Error CodeDescription
310002action is required. Specify a valid action: ENROL, OPT_IN, or ENROL_MILESTONES.
310003promotion is required. Ensure the promotion object is provided in the request body.
310004customer is required. Ensure the customer object with identifiers is provided.
310005programId is required. Provide a valid loyalty program ID.
310006customer.identifierName is required. Use a valid identifier like mobile, email, or external_id.
310007customer.identifierValue is required. Provide the actual value for the customer identifier.
310008customer.source is required. Specify the source of the enrollment (e.g., INSTORE).
310009customer.milestone.targetRuleId is required. Provide the specific targetRuleId for milestone enrollment.
400Promotion not found or inactive. Use a valid promotionId/identifier and ensure it is in LIVE or UPCOMING status.
400Program not found. Verify that the programId provided exists in the system.
400Customer not found. Ensure the customer exists for the given organization and identifiers.
400GENERIC promotions are not eligible for enrollment. Enrollment is only supported for LOYALTY and LOYALTY_EARNING types.
400OPT_IN action not supported. The specified promotion type does not support the OPT_IN action (e.g., use ENROL instead).
500Unable to enrol in promotions. An internal error occurred in the promotion engine (EMF). Try again later.
Body Params

Request body

string
string
promotion
object
customer
object
integer
Response

Language
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json