This page provides the event and associated payload for the Loyalty microservice.

Event

SL.#NAMEDESCRIPTIONPUBLISH LOCATIONROUTING KEYDURABILITYPAYLOAD TYPE
1Create Transaction as Earn, Cycled, or RedeemThis event is triggered when creating a Earn, Cycled, or Redeem transaction.Topic: ecommloyalty.transaction.createFALSETransaction
2Create or Update a RuleThis event is triggered when creating or updating a rule to clear the cache and reflect the changes in the API call.Topic: ecommloyalty.rule.updateFALSEcacheClear
3Update Loyalty Points to the Order ServiceThis event updates the shipment and loyalty points earning details to the Order service.Topic: ecommoms.omsReplyToQueueFALSEomsUpdate

Payload Model

Below is the payload for the Loyalty microservice event:

Transaction

PROPERTYTYPEDESCRIPTIONEXAMPLE
collectionIdlongIndicates the ID of the collection. In all the microservices, the configuration parameters of the APIs are maintained in an entity called collection. You can customize the functionality of the API using the collection properties. It is a mandatory parameter for all the microservices. The value should not be empty or null. It should be greater than 0. There is no specific range applicable for the value.100
userIdstringHolds the user identifier.User12378
identifierStringHolds the identifier of the transaction.T100
typeStringHolds the type of transaction. The value can be EARNED, APPROVED, FORFEITED, REDEEMED, RREVERSE-REDEEMED, CANCELED, UPDATED, EXPIRED, BLOCK-REDEEMED, or CYCLED.EARNED
statusStringIndicates the status of the transaction. The valid values are ACTIVE and INACTIVE.ACTIVE
parentTransactionIdStringIndicates the unique identifier of the parent transaction.63b6576266776814f654a8f1
cycleIdlongIndicates the cycle transaction ID.1
rewardTypeStringHolds the reward type that is confirmed for earning points.LOYALTY
expiryTimelongIndicates the transaction expiry time in milliseconds.1704430306990
notesStringSpecifies the description of the transaction.Order Points
eventIdStringHolds the event ID which is configured for earning the points.Order Shipped
otrValuenumberSpecifies the open to redeem points earned in the transaction.100
childTransactionsJSONHolds a list of parent transactions. It holds the loyalty EARNED transactions, which contains the identifier, rewardValue, and its type.{
"identifier": "63b6576266776814f654a8f1",
"rewardValue": 100,
"type": "EARNED"
}
orderIdStringHolds the order identifier.100
balancenumberIndicates the reward bank's total balance(open to redeem points) of the user.100
effectiveDateStringSpecifies the transaction effective date. It is mostly the current date (when a back dated order is placed, it holds the previous date).1672894306986
propertiesJSONHolds the transaction properties, which are added dynamically without affecting the exiting schema as key-value pairs.[]
createdBylongHolds the user identifier who has created this entry. This is a unique identifier, which can be used to identify a user. This data is generated and maintained by the User microservice and logically referred in this microservice.56
createdOnlongIndicates the created time of the transction in milliseconds.1516789034567
updatedBylongHolds the user identifier who has updated this entry lastly. This is a unique identifier, which can be used to identify a user. This data is generated and maintained by the User microservice and logically referred in this microservice.56
updatedOnlongHolds the last updated timestamp of this entry. It is specified using the format: YYYY-MM-DD HH:MM:SS.1516989034567

cacheClear

PROPERTYTYPEDESCRIPTIONEXAMPLE
messageTypeStringIndicates the type of action to be performed. After updating the rule, the cache is cleared to reflect the changes in the API call.cacheClear
collectionIdlongIndicates the ID of the collection. In all the microservices, the configuration parameters of the APIs are maintained in an entity called collection. You can customize the functionality of the API using the collection properties. It is a mandatory parameter for all the microservices. The value should not be empty or null. It should be greater than 0. There is no specific range applicable for the value.100
authTokenStringHolds the authentication token of the user who has initiated the API.eyJiaWQiOjAsImFsZyI6IkhTNTEyIn0.eyJjcmVhdGVkIjoxNTc2NjY2Nzk5Njk1LCJhY3Rpbmd1c2VybmFtZSI6IjAiLCJleHAiOjE1NzY2NzAzOTksImhhc2giOiJmZjZhZGMwYTZiYTJhYjM2NzhmMDIwZDU1MDNjMTE5NiIsImF1dGhvcml0aWVzIjoiW3tcInJvbGVzXCI6e1wiUk9MRV9TVVBFUl9BRE1JTlwiOnt9fX1dIiwidXNlcm5hbWUiOiIxIn0.7kX77xUvXl1uRSY88imE5ZcB4qpyw-zDSPOKqcKUxvWUJx6T2fkla2TN1FV6gyilhhecOWh3dJNhw9usx24uGQ

omsUpdate

PROPERTYTYPEDESCRIPTIONEXAMPLE
tierStringHolds the user current tier information such as T1, T2, or T3.Basic-5
pointValuenumberIndicates the point earned in the current order.7
rewardTypeStringSpecifies the reward type configured in the Loyalty Admin console. The reward types are configured in the collection property allowedRewardTypesForOptIn.LOYALTY
transactionTypeStringHolds the transaction type created for the current order.APPROVED
shipmentDetailsJSONHolds the shipment details received from the Order service, which is returned to the Order service to update the order math. It holds the item ID and its line item ID.{
"itemId": "1234",
"lineItemId": "l1234"
}



Revision History
2023-01-09 | AN – Updated the content for 8.13 release.
2020-01-14 | AN – Updated content for February 2020 release.
2019-10-31 | AM – Content uploaded.