Get Promotion Data

Retrieve promotion data of a specific customer.

This API retrieves the promotion data of a specified customer. It provides detailed information on the various promotions the customer is associated with within a loyalty program. This includes the types of promotions, point and redemption restriction details, start and end dates, and activation status.

By default, the types of promotions are not available for all the orgs. This needs to be enabled separately. For more details on the types of promotions, refer Types of promotions.

API endpoint example

https://eu.api.capillarytech.com/api_gateway/loyalty/v1/programs/1000/promotionsV2?limit=10&offset=0&sourceType=USER_CREATED

Prerequisites

  • Authentication: Basic or OAuth credentials
  • Access group resource: Read access to customer group resource

Resource information

URI
HTTP MethodGET
PaginationYes
Batch supportNo
Rate limit informationNA

Path parameters


Parameter NameData
Type
Description
programIdStringUnique ID of the program

Query parameters

Parameter NameData TypeDescription
limit*StringNumber of results that need to be displayed. The values from zero to a maximum of 100 are supported.
sourceType*ENUMFilter promotion data based on its source type. Supported values are UI, IMPORT, GOODWILL, CAMPAIGN, POINTS_TRANSFER, IMPORT_API, PROMOTION_API, POINTS_CONTRIBUTION_TO_GROUP,MANUAL_POINTS_ADJUSTMENT, BADGES, USER_CREATED

Use the filter USER_CREATED to filter the promotions created for User Created Challenges (UCC)
offset*StringStart index for data retrieval. This value should not be negative.
promotionIdIntegerThe unique ID of the promotion.
includeInactivePromotionsBooleanInclude promotions that are currently inactive.
By default this is set to false.
startRuleIdentifierIntegerThe unique identifier of the start rule.
eventNameStringSet the event name to filter based on an event.
curl --location 'https://eu.api.capillarytech.com/api_gateway/loyalty/v1/programs/2822/userCreatedPromotions?limit=10&offset=0&sourceType=USER_CREATED' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGlsbG5pcnZhahahbmE6MjAyY2I5NjJhYzU5MDc1Yjk2NGIwNzE1MmQyMzRiNzA=' \
--data ''

Response body

