The Loymax System allows exchanging event results with Smart Communications. This allows real-time updates on events in Smart Communications. Events are transmitted via the message broker RabbitMQ.
Smart Communications receives information via RabbitMQ about the following events related to a Loyalty Program (LP) Member’s activity:
| Event | Description | Routing keys | Example model sent to the queue |
|---|
| Registration started | The event is enqueued when a customer begins the LP registration process. | customer.registration.begin | { "eventCode":"OnBeginRegistration", "customerInfo":{ "customerId":121, "accountgroupId":"125", "customerCode":"aca52e1b-f08b-44a7-a77b-69ae0442ce7b", "mobileDeviceId":null, "identifierId":826, "applicationId":null } } |
| Registration completed | The event is enqueued when a customer successfully completes registration. | customer.registration.finish | { "eventCode":"OnEndRegistration", "customerInfo":{ "customerId":121, "accountgroupId":"125", "customerCode":"aca52e1b-f08b-44a7-a77b-69ae0442ce7b", "mobileDeviceId":null, "identifierId":826, "applicationId":null } } |
| Card linking includes three events: - Card replacement (ReplaceCard);
- Merging cards under one account (AttachCard);
- Attaching a new card (SetCard).
The linking method is passed in the linkCardType parameter. For card replacement, new card details are provided in the newCard parameter, and the replaced card’s information is in oldCard. In all other cases, oldCard is set to null. | customer.card.link | { "newCard":{ "cardId":6, "cardNumber":"1664669457201226", "cardState":"Activated", "activationDate":null, "cardType":"General", "cardCategory":"VIP", "barCode":"1664669457201226", "strip1":"1664669457201226", "strip2":"1664669457201226=1664669457201226", "strip3":"strip=1664669457201226", "isBlocked":false, "isDeleted":false }, "oldCard":{ "cardId":5, "cardNumber":"3515656237264935", "cardState":"Replaced", "activationDate":null, "cardType":"General", "cardCategory":"VIP", "barCode":"3515656237264935", "strip1":"3515656237264935", "strip2":"3515656237264935=3515656237264935", "strip3":"strip=3515656237264935", "isBlocked":true, "isDeleted":true }, "linkSource":"UserPortal", "linkCardType":"ReplaceCard", "customerInfo":{ "customerId":11, "accountgroupId":"15", "customerUid":"b95f240a-9185-4075-89e2-13216a34c177", "mobileDeviceId":null, "identifierId":45, "applicationId":1 }, "eventCode":"OnCardReplace" } |
| Merge under one account | The event is enqueued when one LP Member’s account is merged with another’s. | customer.profile.merge | { "fromCustomerInfo": { "customerId": 13, "accountgroupId": "18", "customerUid": "310408bf-ea5d-4d75-863a-0f46ffc159c8", "mobileDeviceId": null, "identifierId": null, "applicationId": null }, "toCustomerInfo": { "customerId": 11, "accountgroupId": "15", "customerUid": "e3be78c4-348d-4685-ae47-4bea13c1a6f6", "mobileDeviceId": null, "identifierId": null, "applicationId": null }, "eventCode": "MergeCustomersProfiles", } |
| Card activation | The event is enqueued when a card transitions from the Issued or Activating state to Activated. | customer.card.changeState | { "cardInfo":{ "cardId":20, "cardNumber":"4510721265576184", "cardState":"Activated", "activationDate":"2021-07-19T16:33:24Z", "cardType":"General", "cardCategory":"VIP", "barCode":"4510721265576184", "strip1":"4510721265576184", "strip2":"4510721265576184=4510721265576184", "strip3":"strip=4510721265576184", "isBlocked":false, "isDeleted":false }, "targetState":"Activated", "customerInfo":{ "customerId":24, "accountgroupId":"27", "customerUid":"d4119aee-c0b1-48ea-902f-82beed917270", "mobileDeviceId":null, "identifierId":null, "applicationId":1 }, "eventCode":"OnCardActivation" } |
| Events are enqueued when an LP Member’s card status changes between blocked and unblocked. For blocking, the request includes the parameter targetBlockState set to true. For unblocking, targetBlockState is set to false. | customer.card.changeBlockState | { "targetBlockState": true, "cardInfo": { "cardId": 13, "cardNumber": "020000008" }, "customerInfo": { "customerId": 18, "accountgroupId":"125", "customerUid": "c3b84d0c-ff92-4e62-b5df-fbd4ec8ad1e4", "mobileDeviceId": null, "identifierId": null, "applicationId": null }, "eventCode": "OnBlockCard", "externalId": "73d812984ef44a9fb7f1200a41ac7aba", "tryCount": 0, "delaySecond": null, "toErrorQueue": false } |
| Card deletion/restoration | Events are enqueued upon deletion or restoration of a card. For deletion, the request includes the parameter targetDeleteState set to true. For restoration, targetDeleteState is set to false. | customer.card.changeDeleteState | { "targetDeleteState":true, "cardId":39, "cardNumber":"4237436357530502", "customerInfo":{ "customerId":42, "accountgroupId":"48", "customerUid":"9f7e9313-ab7b-4f2c-b888-293a3088dac3", "mobileDeviceId":null, "identifierId":null, "applicationId":null }, "eventCode":"OnDeleteCard" } |
| Card category change | The event is enqueued when an LP Member’s card category changes—for example, when the customer’s LP status is upgraded. | сustomer.card.changeCategory | { "cardId":39, "cardNumber":"4237436357530502", "newcardCategory":"VIP", "customerInfo":{ "customerId":42, "accountgroupId":"48", "customerUid":"9f7e9313-ab7b-4f2c-b888-293a3088dac3", "mobileDeviceId":null, "identifierId":null, "applicationId":null }, "eventCode":"OnChangeCategoryCard" } |
| LP Member attribute update | The event is enqueued when LP Member attributes are updated. These include: - Public Offer acceptance;
- Phone number confirmation;
- Completion of application form, etc.
| customer.attribute.update | { "fromBatchOperation":false, "attributeCode":"Phone", "userAttributeType":"Notifier", "attributeId":3, "oldValue":null, "newValue":"79540286267", "changeDateTime":"2021-06-15T09:17:07Z", "activityUid":"5c4b232b-aa2d-4bff-b393-9f60b9b8c1f1", "eventCode":"OnCustomerAttributeUpdate", "customerInfo":{ "customerId":126, "accountgroupId":"130", "customerCode":"155b341e-f24c-4dd4-b105-ab58ce766a24", "mobileDeviceId":"", "identifierId":null, "applicationId":1 } } |
| Subscription status change | The event is enqueued when an LP Member’s subscription status changes. | customer.subscription.update | { "mailingSubscriptionType":"Cashback", "subscriptionTypeId":1, "subscriptionTypeCode":"DiscountOperation", "subscriptionTypeName":"Discount accrual notifications", "subscriptionInfo":{ "mail":"Enabled", "push":"Enabled", "sms":"Enabled", "viber":"Enabled", "chatBot":"Enabled", "socialNetworks":"Enabled" }, "eventCode":"OnCustomerSubscriptionChange", "customerInfo":{ "customerId":164, "accountgroupId":"168", "customerUid":"5c6e502a-a3e5-4106-a420-e49ed3c82d92", "mobileDeviceId":null, "identifierId":null, "applicationId":null } } |
| The event is enqueued when an LP Member makes a purchase. | purchases.confirm.modelUpdate | { "purchaseOperationInfo":{ "merchantId":1, "merchantUid":"b984731d-4597-431f-a70b-61250392c6a3", "merchantCode":null, "deviceCode":"001010", "dateTime":"2020-08-13T16:53:47Z", "type":"PurchaseData", "identity":"020000001", "cashierIdentifier":"666", "description":"Noname POS", "locationId":null, "partnerId":"d1f94a6c-0d33-4cf2-79ab-9248f3dd2547", "brandId":"82013554-3dd3-4e08-5a73-e8354f45ffa6", "purchaseData":{ "chequeNumber":"123", "purchaseId":512, "externalPurchaseId":"5226324048", "amount":135.0000, "currencyExternalId":"718ae69b-76be-413f-ad19-7b7e02e4a438", "chequeItems":[ { "positionId":1, "description":"Aqva", "quantity":10.0000, "unit":null, "amount":90.0000, "itemId":"1" }, { "positionId":2, "description":"Вода", "quantity":1.0000, "unit":null, "amount":45.0000, "itemId":"2" } ], "withdraws":[ { "moneyAmount":10.0000, "description":null, "positionInfo":{ "1":-6.6700, "2":-3.3300 }, "amount":-10.0000, "withdrawType":"Bonus", "currencyExternalId":"1f24174f-bfdb-4019-a3e7-4fb088b4a7a7" } ], "rewards":[ { "offerExternalId":"4848fd95-b3ee-4594-9ba1-211bcf148c43", "description":null, "positionInfo":{ "1":10.0000, "2":5.0000 }, "amount":15.0000, "rewardType":"Discount", "currencyExternalId":"718ae69b-76be-413f-ad19-7b7e02e4a438" }, { "offerExternalId":"4848fd95-b3ee-4594-9ba1-211bcf148c43", "description":null, "positionInfo":{ "1":41.6700, "2":20.8400 }, "amount":62.5100, "rewardType":"Bonus", "currencyExternalId":"1f24174f-bfdb-4019-a3e7-4fb088b4a7a7" } ], "isRefund":false, "purchaseAttributes":[ ] } }, "customerInfo":{ "customerId":107, "accountfroupId":"111", "customerUid":"6c0b4b64-ebd8-4397-a6f5-d6f3eb32cd2c", "mobileDeviceId":null, "identifierId":null, "applicationId":null }, "eventCode":"OnPurchaseConfirm" } |
| The event is enqueued when an LP Member refunds a purchase. | purchases.refundModelUpdate | { "refundedPurchaseViewModel":{ "refundedPurchaseId":512, "refundedPurchaseExternalId":"5226324048" }, "refundOperationInfo":{ "merchantId":1, "merchantUid":"b984731d-4597-431f-a70b-61250392c6a3", "merchantCode":null, "deviceCode":"001010", "dateTime":"2021-08-13T16:53:47Z", "type":"PurchaseData", "identity":"020000001", "cashierIdentifier":"666", "description":"Refund. Test store", "locationId":null, "partnerId":"d1f94a6c-0d33-4cf2-79ab-9248f3dd2547", "brandId":"82013554-3dd3-4e08-5a73-e8354f45ffa6", "purchaseData":{ "purchaseId":513, "externalPurchaseId":"9335645011", "amount":100.0000, "currencyDeviceExternalId":"718ae69b-76be-413f-ad19-7b7e02e4a438", "chequeItems":[ { "positionId":1, "description":"Aqva", "quantity":10.0000, "unit":null, "amount":100.0000, "itemId":"1" } ], "withdraws":[ { "moneyAmount":6.67, "description":null, "positionInfo":{ "1":-6.6700 }, "amount":-6.6700, "withdrawType":"Bonus", "currencyExternalId":"1f24174f-bfdb-4019-a3e7-4fb088b4a7a7" } ], "rewards":[ { "offerExternalId":null, "description":null, "positionInfo":{ "1":41.6700 }, "amount":41.6700, "rewardType":"Bonus", "currencyExternalId":"1f24174f-bfdb-4019-a3e7-4fb088b4a7a7" } ], "isRefund":true, "chequeNumber":"123", "purchaseAttributes":[ ] } }, "customerInfo":{ "customerId":107, "accountgroupId":"111", "customerUid":"6c0b4b64-ebd8-4397-a6f5-d6f3eb32cd2c", "mobileDeviceId":null, "identifierId":null, "applicationId":null }, "eventCode":"OnPurchaseRefund" } |