---
schema_version: "1"
id: 4d472c777f61b70846ea3dad2c5649f5d1c916a1404a123ce4f0f725799b14ac
title: Workflow for Offering Games to Members
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/loyalty_games_api_workflow.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.loyalty_games_api_workflow.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 66578933418165078f86b7a33f8c3164bc464b21c55858edfeaef8f206d2f4f4
description: After a program manager creates a game and adds its rewards, the game can be offered to customers in several ways. Admins can use Business APIs to enable customers to play games on external systems such as mobile apps or shopping sites. Program managers can also set up processes that assign games to members based on their loyalty activities. Customer service reps can assign games to customers and members as part of service recovery actions.
products:
  - Loyalty Management
release: "264"
---
# Workflow for Offering Games to Members

After a program manager creates a game and adds its rewards, the game can be offered to customers in several ways. Admins can use Business APIs to enable customers to play games on external systems such as mobile apps or shopping sites. Program managers can also set up processes that assign games to members based on their loyalty activities. Customer service reps can assign games to customers and members as part of service recovery actions.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>,&nbsp;<strong>Performance</strong>, <strong>Unlimited</strong>, and&nbsp;<strong>Developer</strong>&nbsp;Editions with Loyalty Management</td></tr></tbody></table>

## How Game Assignment Works

You can either offer the games to all customers or offer the games to customers and members based on a specific activity.

The Game Assignment Required checkbox in a game definition record determines whether a game is available for all customers or not. If the checkbox is deselected in a game definition, then the game is available for all customers to play. If the checkbox is selected, then customers and members are eligible to play the game only after the game is assigned to them.

## Integrate Business API to Show Customers and Members Their Available Games