{
    "pageDetails": {
        "pageNumber": 0,
        "pageSize": 2,
        "totalEntries": 169,
        "pageCount": 85
    },
    "customerId": 555380204,
    "promotions": [
        {
            "promotionId": 67248,
            "promotionName": "100 Points for 3+ Transactions5",
            "programId": 469,
            "startDate": "2024-10-31T18:30:00.000Z",
            "endDate": "2025-01-31T18:30:00.000Z",
            "identifier": "billslayer5",
            "description": "Earn 100 points for completing more than 3 transactions",
            "active": true,
            "eventName": "TargetCompleted",
            "limits": {
                "maxPointsPerEvent": "100",
                "pointsPerCustomer": "100",
                "numberOFTimesPerCustomer": 1,
                "totalPointsInPromotion": "0"
            },
            "customerUsage": {
                "currentPointsPerCustomer": "0",
                "currentNumberOfTimesPerCustomer": 0,
                "currentTotalPointsInPromotion": "0"
            },
            "pointsOfferType": "GENERIC",
            "promotionRestriction": {
                "issualRestrictions": [],
                "earnRestrictions": [],
                "redemptionRestrictions": [
                    {
                        "kpi": "NUMBER_OF_TIMES",
                        "maxLimit": "1",
                        "currentCustomerUsage": "0",
                        "limitOn": "CUSTOMER",
                        "type": "NON_PERIOD_BASED"
                    },
                    {
                        "kpi": "NUMBER_OF_POINTS",
                        "maxLimit": "100",
                        "limitOn": "EVENT",
                        "type": "NON_PERIOD_BASED"
                    },
                    {
                        "kpi": "NUMBER_OF_POINTS",
                        "maxLimit": "100",
                        "currentCustomerUsage": "0",
                        "limitOn": "CUSTOMER",
                        "type": "NON_PERIOD_BASED"
                    },
                    {
                        "kpi": "NUMBER_OF_REDEMPTIONS_PER_EARN",
                        "maxLimit": "100",
                        "currentCustomerUsage": "0",
                        "limitOn": "CUSTOMER",
                        "type": "NON_PERIOD_BASED"
                    }
                ]
            }
        },
        {
            "promotionId": 67247,
            "promotionName": "duplicate_test_5",
            "programId": 469,
            "startDate": "2023-12-30T18:30:00.000Z",
            "endDate": "2024-12-30T18:30:00.000Z",
            "identifier": "e823c904-34bf-4b8a-8124-16085183177f",
            "description": "Welcome offer for first-time customers with specific conditions",
            "active": true,
            "eventName": "TransactionAdd",
            "promotionMetadata": [
                {
                    "key": "preferred language",
                    "value": "en",
                    "brandDefined": true
                },
                {
                    "key": "testt",
                    "value": "vall",
                    "brandDefined": true
                }
            ],
            "limits": {
                "maxPointsPerEvent": "150",
                "pointsPerCustomer": "0",
                "numberOFTimesPerCustomer": 0,
                "totalPointsInPromotion": "0"
            },
            "customerUsage": {
                "currentPointsPerCustomer": "0",
                "currentNumberOfTimesPerCustomer": 0,
                "currentTotalPointsInPromotion": "0"
            },
            "pointsOfferType": "GENERIC",
            "promotionRestriction": {
                "issualRestrictions": [],
                "earnRestrictions": [],
                "redemptionRestrictions": [
                    {
                        "kpi": "NUMBER_OF_POINTS",
                        "maxLimit": "150",
                        "limitOn": "EVENT",
                        "type": "NON_PERIOD_BASED"
                    },
                    {
                        "kpi": "NUMBER_OF_TIMES",
                        "maxLimit": "20",
                        "currentCustomerUsage": "0",
                        "limitOn": "CUSTOMER",
                        "type": "PERIOD_BASED",
                        "periodType": "MOVING_WINDOW",
                        "periodUnit": "MONTHLY"
                    },
                    {
                        "kpi": "NUMBER_OF_POINTS",
                        "maxLimit": "200",
                        "currentCustomerUsage": "0",
                        "limitOn": "CUSTOMER",
                        "type": "PERIOD_BASED",
                        "periodType": "MOVING_WINDOW",
                        "periodUnit": "DAILY"
                    },
                    {
                        "kpi": "NUMBER_OF_POINTS",
                        "maxLimit": "1000",
                        "currentCustomerUsage": "0",
                        "limitOn": "PROMOTION",
                        "type": "PERIOD_BASED",
                        "periodType": "MOVING_WINDOW",
                        "periodUnit": "WEEKLY"
                    },
                    {
                        "kpi": "NUMBER_OF_REDEMPTIONS_PER_EARN",
                        "maxLimit": "100",
                        "currentCustomerUsage": "0",
                        "limitOn": "CUSTOMER",
                        "type": "NON_PERIOD_BASED"
                    }
                ]
            }
        }
    ],
    "warnings": []
}

Response parameters

