LoyaltyProgramSetup

Represents the configuration of a loyalty program process including its parameters and rules. Program processes determine how new transaction journals are processed. When new 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.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

LoyaltyProgramSetup components have the suffix loyaltyProgramSetup and are stored in the loyaltyProgramSetups folder.

Version 

Introduced in API version 54.0.

LoyaltyProgramSetup components are available in API version 54.0 and later for Loyalty Management and in API version 59.0 and later for Referral Marketing.

Special Access Rules 

To use this metadata type, your org must have either B2C - Loyalty, B2C - Loyalty Plus, Loyalty Management - Growth, Loyalty Management - Advanced, or Referral Marketing license enabled.

Fields 

label 

  • Type: string
  • Required: No
  • Description: Name of the loyalty program that the program process is associated with. If a loyalty program or referral program with the specified name doesn’t exist, a new LoyaltyProgram record is created. The name of a program must contain at least one alphanumeric character.

programProcesses 

  • Type: LoyaltyProgramProcess[]
  • Required: No
  • Description: Collection of loyalty program processes associated with a loyalty program or a referral program.

LoyaltyProgramProcess Type 

Represents a collection of fields relating to a loyalty program process.

Fields 

description 

  • Type: string
  • Required: No
  • Description: The description of the loyalty program process.

executionType 

  • Type: LoyaltyPgmProcExecutionType (enumeration of type string)
  • Required: No
  • Description: The mode of processing transaction journals by the loyalty program process.
  • Possible values:
    • Batch
    • BatchAndRealTime
    • RealTime

journalSubType 

  • Type: string
  • Required: No
  • Description: The subtype of transaction journals processed by the loyalty program process.

journalType 

  • Type: string (enumeration of type string)

  • Required: No

  • Description: The type of transaction journal processed by the loyalty program process.

    Possible values for loyalty program:

    Possible value for referral program:

  • Possible values:

    • Accrual
    • Redemption
    • Referral

loyaltyTierGroup 

  • Type: string
  • Required: No
  • Introduced: API version 56.0
  • Description: The tier group of a loyalty program. This field isn’t applicable for referral programs.

parameters 

processName 

  • Type: string

  • Required: Yes

  • Description: Required.

    The name of the loyalty program process.

processType 

  • Type: string

  • Required: Yes

  • Description: Required.

    The type of records processed by the loyalty program process. For referral programs, the process type is TransactionJournal.

rules 

status 

  • Type: LoyaltyPgmProcStatus (enumeration of type string)
  • Required: No
  • Description: The status of the loyalty program process.
  • Possible values:
    • Active
    • Draft
    • Inactive

Only active program processes can process transaction journals.

Note

LoyaltyProgramProcessAction Type 

Represents a collection of fields relating to an action.

Fields 

actionName 

  • Type: string
  • Required: Yes
  • Description: Required.

actionParameters 

actionType 

  • Type: LoyaltyPgmProcActionType (enumeration of type string)
  • Required: Yes
  • Description: Required.

crudActionType 

  • Type: LoyaltyPgmProcCrudActType (enumeration of type string)
  • Required: No
  • Description: The type of operation to perform on target object records by the action. This field is available from API version 56.0 and later.
  • Possible values:
    • create
    • update

This field is required when the actionType field value is CRUD .

Note

decisionTable 

  • Type: string
  • Required: No
  • Description: The decision that’s invoked by the action for the transaction journal that’s processed by the rule.

decisionTableDatasetLink 

  • Type: string
  • Required: No
  • Description: The dataset link associated with the selected decision table.

entityApiName 

  • Type: string
  • Required: No
  • Description: The API name of the target object. This field is available from API version 56.0 and later.

This field is required when the actionType field value is CRUD .

Note

flowDefinition 

  • Type: string
  • Required: No
  • Description: The flow that’s run by the action for the transaction journal that’s processed by the rule. The selected flow must be of the type LoyaltyManagementFlow.

loyaltyProgramProcess 

  • Type: string
  • Required: No
  • Description: The subprogram processes that’s run by the action. This field is available from API version 56.0 and later.

This field is required when the actionType field value is RunProgramProcess .

Note

LoyaltyProgramProcessActionParameter Type 

Represents a collection of fields relating to an action parameter. A parameter is either an input or an output for the action. Input parameters store the values used by the action. Output parameters store the result of the action.

Fields 

operator 

  • Type: LoyaltyPgmProcActParamOper (enumeration of type string)
  • Required: No
  • Introduced: API version 56.0
  • Description: The type of operator used in the action. Possible value is:
  • Possible values:
    • Equals

parameterName 

  • Type: string

  • Required: Yes

  • Description: Required.

    The name of parameter. The parameter name must be the same as the input or the output field that’s supported depending on the associated action’s type.

sequenceNumber 

  • Type: int
  • Required: No
  • Introduced: API version 56.0
  • Description: The sequence number of the parameter in the action.

value 

  • Type: string
  • Required: Yes
  • Description: Required.