The [Games Business API](https://developer.salesforce.com/docs/atlas.en-us.loyalty.meta/loyalty/connect_resources_gamification.htm) lists a customer or member’s list of eligible games. You can integrate the API with an external system where customers and members can view and play games.

The API takes the contact ID, account ID, or loyalty program member ID of the person whose list of eligible games you want to get. The API returns the details of the games that the customer or member is eligible to play. The API returns only the eligible games that are active and not the games that are past their end date.

The API creates two records for each game that the API returns:

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d53132e102">Record</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d53132e105">Why the Record is Created</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d53132e108">When The Record is Created</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Record" class="slds-cell-wrap" style="vertical-align:top;" headers="d53132e102 ">Game Participant</td>

            <td data-label="Why the Record is Created" class="slds-cell-wrap" style="vertical-align:top;" headers="d53132e105 ">The record assigns the game to the participant.</td>

            <td data-label="When The Record is Created" class="slds-cell-wrap" rowspan="2" style="vertical-align:top;" headers="d53132e108 ">The game isn’t already assigned to the participant.</td>

          </tr>
          <tr class="">
            <td data-label="Record" class="slds-cell-wrap" style="vertical-align:top;" headers="d53132e102 ">Game Participant Reward</td>

            <td data-label="Why the Record is Created" class="slds-cell-wrap" style="vertical-align:top;" headers="d53132e105 ">
              <p>The record tracks the reward provided to the participant after they play the
                game. After the participant plays the game, the reward details are updated in the
                record.</p>
              <p style="margin-bottom:0;">Though the participant hasn't played the game and won a reward, a Game
                Participant Reward record is created. The Game Participant Reward record contains
                an expiration date and time that decides the date and time until which customers
                can play the game and win a reward. The expiration date and time is automatically
                calculated based on the related game definition's expiration period.</p>
            </td>

          </tr>
        </tbody>
      </table>

## Assign Games to Members for Eligible Loyalty Activities by Using Promotion Setup

As part of member engagement, loyalty program managers can extend rules or design new rules to assign games to members. Before a program manager adds or extends a rule to assign games, they must consider these scenarios:

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d53132e164">Business Requirement</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d53132e167">How to Achieve The Business Requirement</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d53132e170">Examples</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Business Requirement" class="slds-cell-wrap" style="vertical-align:top;" headers="d53132e164 ">Assign games to members for an activity that members are already rewarded
              for.</td>

            <td data-label="How to Achieve The Business Requirement" class="slds-cell-wrap" style="vertical-align:top;" headers="d53132e167 ">
              <p>In the existing process that processes member transactions for the eligible
                activity, program managers can:</p><a name="loyalty_games_api_workflow__ul_dpj_xfn_nfc"><!-- --></a>
              <ul id="loyalty_games_api_workflow__ul_dpj_xfn_nfc">
                <li>Extend a rule to assign games</li>

                <li>Add a rule to assign games</li>

              </ul>
            </td>

            <td data-label="Examples" class="slds-cell-wrap" style="vertical-align:top;" headers="d53132e170 "><a name="loyalty_games_api_workflow__ul_epj_xfn_nfc"><!-- --></a>
              <ul id="loyalty_games_api_workflow__ul_epj_xfn_nfc">
                <li>Members are already rewarded with points when they shop for US$50. In the
                  existing process, the rule that credits points to members is extended to assign
                  games.</li>

                <li>Members are already issued a voucher when they complete a survey. In the
                  existing process, a rule is added to assign games.</li>

              </ul>
            </td>

          </tr>
          <tr class="">
            <td data-label="Business Requirement" class="slds-cell-wrap" style="vertical-align:top;" headers="d53132e164 ">Assign games to members for an activity that the loyalty program didn’t reward
              members for until today.</td>

            <td data-label="How to Achieve The Business Requirement" class="slds-cell-wrap" style="vertical-align:top;" headers="d53132e167 ">Create a process for the eligible activity and add a rule to assign
              games.</td>

            <td data-label="Examples" class="slds-cell-wrap" style="vertical-align:top;" headers="d53132e170 ">The loyalty program didn’t reward members until today for signing up to the
              company’s shopping app. From now, a game is assigned to the member as soon as they
              sign up for the app.</td>

          </tr>
        </tbody>
      </table>

To assign a game to a member, you must add two Create or Update Records actions in the rule:

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d53132e238">Sequence</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d53132e241">Action Details</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d53132e244">Why The Is Action Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Sequence" class="slds-cell-wrap" style="vertical-align:top;" headers="d53132e238 ">1</td>

            <td data-label="Action Details" class="slds-cell-wrap" style="vertical-align:top;" headers="d53132e241 ">Use the action to create a Game Participant record. In the action, specify whom
              you want to assign the game to and the game you want to assign.</td>

            <td data-label="Why The Is Action Needed" class="slds-cell-wrap" rowspan="2" style="vertical-align:top;" headers="d53132e244 ">Assigns the game to the participant and creates a reward record
              that’s updated with the member’s reward after they play the game.</td>

          </tr>
          <tr class="">
            <td data-label="Sequence" class="slds-cell-wrap" style="vertical-align:top;" headers="d53132e238 ">2</td>

            <td data-label="Action Details" class="slds-cell-wrap" style="vertical-align:top;" headers="d53132e241 ">Use the action to create a Game Participant Reward record. In the action,
              specify the reward status as Yet to Reward and the ID of the Game Participant record
              that’s created in the preceding action.</td>

          </tr>
        </tbody>
      </table>

Here's an example of the actions and their input parameters.

![Game assignment rules in a loyalty process rule, including input parameters.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-loyalty_management-264-0-0-production-enus/0590ce3e-5a09-45ab-8e5e-68f359c35886/loyalty_management/images/loyalty_assign_game_input_param.png)

Here's an example of the actions and their output parameters.

![Game assignment rules in a loyalty process rule, including output parameters.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-loyalty_management-264-0-0-production-enus/0590ce3e-5a09-45ab-8e5e-68f359c35886/loyalty_management/images/loyalty_assign_game_output_param.png)

![Tip](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-loyalty_management-264-0-0-production-enus/0590ce3e-5a09-45ab-8e5e-68f359c35886/images/icon_tip.png)

Tip Within the rule that assigns games to members, program managers can add specific conditions that decide when members are assigned a game. For example, you can add a rule to assign a game to the members whenever they shop for $50 and buy a specific product.

## Assign Games to Customers and Members as a Service Recovery Action

Service reps in your company can assign games to customers and members as part of their service recovery action. For example, if a customer receives damaged products or provides the company a low CSAT score for a case, the service rep can offer a game to the participant.

To assign a game, the service rep must create a Game Participant record and a Game Participant Reward record. The service reps can access both items from the App Launcher.

On the Game Participant record, service reps must select the game that they want to assign and whom they want to assign the game to. In the Game Participant Reward record, service reps can select:

- The participant whom the game is assigned to.
    
    The service rep must select the game participant that the game participant record is created for.
- The status of the reward.
    
    The service rep can select the Yet to Reward status because the participant is yet to play the game.
- The source activity that the game was assigned to the participant for.
    
    The service rep can select the promotion or transaction journal that the game is assigned to the participant for.

Service reps don't need to populate the Issued Reward Reference, Game Reward, and Expiration Date fields in the game participant reward record. These fields are automatically populated after the participant plays the game.

## Reward Members for Playing a Game

The [Game Reward Business API](https://developer.salesforce.com/docs/atlas.en-us.loyalty.meta/loyalty/connect_resources_game_result.htm) assigns a reward to participants after they play a game. Integrate the API with an external system where customers and members can play games and view their rewards. Run the API when the participant plays a game and use the output of the API to show the participant their game reward.

The API takes the ID of the game participant reward record as input and returns the details of the reward that the participant has won. Ensure that you specify the ID of the game participant reward record that’s associated with the game participant record that relates the game to the participant.

The API decides the reward to be given to a participant based on the win probability of all the rewards that are part of the game. For example, if a reward’s win probability is 25%, then the chance of a customer winning the reward is 25%.

The API first checks if a member’s current reward count is below the maximum reward count. For example, if the maximum reward count is set to 10 and a member has only received 7 rewards, the API proceeds to the next step. If the member qualifies, the API decides to assign rewards without bias and issues them based on a probabilistic model. It employs a randomizer to decide the rewards, ensuring that all members are treated fairly. For instance, if there are 100 members eligible for rewards, the randomizer might select 20 of them to receive a reward, with each member having an equal chance of being selected.

After the API provides the result, the game participant reward record that was provided in the input is updated with these details:

- Game Reward—Associates the game reward provided to the member.
- Status—Changes to Rewarded.
- Issue Reward Reference—Associates the voucher that was issued to the member or the transaction journal that credited the points to the member.
- Expiration Date—Gets updated with the date when the issued voucher expires or the credited points expire.
- Source Activity—Associates the transaction journal that represents the member activity that made the member eligible to play the game.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-loyalty_management-264-0-0-production-enus/0590ce3e-5a09-45ab-8e5e-68f359c35886/images/icon_note.png)

Note To automatically generate voucher codes, turn on the Generate Codes for Vouchers setting. For more information on enabling the setting, see [Enable Automatic Generation of Voucher Codes](https://help.salesforce.com/s/articleView?id=xcloud.voucher_code_generation_setting.htm&release=264.0.0&type=5 "Automate the process of generating unique codes for vouchers that are issued to members.").