Loyalty Management Receipt Scanner Kit Unlocked Package Components

The Loyalty Management Receipt Scanner Kit unlocked package contains a set of components such as custom objects, fields, Apex classes, Lightning web components, and more to facilitate easier distribution of these bundled components.

Required Editions
Available in: all editions that have Loyalty Management enabled

Custom Objects 

The package consists of custom objects that store the details of the scanned receipts.

ObjectWhat the Object Stores
ReceiptSaves the details of the scanned and submitted receipts
Receipt Scanning ErrorSaves the details of the errors that occur while scanning receipts.

Permission Set, List View, Page Layout, and Tab 

The Receipt Scanning permission set enables loyalty program members to access the Receipt Scanning feature.

Loyalty program managers can review all submitted receipts on the Receipts tab on the Loyalty Management app. In Setup, the Receipt Scanning setting enables your loyalty program members to scan receipts on their Loyalty Management iOS and Android mobile apps, and to earn loyalty points for eligible items.

Custom Settings 

The package consists of a custom setting that stores the values that are required to connect Loyalty Management with an Optical Character Recognition (OCR) software.

SettingWhat the Setting Stores
API Endpoint DetailsThe API Gateway endpoint URL that is used to access and interact with. The APIs, The bucket details that store the objects used in the AWS endpoint, The API Named Credential that provides the API Gateway endpoint’s URL, or The authentication settings for Salesforce to make callouts to AWS.

Custom Label 

The package consists of a custom label that stores the values that are required to reward non-qualifying points.

SettingWhat the Setting Stores
PrimaryNQPCurrencyNameThis label stores the primary NQP currency name. To replace this currency name with your program’s primary NQP currency, from the Setup page, search and find Custom Label, and then edit and replace the label.

Apex Classes 

The unlocked package contains Apex classes to run the Expense Analysis API and Receipt Status Updation API for submitted receipts, and to show the scan results on the Loyalty Management mobile app.

Apex ClassWhat the Class Does
DMLManagerManages Data Manipulation Language (DML) statements to insert, update, merge, delete, and restore data in Salesforce.
ExpenseAnalysisManages the request to process the uploaded receipt.
ProcessTransactionJournalCreates transaction journals for each line item of a scanned receipt and calls the Rules Engine API to process the transaction journals.
ReceiptScanningConfigControllerManages the receipt scanning configuration.
ReceiptScanningControllerUtilsManages the common functionality methods.
ReceiptScanningResponseWrapperAnalyzes the eligible and ineligible items in the receipt after a receipt is uploaded and returns a response of line items for the scanned receipt.
ReceiptStatusUpdateUpdates the status of receipts by sending REST requests to a specific location or endpoint.
ReceiptUploadManages the request to upload the receipt and creates a request to analyze the uploaded receipt.
ReceiptWrapperRepresents the data structure of an AWS response.
RulesEngineResponseWrapperAnalyzes the response returned from the Rules Engine API that includes transaction journal details.

Custom Metadata Types 

The unlocked package contains custom metadata types to create and store the objects and fields related to receipt scanning.

Custom Metadata TypeWhat the Custom Metadata Type DoesExamples
Accepted Date FormatRepresents the configuration of the accepted date format and the store name fields related to the receipt.26/02/2022
Required Receipt FieldsRepresents the configuration of the mandatory fields to be captured from a scanned receipt.Receipt Date
Receipt ScanningRepresents the configuration details related to the receipt scanning feature.Confidence score, named credential, receipt scanning activity, and show ineligible receipt items

Apex Trigger 

The unlocked package contains apex triggers to update the status of a receipt and to automatically assign the Receipt Scanning permission set to Experience Cloud users.

Apex TriggerWhat the Apex Trigger Does
ReceiptUpdateTriggerCreates transaction journals, and processes the journals by using the Rule Engine API.
UserReceiptScanTriggerAutomatically assigns the Receipt Scanning permission set to all the Experience Cloud profile users, after the admin installs the unlocked package. For existing loyalty program members, the admin has to manually assign the Receipt Scanning permission set to the members’ Experience Cloud users.

Customizations 

Admins can customize their receipt scanning implementation by extending the component provided by the Loyalty Management Receipt Scanner Kit unlocked package. The admin can add additional checks that decide which elements must be available in a receipt for it to be eligible to be rewarded.

Example 

  • Apex classes

    • ReceiptScanningResponseWrapper
    • ReceiptScanningControllerUtils
    • receiptScanningDetail
    • Eligible Item Identifier Field custom metadata type