valueType 

  • Type: LoyaltyPgmProcActParamType (enumeration of type string)
  • Required: No
  • Introduced: API version 56.0
  • Description: The type of value to provide in the parameter.
  • Possible values:
    • Literal — A constant value.
    • Parameter — A runtime value passed using a parameter.

LoyaltyProgramProcessCondition Type 

Represents a collection of fields relating to a condition. Conditions filter records that parameters store or check whether child actions must be triggered for a transaction journal.

Fields 

conditionCriteria 

  • Type: string

  • Required: No

  • Description: Required.

    The criteria that determine when the condition is met by a record or by a transaction journal.

conditionFilterCriteria 

conditionName 

  • Type: string

  • Required: Yes

  • Description: Required.

    The name of the condition.

conditionType 

  • Type: LoyaltyPgmProcRuleType (enumeration of type string)
  • Required: No
  • Description: Specifies the type of condition in the loyalty program process.

LoyaltyProgramProcessConditionFilterCriteria Type 

Represents a collection of fields relating to a filter criteria that’s part of a condition. Multiple filter criteria can be added for a condition. Filter criteria determine which records are filtered by related condition.

Fields 

operator 

  • Type: LoyaltyPgmProcCondOperator (enumeration of type string)

  • Required: Yes

  • Description: Required.

    The operator of the filter criteria.

  • Possible values:

    • Contains
    • DoesNotContain
    • Equals
    • GreaterThan
    • GreaterThanOrEquals
    • IsNotNull
    • IsNull
    • LessThan
    • LessThanOrEquals
    • NotEquals

sequence 

  • Type: int

  • Required: Yes

  • Description: Required.

    The sequence number of the filter criteria within a condition.

sourceFieldName 

  • Type: string

  • Required: Yes

  • Description: Required.

    The name of the field used in the filter criteria.

value 

  • Type: string
  • Required: No
  • Description: The value of the filter criteria.

valueType 

  • Type: LoyaltyPgmProcCondType (enumeration of type string)

  • Required: Yes

  • Description: Required.

    The type of value specified in the filter criteria.

  • Possible values:

    • Formula
    • Literal
    • Lookup
    • Parameter

LoyaltyProgramProcessParameter Type 

Represents a collection of fields relating to a parameter that’s associated with the program process. Parameters are dynamic or fixed values that are used in rule. You can define the value of a parameter based on its type and data type.

Fields 

condition 

dataType 

  • Type: LoyaltyPgmProcParmDataType (enumeration of type string)
  • Required: No
  • Description: The data type of the parameter. Determines the type of value that can be stored in the parameter.
  • Possible values:
    • Boolean
    • Date
    • DateTime
    • Numeric
    • Sobject
    • Text

decimalPlaces 

  • Type: int
  • Required: No
  • Description: The number of decimal places supported by the parameter when it is of the type Variable and data type Numeric.

description 

  • Type: string
  • Required: No
  • Description: The description of the parameter.

isCollection 

  • Type: boolean
  • Required: No
  • Description: Indicates whether the parameter can store multiple values when it is of the type Variable.

isInput 

  • Type: boolean
  • Required: No
  • Description: Indicates whether a parameter can be used as an input outside the loyalty program process.

isOutput 

  • Type: boolean
  • Required: No
  • Description: Indicates whether a parameter can be used as an output outside the loyalty program process.

objectName 

  • Type: string
  • Required: No
  • Description: Name of the object whose records are stored by the parameter when it is of the type Variable and data type sObject.

parameterName 

  • Type: string

  • Required: Yes

  • Description: Required.

    The name of the parameter.

parameterType 

  • Type: LoyaltyPgmProcParmType (enumeration of type string)
  • Required: No
  • Description: The type of value the parameter can store.
  • Possible values:
    • Constant
    • Formula
    • Variable

value 

  • Type: string
  • Required: No
  • Description: The value of the parameter when it is of the type Variable or Formula and isn’t of the data type sObject.

LoyaltyProgramProcessRule Type 

Represents a collection of fields relating to a rule. A rule consists of a set of conditions and actions.

Fields 

actions 

conditions 

description 

  • Type: string
  • Required: No
  • Description: The description of the rule.

endDate 

  • Type: date
  • Required: No
  • Description: The date until which the rule processes transaction journals.

isProcessEligibilityRule 

  • Type: boolean
  • Required: No
  • Description: Indicates whether the rule is used to determine eligibility for processing the loyalty program process (true) or not (false). When set to true, the rule is evaluated as a process eligibility rule. When set to false, the rule is evaluated as a standard program process rule.

previousRule 

  • Type: string
  • Required: No
  • Description: The rule that processes new transaction journals before the current rule. The current rule is triggered when the previous rule completes processing transaction journals.

promotion 

  • Type: string
  • Required: No
  • Description: The promotion associated with the rule. When a promotion is associated with a rule, the start date, end date, and status of the promotion determines the corresponding fields of the rule.

ruleName 

  • Type: string

  • Required: Yes

  • Description: Required.

    The name of the rule.

startDate 

  • Type: date
  • Required: No
  • Description: The date from which the rule starts processing transaction journals.

