Transaction Journals Execution

Use this resource to create and process a list of transaction journals against a corresponding loyalty program process.

The loyalty program processes determine how transaction journals are processed. When transaction journals meet the criteria and conditions for a program process, actions that are set up in the process are triggered for the transaction journals. For more information on how to set up program process, see LoyaltyProgramSetup.

Special Access Rules
To use this resource, your org must have either B2C - Loyalty, B2C - Loyalty Plus, Loyalty Management - Growth, or Loyalty Management - Advanced license enabled, and you must be assigned the Loyalty Management permission set.
Resource
/connect/realtime/loyalty/programs/${programName}
Resource example
https://yourInstance.salesforce.com/services/data/vXX.X/connect
/realtime/loyalty/programs/CloudKicksInnerCircle
Available version
54.0
Requires Chatter
No
HTTP methods
POST
Request body for POST
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:

Some of the API request fields contain field names that are interchangeable. For information on the list of interchangeable field names, see Loyalty Management Connect API Interchangeable Request Fields.

Note

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.

{
  "transactionJournals": [
    {
      "ActivityDate": "2023-11-27T12:45:19Z",
      "JournalTypeId": "0lERM00000001Bb2AI",
      "LoyaltyProgramId": "0lpRM00000002YTYAY",
      "MemberId": "0lMRM0000002Fmu2AE",
      "Status": "Pending",
      "ProductId": "01txx0000006iTsAAI",
      "ProductCategoryId": "0ZSSB0000002d8X4AQ",
      "Quantity": "4",
      "TransactionAmount": "500",
      "appliedPromotions": [
        {
          "promotionId": "0c8RM0000004FiXYAU",
          "rewards": [
            {
              "rewardType": "Discount",
              "discountAmount": 15
            },
            {
              "rewardType": "Points",
              "loyaltyProgramCurrencyName": "Coins",
              "points": 100,
              "relatedInformation": "Test",
              "notes": "points reward"
            },
            {
              "rewardType": "Voucher",
              "voucherDefinitionName": "10% Discount Voucher",
              "voucherExpirationDate": "2023-12-15",
              "voucherEffectiveDate": "2023-11-29",
              "notes": "discount voucher"
            },
            {
              "rewardType": "Badge",
              "loyaltyProgramBadgeName": "Gen AI Badge",
              "memberBadgeStatus": "Active",
              "badgeValidityEndDate": "2023-12-15",
              "reason": "purchase"
            },
            {
              "rewardType": "Game",
              "gameDefinitionName": "SpintheWheelGame"
            }
          ]
        }
      ]
    }
  ]
}

Here’s a JSON example to create a transaction journal for a loyalty program member of an airline company.

{
   "transactionJournals":[
      {
         "ActivityDate":"2022-01-04T12:45:19Z",
         "JournalDate":"2022-01-04T00:45:19Z",
         "Brand":"Tata",
         "Establishment":"Vistara",
         "ExternalTransactionNumber":"P1-981950",
         "JournalTypeId":"0lET10000004CQp",
         "LoyaltyProgramId":"0lpT10000004CdN",
         "MemberId":"0lMT10000004CfA",
         "TransactionAmount":"117",
         "TransactionLocation":"HitechCity",
         "VoucherCode":"",
         "Origin":"Bangalore",
         "Distance":"5",
         "Destination":"Hyderabad",
         "FlightNumber":"VS-Ran-001",
         "Status":"Pending"
      }
   ]
}

Using the transaction journal ID:

This is supported in API version 55.0 and later.

Note

{
  "transactionJournals": [
    {
      "Id": "0lVxx00000000cj"
    }
  ]
}
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
Response body for POST
Loyalty Engine Realtime Output