FieldData TypeDescription
statusObjectContains the status of the API response.
- codeIntegerHTTP status code.
- messageStringDescribes the result of the request (e.g., "success").
validationErrorsObject or nullIf validation fails, errors are displayed here.
dataArray of ObjectsContains promotion data.
- idIntegerThe unique identifier for the promotion.
- nameStringThe name of the promotion.
- descriptionStringDescription of the promotion.
- promotionStatusStringThe current status of the promotion (e.g., "LIVE").
- lastUpdateDateString (ISO 8601)Timestamp of the last update made to the promotion.
- lastUpdatedByIntegerID of the user who last updated the promotion.
- rulesetInfosArray of ObjectsA list of rulesets associated with the promotion.
-- idIntegerThe unique identifier for the ruleset.
-- orgNameStringName of the organization to which the ruleset belongs.
-- contextIDIntegerContext ID in which the ruleset applies (e.g., program).
-- orgIDIntegerOrganization ID to which the ruleset belongs.
-- contextTypeStringThe type of context the ruleset belongs to (e.g., "program").
-- rulesArray of ObjectsA list of rules within the ruleset.
--- idIntegerUnique identifier for the rule.
--- expStringExpression used by the rule.
--- expJSONStringJSON representation of the rule expression.
--- jsonTypeStringThe JSON node type used in the rule.
--- isActiveBooleanIndicates if the rule is active.
--- priorityIntegerPriority level of the rule (lower numbers indicate higher priority).
--- startDateLongStart date of the rule in epoch time.
--- endDateLongEnd date of the rule in epoch time.
--- createdOnLongDate the rule was created, in epoch time.
--- caseToActionsObjectActions tied to the rule when certain conditions are met (in this case, "true").
---- trueArray of ObjectsActions to be executed when the expression evaluates to true.
----- idIntegerID of the action to be executed.
----- actionNameStringName of the action (e.g., "AWARD_TARGET_POINTS_ACTION").
----- actionClassStringJava class that implements the action.
----- mandatoryPropertiesValuesObjectKey-value pairs defining mandatory properties for the action.
------ (key-value pairs)Varies (String, Integer)Specific mandatory properties and their values.
----- mandatoryComplexPropertiesValuesObjectHolds any mandatory complex properties for the action (if applicable).
----- descriptionString or nullDescription of the action (if applicable).
--- ruleScopeStringScope of the rule (e.g., "SERVER").
--- createdByIntegerID of the user who created the rule.
--- modifiedByIntegerID of the user who last modified the rule.
--- modifiedOnLongDate the rule was last modified, in epoch time.
--- nameStringName of the rule.
--- descriptionStringDescription of the rule.
--- ruleSetIdIntegerID of the ruleset to which the rule belongs.
--- updatedViaNewUIBooleanIndicates if the rule was updated via the new UI.
- programNameStringName of the program associated with the promotion.
- programIdIntegerUnique identifier for the program.
- startDateString (ISO 8601)Start date of the promotion in ISO format.
- endDateString (ISO 8601)End date of the promotion in ISO format.
- identifierStringA unique identifier for the promotion.
- isActiveBooleanIndicates if the promotion is active.
- eventNameStringThe name of the event that triggers the promotion (e.g., "TARGETCOMPLETED").
- allocatePointsOnStringDefines when points should be allocated (e.g., "BILL").
- limitsObjectDefines various limits related to the promotion.
-- pointsPerCustomerIntegerLimit on the number of points a customer can earn through this promotion (-1 indicates no limit).
-- numberOfTimesPerCustomerIntegerLimit on the number of times a customer can participate in the promotion (-1 indicates no limit).
-- totalPointsInPromotionIntegerTotal number of points that can be awarded in this promotion (-1 indicates no limit).
-- totalPointsPerEventLimitIntegerLimit on the number of points that can be earned per event (-1 indicates no limit).
- useProportionsBooleanIndicates if points should be allocated based on proportions.
- pointsOfferTypeStringType of points offer (e.g., "LOYALTY").
- promotionRestrictionsObjectDefines restrictions for the promotion.
-- restrictionsObjectSpecific restrictions such as redemption or earning limits.
--- redemptionRestrictionsArray of ObjectsRestrictions on how many times a customer can redeem the promotion.
---- nameStringName of the redemption restriction.
---- valueIntegerValue of the redemption restriction.
---- typeStringType of the redemption restriction (e.g., "PERIOD_BASED").
---- periodTypeString or nullDefines the period type for period-based restrictions (e.g., "WEEKLY").
---- periodUnitString or nullDefines the unit for the period (e.g., "MOVING_WINDOW").
--- issualRestrictionsArray of ObjectsRestrictions on how many times the promotion can be issued to a customer.
--- earnRestrictionsArray of ObjectsRestrictions on how many times the promotion can be earned by a customer.
--- expiryRestrictionsArray of ObjectsDefines rules for when points or rewards will expire.
scopeObject or nullScope of the promotion restrictions.
isStackableBooleanDefines if this promotion can be stacked with other promotions.
isConsideredForRankingBooleanIndicates if this promotion should be considered for ranking purposes.
loyaltyEarningTypeStringDefines the type of loyalty earning (e.g., "ISSUE_AND_EARN").
isExclusiveBooleanDefines if the promotion is exclusive.
isAlwaysApplyBooleanIndicates if the promotion should always be applied.
targetGroupIdsArray of IntegersA list of target group IDs associated with the promotion.
targetRuleIdsArray of IntegersA list of target rule IDs associated with the promotion.
pageDetailsObjectContains pagination information.
- pageNumberIntegerCurrent page number in the paginated result.
- pageSizeIntegerNumber of items displayed per page.
- totalEntriesIntegerTotal number of records available for pagination.

API specific error codes

ErrorDescription
8013Identifier name missing or incorrect.
8015Identifier value missing or incorrect.
8003Source is missing or incorrect.
4086Limit / offset/ sourceType is not passed
4055Limit passed is greater than 100
4027promotionId or startRuleIdentifier passed doesn't exist
4083Incorrect event name is passed
4082eventName is null / empty
4084sourceType is empty / null
4085Wrong sourceType enum is passed
Language
Authorization
Basic
base64
:
URL
Click Try It! to start a request and see the response here!