status 

  • Type: LoyaltyPgmProcRuleStatus (enumeration of type string)
  • Required: No
  • Description: The status of the rule.
  • Possible values:
    • Active
    • Draft
    • Inactive

stepMappings 

LoyaltyProgramProcessRuleStepMapping Type 

Represents a collection of fields relating to a step mapping. Map conditions with child actions or map an action without a parent step.

Fields 

associatedStep 

  • Type: string

  • Required: Yes

  • Description: Required.

    The action that’s associated with the mapping.

parentStep 

  • Type: string
  • Required: No
  • Description: The condition that contains one or more child actions.

sequence 

  • Type: int

  • Required: Yes

  • Description: Required.

    The sequence number of the mapping within a rule.

Declarative Metadata Sample Definition 

The following is an example of a LoyaltyProgramSetup component.

1<?xml version="1.0" encoding="UTF-8"?>
2<LoyaltyProgramSetup xmlns="http://soap.sforce.com/2006/04/metadata">
3    <label>Cloud Kicks Inner Circle</label>
4    <programProcesses>
5        <executionType>RealTime</executionType>
6        <parameters>
7            <dataType>Numeric</dataType>
8            <decimalPlaces>0</decimalPlaces>
9            <isCollection>false</isCollection>
10            <isInput>false</isInput>
11            <isOutput>false</isOutput>
12            <parameterName>VoucherValue</parameterName>
13            <parameterType>Constant</parameterType>
14            <value>50</value>
15        </parameters>
16        <processName>Issue Vouchers</processName>
17        <processType>Transaction Journal</processType>
18        <rules>
19            <isProcessEligibilityRule>false</isProcessEligibilityRule>
20            <actions>
21                <actionName>Issue High Transaction Value Voucher</actionName>
22                <actionParameters>
23                    <operator>Equals</operator>
24                    <parameterName>VoucherDefinitionName</parameterName>
25                    <sequenceNumber>1</sequenceNumber>
26                    <value>Voucher for High Value Transactions</value>
27                    <valueType>Literal</valueType>
28                </actionParameters>
29                <actionParameters>
30                    <operator>Equals</operator>
31                    <parameterName>VoucherCode</parameterName>
32                    <sequenceNumber>2</sequenceNumber>
33                    <value>{!TransactionJournal.Order.Id}</value>
34                </actionParameters>
35                <actionParameters>
36                    <operator>Equals</operator>
37                    <parameterName>VoucherEffectiveDate</parameterName>
38                    <sequenceNumber>3</sequenceNumber>
39                    <value>DATEVALUE(&quot;2021-11-21 00:00:00&quot;)</value>
40                </actionParameters>
41                <actionParameters>
42                    <operator>Equals</operator>
43                    <parameterName>VoucherExpirationDate</parameterName>
44                    <sequenceNumber>4</sequenceNumber>
45                    <value>DATEVALUE(&quot;2022-01-01 00:00:00&quot;)</value>
46                </actionParameters>
47                <actionParameters>
48                    <operator>Equals</operator>
49                    <parameterName>VoucherFaceValue</parameterName>
50                    <sequenceNumber>5</sequenceNumber>
51                    <value>{!VoucherValue}</value>
52                </actionParameters>
53                <actionType>IssueVoucher</actionType>
54            </actions>
55            <conditions>
56                <conditionCriteria>1</conditionCriteria>
57                <conditionFilterCriteria>
58                    <operator>GreaterThanOrEquals</operator>
59                    <sequence>1</sequence>
60                    <sourceFieldName>TransactionJournal.TransactionAmount</sourceFieldName>
61                    <value>100</value>
62                    <valueType>Literal</valueType>
63                </conditionFilterCriteria>
64                <conditionName>New Condition</conditionName>
65                <conditionType>Condition</conditionType>
66            </conditions>
67            <endDate>2022-01-01</endDate>
68            <ruleName>Issue Voucher for Transactions Above $100</ruleName>
69            <startDate>2021-11-21</startDate>
70            <status>Draft</status>
71            <stepMappings>
72                <associatedStep>New Condition</associatedStep>
73                <sequence>1</sequence>
74            </stepMappings>
75            <stepMappings>
76                <associatedStep>Issue High Transaction Value Voucher</associatedStep>
77                <parentStep>New Condition</parentStep>
78                <sequence>1</sequence>
79            </stepMappings>
80        </rules>
81        <status>Draft</status>
82    </programProcesses>
83</LoyaltyProgramSetup>

The following is an example package.xml that references the previous definition.

1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3   ~ Copyright 2020 Salesforce, Inc.
4   ~ All Rights Reserved
5   ~ Company Confidential
6-->
7<Package xmlns="http://soap.sforce.com/2006/04/metadata">
8   <types>
9      <members>*</members>
10      <name>LoyaltyProgramSetup</name>
11   </types>
12   <version>54.0</version>
13</Package>

To retrieve metadata specific to any loyalty program, mention the loyalty program name in the tag. The generated file contains all the information regarding that loyalty program.

Note

Wildcard Support in the Manifest File 

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.