Newer Version Available

This content describes an older version of this product. View Latest

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. This type extends the Metadata metadata type and inherits its fullName field.

File Suffix and Directory Location

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

Version

LoyaltyProgramSetup components are available in API version 54.0 and later.

Special Access Rules

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

Fields

Field Name Description
label
Field Type
string
Description
Name of the loyalty program that the program process is associated with. If a loyalty program with the specified name doesn't exist, a new LoyaltyProgram record is created. The name of a loyalty program must contain at least one alphanumeric character.
programProcesses
Field Type
LoyaltyProgramProcess[]
Description
Collection of loyalty program processes associated with a loyalty program.

LoyaltyProgramProcess

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

Field Name Description
description
Field Type
string
Description
The description of the loyalty program process.
executionType
Field Type
LoyaltyPgmProcExecutionType (enumeration of type string)
Description
The mode of processing transaction journals by the loyalty program process.

Values are:

  • Batch
  • BatchAndRealTime
  • RealTime
journalSubType
Field Type
string
Description
The subtype of transaction journals processed by the loyalty program process.
journalType
Field Type
string
Description
The type of transaction journal processed by the loyalty program process. You can enter either Accrual or Redemption as the journal type.
parameters
Field Type
LoyaltyProgramProcessParameter[]
Description
The parameters associated with the loyalty program process.
processName
Field Type
string
Description

Required.

The name of the loyalty program process.
processType
Field Type
string
Description

Required.

The type of records processed by the loyalty program process.
rules
Field Type
LoyaltyProgramProcessRule[]
Description
The rules associated with the loyalty program process.
status
Field Type
LoyaltyPgmProcStatus (enumeration of type string)
Description
The status of the loyalty program process.

Values are:

  • Active
  • Draft
  • Inactive

Only active program processes can process transaction journals.

Note

LoyaltyProgramProcessParameter

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.

Field Name Description
condition
Field Type
LoyaltyProgramProcessCondition
Description
The filter condition that decides which records are stored in the parameter.
dataType
Field Type
LoyaltyPgmProcParmDataType (enumeration of type string)
Description
The data type of the parameter. Determines the type of value that can be stored in the parameter.

Values are:

  • Boolean
  • Date
  • DateTime
  • Numeric
  • Sobject
  • Text
decimalPlaces
Field Type
int
Description
The number of decimal places supported by the parameter when it is of the type Variable and data type Numeric.
description
Field Type
string
Description
The description of the parameter.
isCollection
Field Type
boolean
Description
Indicates whether the parameter can store multiple values when it is of the type Variable.
isInput
Field Type
boolean
Description
Indicates whether a parameter can be used as an input outside the loyalty program process.
isOutput
Field Type
boolean
Description
Indicates whether a parameter can be used as an output outside the loyalty program process.
objectName
Field Type
string
Description
Name of the object whose records are stored by the parameter when it is of the type Variable and data type sObject.
parameterName
Field Type
string
Description

Required.

The name of the parameter.
parameterType
Field Type
LoyaltyPgmProcParmType (enumeration of type string)
Description
The type of value the parameter can store.

Values are:

  • Constant
  • Formula
  • Variable
value
Field Type
string
Description
The value of the parameter when it is of the type Variable or Formula and isn't of the data type Sobject.

LoyaltyProgramProcessCondition

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.

Field Name Description
conditionCriteria
Field Type
string
Description

Required.

The criteria that determines when the condition is met by a record or by a transaction journal.
conditionFilterCriteria
Field Type
LoyaltyProgramProcessConditionFilterCriteria[]
Description
The filter criteria that determines which records or transaction journals are filtered.
conditionName
Field Type
string
Description

Required.

The name of the condition.

LoyaltyProgramProcessConditionFilterCriteria

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.

Field Name Description
operator
Field Type
LoyaltyPgmProcCondOperator (enumeration of type string)
Description

Required.

The operator of the filter criteria.

Values are:

  • Contains
  • DoesNotContain
  • EndsWith
  • Equals
  • GreaterThan
  • GreaterThanOrEquals
  • IsNotNull
  • IsNull
  • LessThan
  • LessThanOrEquals
  • NotEquals
  • StartsWith
sequence
Field Type
int
Description

Required.

The sequence number of the filter criteria within a condition.
sourceFieldName
Field Type
string
Description

Required.

The name of the field used in the filter criteria.
value
Field Type
string
Description
The value of the filter criteria.
valueType
Field Type
LoyaltyPgmProcCondType (enumeration of type string)
Description

Required.

The type of value specified in the filter criteria.

Values are:

  • Formula
  • Literal
  • Lookup
  • Parameter

LoyaltyProgramProcessRule

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

Field Name Description
actions
Field Type
LoyaltyProgramProcessAction[]
Description
The actions associated with the rule.
conditions
Field Type
LoyaltyProgramProcessCondition[]
Description
The conditions associated with the rule.
description
Field Type
string
Description
The description of the rule.
endDate
Field Type
date
Description
The date until which the rule processes transaction journals.
previousRule
Field Type
string
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
Field Type
string
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
Field Type
string
Description

