CustomerId.
Payload fields keep the
Activity prefix, as in ActivityId, ActivityName and ActivityDrawType. The rename to Challenge applies to the event names only, not to the payload contract.Field reference
Field definitions match the challenge models of the Challenges endpoints. A Data streams request body carries these properties under camelCase names, such asactivityId for ActivityId, unless the subscription transforms the payload.
| Event | Data streams type | Raised when |
|---|---|---|
| Challenge Created | challenge.created | A challenge is created. |
| Challenge Updated | challenge.updated | A challenge is changed. |
| Challenge Published | challenge.published | A challenge is published. |
| Challenge Stopped | challenge.stopped | A challenge is stopped. |
| Challenge Deleted | challenge.deleted | A challenge is deleted. |
ProgressRules[].Tier is the tier whose target the rule sets. Rewards[].Tier is the tier a card must reach for the customer to get the reward. Tiers are numbered from 0, and a challenge without tiers has tier 0 only. A card reaches a tier when it meets every rule of that tier. Only a challenge with an Instant draw can have more than one tier.
RewardHighestTierOnly is true when the challenge is set to Issue only the highest tier in Lobyco Nexus. The customer then gets the rewards of one tier only, the highest the card reaches.
EventId joins the event’s name, the ActivityId and a time from the payload, written as yyyy-MM-ddTHH:mm:ss.fffffff. Each schema’s EventId description shows which time.
Schemas
A payload can carry properties that its schema does not list. Rely only on the listed ones: see Events.- Challenge Created
- Challenge Updated
- Challenge Published
- Challenge Stopped
- Challenge Deleted
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"$defs": {
"Reward": {
"type": ["object", "null"],
"properties": {
"Id": { "type": ["string", "null"] },
"OfferId": { "type": ["string", "null"] },
"Title": { "type": ["string", "null"] },
"DisplayTitle": { "type": ["string", "null"] },
"DisplayImageUrl": { "type": ["string", "null"] },
"TotalRewards": { "type": ["integer", "null"] },
"BonusAmount": { "type": ["number", "null"] },
"RewardType": { "type": "string", "enum": ["Coupon", "Bonus", "Custom", "LotteryTicket", "Multiple"] },
"Tier": { "type": "integer" },
"IssueStoreCoupon": { "type": "boolean" }
}
},
"ProgressRule": {
"type": ["object", "null"],
"properties": {
"Id": { "type": "integer" },
"ProgressCalculationType": { "type": "string", "enum": ["ProductCount", "PurchaseAmount", "StoreVisit", "PaymentMethod"] },
"UnitOfMeasure": { "type": ["string", "null"], "enum": ["Item", "Litre", "Gram", "Kilogram", null] },
"ApplicationType": { "type": "string", "enum": ["Include", "Exclude"] },
"RequiredProgress": { "type": ["number", "null"] },
"MinimumPurchaseAmount": { "type": ["number", "null"] },
"CooldownHours": { "type": ["integer", "null"] },
"PaymentTypes": { "type": ["array", "null"], "items": { "type": "string" } },
"Tier": { "type": "integer" },
"RuleIndex": { "type": "integer" },
"HasAffiliationFilter": { "type": "boolean" }
}
}
},
"properties": {
"UnifiedCampaignId": { "type": ["string", "null"] },
"ActivityId": { "type": "string" },
"ActivityName": { "type": "string" },
"HideInList": { "type": "boolean" },
"StartDate": { "type": "string", "format": "date-time" },
"EndDate": { "type": "string", "format": "date-time" },
"ActivationLimit": { "type": ["integer", "null"] },
"PickUpEndDate": { "type": ["string", "null"], "format": "date-time" },
"DaysForPickup": { "type": ["integer", "null"] },
"Status": { "type": "string", "enum": ["Draft", "Published"] },
"AdminName": { "type": ["string", "null"] },
"AdminId": { "type": ["string", "null"] },
"AccrualValue": { "type": ["number", "null"] },
"AudienceIds": { "type": ["array", "null"], "items": { "type": "string" } },
"IsSinglePurchase": { "type": "boolean" },
"RewardHighestTierOnly": { "type": "boolean" },
"ChainIds": { "type": ["array", "null"], "items": { "type": "string" } },
"StoreIds": { "type": ["array", "null"], "items": { "type": "string" } },
"Rewards": { "type": ["array", "null"], "items": { "$ref": "#/$defs/Reward" } },
"ProgressRules": { "type": ["array", "null"], "items": { "$ref": "#/$defs/ProgressRule" } },
"ActivationMode": { "type": "string", "enum": ["Manual", "Automatic"] },
"ProductFileUrl": { "type": "string" },
"CategoryFileUrl": { "type": "string" },
"IsTemplate": { "type": "boolean" },
"DrawType": { "type": "string", "enum": ["Instant", "GlobalLottery", "StoreLottery"] },
"Scope": { "type": "string", "enum": ["Individual", "Household"] },
"TimeUnit": { "type": "string", "enum": ["None", "Hour", "Day", "Week", "Month", "Year"] },
"TimeUnitBetweenCardsIssued": { "type": ["integer", "null"] },
"ValidForDays": { "type": ["integer", "null"] },
"SegmentationType": { "type": "string", "enum": ["Standard", "Triggered"] },
"DiscountFilterType": { "type": "string", "enum": ["IncludeAll", "ExcludeAll", "RecalculateBasedOnPrice"] },
"FundedBy": { "type": ["string", "null"] },
"IssueStoreCoupon": { "type": "boolean" },
"CheckoutTypes": { "type": ["array", "null"], "items": { "type": "string", "enum": ["Pos", "SelfCheckout", "ScanAndPay", "Online"] } },
"Tags": { "type": ["array", "null"], "items": { "type": "string" } },
"CreatedAt": { "type": "string", "format": "date-time" },
"EventId": { "type": "string", "description": "Composed as ActivityCreated-{ActivityId}-{CreatedAt}." }
}
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"$defs": {
"Reward": {
"type": ["object", "null"],
"properties": {
"Id": { "type": ["string", "null"] },
"OfferId": { "type": ["string", "null"] },
"Title": { "type": ["string", "null"] },
"DisplayTitle": { "type": ["string", "null"] },
"DisplayImageUrl": { "type": ["string", "null"] },
"TotalRewards": { "type": ["integer", "null"] },
"BonusAmount": { "type": ["number", "null"] },
"RewardType": { "type": "string", "enum": ["Coupon", "Bonus", "Custom", "LotteryTicket", "Multiple"] },
"Tier": { "type": "integer" },
"IssueStoreCoupon": { "type": "boolean" }
}
},
"ProgressRule": {
"type": ["object", "null"],
"properties": {
"Id": { "type": "integer" },
"ProgressCalculationType": { "type": "string", "enum": ["ProductCount", "PurchaseAmount", "StoreVisit", "PaymentMethod"] },
"UnitOfMeasure": { "type": ["string", "null"], "enum": ["Item", "Litre", "Gram", "Kilogram", null] },
"ApplicationType": { "type": "string", "enum": ["Include", "Exclude"] },
"RequiredProgress": { "type": ["number", "null"] },
"MinimumPurchaseAmount": { "type": ["number", "null"] },
"CooldownHours": { "type": ["integer", "null"] },
"PaymentTypes": { "type": ["array", "null"], "items": { "type": "string" } },
"Tier": { "type": "integer" },
"RuleIndex": { "type": "integer" },
"HasAffiliationFilter": { "type": "boolean" }
}
}
},
"properties": {
"UnifiedCampaignId": { "type": ["string", "null"] },
"ActivityId": { "type": "string" },
"ActivityName": { "type": "string" },
"HideInList": { "type": "boolean" },
"StartDate": { "type": "string", "format": "date-time" },
"EndDate": { "type": "string", "format": "date-time" },
"ActivationLimit": { "type": ["integer", "null"] },
"PickUpEndDate": { "type": ["string", "null"], "format": "date-time" },
"DaysForPickup": { "type": ["integer", "null"] },
"AccrualValue": { "type": ["number", "null"] },
"AudienceIds": { "type": ["array", "null"], "items": { "type": "string" } },
"IsSinglePurchase": { "type": "boolean" },
"RewardHighestTierOnly": { "type": "boolean" },
"ChainIds": { "type": ["array", "null"], "items": { "type": "string" } },
"StoreIds": { "type": ["array", "null"], "items": { "type": "string" } },
"Rewards": { "type": ["array", "null"], "items": { "$ref": "#/$defs/Reward" } },
"ProgressRules": { "type": ["array", "null"], "items": { "$ref": "#/$defs/ProgressRule" } },
"ActivationMode": { "type": "string", "enum": ["Manual", "Automatic"] },
"ProductFileUrl": { "type": "string" },
"CategoryFileUrl": { "type": "string" },
"IsTemplate": { "type": "boolean" },
"ModifiedBy": { "type": ["string", "null"] },
"DrawType": { "type": "string", "enum": ["Instant", "GlobalLottery", "StoreLottery"] },
"Scope": { "type": "string", "enum": ["Individual", "Household"] },
"TimeUnit": { "type": "string", "enum": ["None", "Hour", "Day", "Week", "Month", "Year"] },
"TimeUnitBetweenCardsIssued": { "type": ["integer", "null"] },
"ValidForDays": { "type": ["integer", "null"] },
"SegmentationType": { "type": "string", "enum": ["Standard", "Triggered"] },
"DiscountFilterType": { "type": "string", "enum": ["IncludeAll", "ExcludeAll", "RecalculateBasedOnPrice"] },
"FundedBy": { "type": ["string", "null"] },
"IssueStoreCoupon": { "type": "boolean" },
"CheckoutTypes": { "type": ["array", "null"], "items": { "type": "string", "enum": ["Pos", "SelfCheckout", "ScanAndPay", "Online"] } },
"Tags": { "type": ["array", "null"], "items": { "type": "string" } },
"UpdatedAt": { "type": "string", "format": "date-time" },
"EventId": { "type": "string", "description": "Composed as ActivityConfigurationUpdated-{ActivityId}-{UpdatedAt}." }
}
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ActivityId": { "type": "string" },
"UnifiedCampaignId": { "type": ["string", "null"] },
"PublishedAt": { "type": "string", "format": "date-time" },
"PublishedBy": { "type": ["string", "null"] },
"EventId": { "type": "string", "description": "Composed as ActivityPublished-{ActivityId}-{PublishedAt}." }
}
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ActivityId": { "type": "string" },
"UnifiedCampaignId": { "type": ["string", "null"] },
"StoppedBy": { "type": ["string", "null"] },
"StoppedAt": { "type": "string", "format": "date-time" },
"EventId": { "type": "string", "description": "Composed as ActivityStopped-{ActivityId}-{StoppedAt}." }
}
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ActivityId": { "type": "string" },
"UnifiedCampaignId": { "type": ["string", "null"] },
"DeletedBy": { "type": ["string", "null"] },
"DeletedAt": { "type": "string", "format": "date-time" },
"EventId": { "type": "string", "description": "Composed as ActivityDeleted-{ActivityId}-{DeletedAt}." }
}
}
API reference
Endpoint documentation: Challenges.Related
- Card events — a customer’s progress on the challenge.
- OutboundAPI connection — how these events reach an endpoint in your system.