This page provides the event and associated payload for the Loyalty microservice.
Event
SL.# | NAME | DESCRIPTION | PUBLISH LOCATION | ROUTING KEY | DURABILITY | PAYLOAD TYPE |
---|---|---|---|---|---|---|
1 | Create Transaction as Earn, Cycled, or Redeem | This event is triggered when creating a Earn, Cycled, or Redeem transaction. | Topic: ecomm | loyalty.transaction.create | FALSE | Transaction |
2 | Create or Update a Rule | This event is triggered when creating or updating a rule to clear the cache and reflect the changes in the API call. | Topic: ecomm | loyalty.rule.update | FALSE | cacheClear |
3 | Update Loyalty Points to the Order Service | This event updates the shipment and loyalty points earning details to the Order service. | Topic: ecomm | oms.omsReplyToQueue | FALSE | omsUpdate |
Payload Model
Below is the payload for the Loyalty microservice event:
Transaction
PROPERTY | TYPE | DESCRIPTION | EXAMPLE |
---|---|---|---|
collectionId | long | Indicates 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 |
userId | string | Holds the user identifier. | User12378 |
identifier | String | Holds the identifier of the transaction. | T100 |
type | String | Holds the type of transaction. The value can be EARNED, APPROVED, FORFEITED, REDEEMED, RREVERSE-REDEEMED, CANCELED, UPDATED, EXPIRED, BLOCK-REDEEMED, or CYCLED. | EARNED |
status | String | Indicates the status of the transaction. The valid values are ACTIVE and INACTIVE. | ACTIVE |
parentTransactionId | String | Indicates the unique identifier of the parent transaction. | 63b6576266776814f654a8f1 |
cycleId | long | Indicates the cycle transaction ID. | 1 |
rewardType | String | Holds the reward type that is confirmed for earning points. | LOYALTY |
expiryTime | long | Indicates the transaction expiry time in milliseconds. | 1704430306990 |
notes | String | Specifies the description of the transaction. | Order Points |
eventId | String | Holds the event ID which is configured for earning the points. | Order Shipped |
otrValue | number | Specifies the open to redeem points earned in the transaction. | 100 |
childTransactions | JSON | Holds a list of parent transactions. It holds the loyalty EARNED transactions, which contains the identifier, rewardValue, and its type. | { |
orderId | String | Holds the order identifier. | 100 |
balance | number | Indicates the reward bank's total balance(open to redeem points) of the user. | 100 |
effectiveDate | String | Specifies the transaction effective date. It is mostly the current date (when a back dated order is placed, it holds the previous date). | 1672894306986 |
properties | JSON | Holds the transaction properties, which are added dynamically without affecting the exiting schema as key-value pairs. | [] |
createdBy | long | Holds 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 |
createdOn | long | Indicates the created time of the transction in milliseconds. | 1516789034567 |
updatedBy | long | Holds 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 |
updatedOn | long | Holds the last updated timestamp of this entry. It is specified using the format: YYYY-MM-DD HH:MM:SS. | 1516989034567 |
cacheClear
PROPERTY | TYPE | DESCRIPTION | EXAMPLE |
---|---|---|---|
messageType | String | Indicates the type of action to be performed. After updating the rule, the cache is cleared to reflect the changes in the API call. | cacheClear |
collectionId | long | Indicates 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 |
authToken | String | Holds the authentication token of the user who has initiated the API. | eyJiaWQiOjAsImFsZyI6IkhTNTEyIn0.eyJjcmVhdGVkIjoxNTc2NjY2Nzk5Njk1LCJhY3Rpbmd1c2VybmFtZSI6IjAiLCJleHAiOjE1NzY2NzAzOTksImhhc2giOiJmZjZhZGMwYTZiYTJhYjM2NzhmMDIwZDU1MDNjMTE5NiIsImF1dGhvcml0aWVzIjoiW3tcInJvbGVzXCI6e1wiUk9MRV9TVVBFUl9BRE1JTlwiOnt9fX1dIiwidXNlcm5hbWUiOiIxIn0.7kX77xUvXl1uRSY88imE5ZcB4qpyw-zDSPOKqcKUxvWUJx6T2fkla2TN1FV6gyilhhecOWh3dJNhw9usx24uGQ |
omsUpdate
PROPERTY | TYPE | DESCRIPTION | EXAMPLE |
---|---|---|---|
tier | String | Holds the user current tier information such as T1, T2, or T3. | Basic-5 |
pointValue | number | Indicates the point earned in the current order. | 7 |
rewardType | String | Specifies the reward type configured in the Loyalty Admin console. The reward types are configured in the collection property allowedRewardTypesForOptIn. | LOYALTY |
transactionType | String | Holds the transaction type created for the current order. | APPROVED |
shipmentDetails | JSON | Holds 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. | { |
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.