Required.

The name of the rule.
startDate
Field Type
date
Description
The date from which the rule starts processing transaction journals.
status
Field Type
LoyaltyPgmProcRuleStatus (enumeration of type string)
Description
The status of the rule.

Values are:

  • Active
  • Draft
  • Inactive
stepMappings
Field Type
LoyaltyProgramProcessRuleStepMapping[]
Description
The list of step mappings associated with rule.

LoyaltyProgramProcessAction

Represents a collection of fields relating to an action.

Field Name Description
actionName
Field Type
string
Description

Required.

The name of the action.
actionParameters
Field Type
LoyaltyProgramProcessActionParameter[]
Description
The parameters of the action.
actionType
Field Type
LoyaltyPgmProcActionType (enumeration of type string)
Description

Required.

The type of action.

Values are:

  • CreditPoints—Credits points to the loyalty program member associated with the transaction journal that's processed by the rule.
  • DebitPoints—Debits points from the points balance of the loyalty program member associated with the transaction journal that's processed by the rule.
  • DecisionTable—Invokes a decision table.
  • Flow—Runs a flow
  • IncrementMemberPromotion—Adds the specified value to the loyalty program member's usage towards achieving a cumulative promotion by a specified value.
  • IssueVoucher—Issues a voucher to the loyalty program member associated with the transaction journal that's processed by the rule.
  • ResetMemberPromotion—Updates the loyalty program member's usage towards achieving a cumulative promotion by a specified value.
  • UpdateParameter—Assigns values to parameters.
  • UpdatePointBalance—Updates the points balance of the loyalty program member associated with the transaction journal that's processed by the rule.
decisionTable
Field Type
string
Description
The decision that's invoked by the action for the transaction journal that's processed by the rule.
decisionTableDatasetLink
Field Type
string
Description
The dataset link associated with the selected decision table.
flowDefinition
Field Type
string
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.

LoyaltyProgramProcessActionParameter

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.

Field Name Description
parameterName
Field Type
string
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.
value
Field Type
string
Description

Required.

The value of the parameter.

LoyaltyProgramProcessRuleStepMapping

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

Field Name Description
associatedStep
Field Type
string
Description

Required.

The action that's associated with the mapping.
parentStep
Field Type
string
Description
The condition that contains one or more child actions.
sequence
Field Type
int
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            <actions>
20                <actionName>Issue High Transaction Value Voucher</actionName>
21                <actionParameters>
22                    <operator>Equals</operator>
23                    <parameterName>VoucherDefinitionName</parameterName>
24                    <value>Voucher for High Value Transactions</value>
25                </actionParameters>
26                <actionParameters>
27                    <operator>Equals</operator>
28                    <parameterName>VoucherCode</parameterName>
29                    <value>{!TransactionJournal.Order.Id}</value>
30                </actionParameters>
31                <actionParameters>
32                    <operator>Equals</operator>
33                    <parameterName>VoucherEffectiveDate</parameterName>
34                    <value>DATEVALUE(&quot;2021-11-21 00:00:00&quot;)</value>
35                </actionParameters>
36                <actionParameters>
37                    <operator>Equals</operator>
38                    <parameterName>VoucherExpirationDate</parameterName>
39                    <value>DATEVALUE(&quot;2022-01-01 00:00:00&quot;)</value>
40                </actionParameters>
41                <actionParameters>
42                    <operator>Equals</operator>
43                    <parameterName>VoucherFaceValue</parameterName>
44                    <value>{!VoucherValue}</value>
45                </actionParameters>
46                <actionType>IssueVoucher</actionType>
47            </actions>
48            <conditions>
49                <conditionCriteria>1</conditionCriteria>
50                <conditionFilterCriteria>
51                    <operator>GreaterThanOrEquals</operator>
52                    <sequence>1</sequence>
53                    <sourceFieldName>TransactionJournal.TransactionAmount</sourceFieldName>
54                    <value>100</value>
55                    <valueType>Literal</valueType>
56                </conditionFilterCriteria>
57                <conditionName>New Condition</conditionName>
58                <conditionType>Condition</conditionType>
59            </conditions>
60            <endDate>2022-01-01</endDate>
61            <ruleName>Issue Voucher for Transactions Above $100</ruleName>
62            <startDate>2021-11-21</startDate>
63            <status>Draft</status>
64            <stepMappings>
65                <associatedStep>New Condition</associatedStep>
66                <sequence>1</sequence>
67            </stepMappings>
68            <stepMappings>
69                <associatedStep>Issue High Transaction Value Voucher</associatedStep>
70                <parentStep>New Condition</parentStep>
71                <sequence>1</sequence>
72            </stepMappings>
73        </rules>
74        <status>Draft</status>
75    </programProcesses>
76</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>

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.