Newer Version Available
Loyalty Engine Input Map
- JSON example
- In the JSON, you can either provide the details of transaction journals that aren’t available in the org, or a list of IDs that belong to transaction journals available in the org. If you provide the details of transaction journals that aren’t available in the org, each transaction journal’s applicable loyalty program process applies the eligible rules, executes the applicable actions, and then creates the transaction journal.
-
Using the transaction journal details:
Here’s a JSON example that creates a transaction journal for a purchase-related transaction made by a loyalty program member of a retail company. It has all the transaction journal-related information along with the details of the promotion applied, including the different types of rewards the transaction is eligible for. For information on the TransactionJournal object fields, see https://developer.salesforce.com/docs/atlas.en-us.loyalty.meta/loyalty/sforce_api_objects_transactionjournal.htm.
1{ 2 "transactionJournals": [ 3 { 4 "ActivityDate": "2023-11-27T12:45:19Z", 5 "JournalTypeId": "0lERM00000001Bb2AI", 6 "LoyaltyProgramId": "0lpRM00000002YTYAY", 7 "MemberId": "0lMRM0000002Fmu2AE", 8 "Status": "Pending", 9 "ProductId": "01txx0000006iTsAAI", 10 "ProductCategoryId": "0ZSSB0000002d8X4AQ", 11 "Quantity": "4", 12 "TransactionAmount": "500", 13 "appliedPromotions": [ 14 { 15 "promotionId": "0c8RM0000004FiXYAU", 16 "rewards": [ 17 { 18 "rewardType": "Discount", 19 "discountAmount": 15 20 }, 21 { 22 "rewardType": "Points", 23 "loyaltyProgramCurrencyName": "Coins", 24 "points": 100, 25 "relatedInformation": "Test", 26 "notes": "points reward" 27 }, 28 { 29 "rewardType": "Voucher", 30 "voucherDefinitionName": "10% Discount Voucher", 31 "voucherExpirationDate": "2023-12-15", 32 "voucherEffectiveDate": "2023-11-29", 33 "notes": "discount voucher" 34 }, 35 { 36 "rewardType": "Badge", 37 "loyaltyProgramBadgeName": "Gen AI Badge", 38 "memberBadgeStatus": "Active", 39 "badgeValidityEndDate": "2023-12-15", 40 "reason": "purchase" 41 }, 42 { 43 "rewardType": "Game", 44 "gameDefinitionName": "SpintheWheelGame" 45 } 46 ] 47 } 48 ] 49 } 50 ] 51}Here’s a JSON example to create a transaction journal for a loyalty program member of an airline company.
1{ 2 "transactionJournals":[ 3 { 4 "ActivityDate":"2022-01-04T12:45:19Z", 5 "JournalDate":"2022-01-04T00:45:19Z", 6 "Brand":"Tata", 7 "Establishment":"Vistara", 8 "ExternalTransactionNumber":"P1-981950", 9 "JournalTypeId":"0lET10000004CQp", 10 "LoyaltyProgramId":"0lpT10000004CdN", 11 "MemberId":"0lMT10000004CfA", 12 "TransactionAmount":"117", 13 "TransactionLocation":"HitechCity", 14 "VoucherCode":"", 15 "Origin":"Bangalore", 16 "Distance":"5", 17 "Destination":"Hyderabad", 18 "FlightNumber":"VS-Ran-001", 19 "Status":"Pending" 20 } 21 ] 22} -
Using the transaction journal ID:
1{ 2 "transactionJournals": [ 3 { 4 "Id": "0lVxx00000000cj" 5 } 6 ] 7} - Properties
-
Name Type Description Required or Optional Available Version processInput Map<String, Object> List of the Transaction Journal records to process and create. Required 54.0