Loyalty Accounts

How to Create Loyalty Accounts & Transfer Store Credit

This document provides a comprehensive guide on how to create loyalty accounts within a sales channel and transfer store credit between these accounts.

Before creating a loyalty account, make sure the user for whom you intend to create a loyalty account already has a registered account in the sales channel.

Registered accounts can be viewed in Omnitron on the Sales Channels > Users page.

Enabling Loyalty Money Dynamic Setting

The first step is to enable the LOYALTY_MONEY_ENABLED dynamic setting for making loyalty money enabled for payment transactions.

To enable loyalty money for payment transactions, follow these steps:

  1. Follow the Sales Channels > Sales Channel Settings sidebar and click the Dynamic Settings page.

  2. Among the existing dynamic settings, locate the LOYALTY_MONEY_ENABLED setting and click on it.

  3. Set its Value to Yes, click the Save button. This will enable the loyalty money transaction for the relevant sales channel.

Creating Loyalty Accounts

To create loyalty accounts, follow these steps:

  1. Follow the Sales Channels > Sales Channel Settings sidebar and click the Loyalty Accounts page.

  2. Click the + New Loyalty Account button located in the upper right corner of the page.

  3. When you click the add button, a form will open for entering account details. The fields in this form and their explanations are as follows:

    • Account ID: This field is optional and can be left blank.

    • User PK: This field will automatically populate after selecting the next field, User Email.

    • User Email: After typing the complete user’s email address that is registered in the sales channel, this address will be filtered. Select the filtered email address.

    • Balance: Enter the amount of store credit to be assigned to the loyalty account.

    • Debit Card Allowed: Choose whether the balance assigned to the account will go into a negative value when it runs out. (To avoid any potential balance issues, it is recommended to select “Yes”.)

    • Currency: Enter the currency for the loyalty account.

    NOTE: Multiple accounts for the same user cannot be created with the same currency. However, you can create multiple accounts for the same user with different currencies.

  4. After entering all fields correctly (these cannot be edited later), click the OK button to create the account.

Transferring Store Credit Between Accounts

Store credit can be transferred between the loyalty accounts that you have created. The recommended scenario is to create a primary account for distributing store credit and then transfer from this primary account to customer accounts.

To transfer store credit between loyalty accounts, follow these steps:

  1. Filter and locate the loyalty account from which you want to make the transfer, as created in the previous step. Click on the corresponding row to go to the Loyalty Account Detail page.

  2. At the top of this page, you will find summary information about the account on the Account Information section. From here, you can check the account balance.

  3. In the second section of the page, you will find the Create Transfer section, where the transfer will take place.

    • Transfer To (Account ID): Select the loyalty account to which the transfer will be made from the list.

    • Transfer Amount: Enter the amount of store credit you want to transfer in the specified currency.

  4. Click the Save button to complete the transfer.

  5. When you click Save, you will see a notification message at the top of the page. The transfer is completed successfully once the message disappears, and the transfer transaction will be reflected in the Account Activities section at the bottom of the page.

Understanding the Flow of Partial Loyalty Money Usage

After selecting a payment method with LoyaltyMoneyRule, we will examine the steps to understand if the request to LoyaltyMoneyUsagePage does not work as expected. Follow the all steps outlined in this page to perform these actions, then review the relevant scenarios.

Example Scenario 1: LoyaltyMoney Partial Usage Request

GET Sending Request to LoyaltyMoney Usage Page

A request is sent to the LoyaltyMoneyUsagePage with the intention of using LoyaltyMoney for a partial amount of the order.

Path: https://{storefront_url}/orders/checkout/?page=LoyaltyMoneyUsagePage

Request Body

{}

Response

{
    "context_list": [
        {
            "page_context": {
                "balance": "50.00"     // ( The total amount in the user's loyalty account )
            },
            "page_name": "LoyaltyMoneyUsagePage",
            "page_slug": "loyaltymoneyusagepage"
        }
    ],
    "template_name": "orders/checkout.html",
    "errors": null,
    "pre_order": {...}
}

POST Loyalty Money Usage

A request is sent to the LoyaltyMoneyUsagePage, specifying the amount of LoyaltyMoney the user intends to use.

Path: https://{storefront_url}/orders/checkout/?page=LoyaltyMoneyUsagePage

Request Body

{
    "loyalty_amount_to_use": "10.00"    //(The Loyalty amount the user wishes to use on the shop. )
}

Response

{
    "context_list": [
        {
            "page_context": {},
            "page_name": "EmptyPage",
            "page_slug": "emptypage"
        }
    ],
    "template_name": "orders/checkout.html",
    "errors": null,
    "pre_order": {...}
}

POST Complete Loyalty Money Payment

A request is sent to the LoyaltyMoneyPage for the completion of the order with LoyaltyMoney as the payment method.

Path: https://{storefront_url}/orders/checkout/?page=LoyaltyMoneyPage

Request Body

{
    "agreement": true
}

Response

{
    "context_list": [
        {
            "page_context": {
                "redirect_url": "/orders/completed/IjcwMjExMjMyMTA5MTci:1mRByT:tTgDsJbIKXyxJZyIZwHIBqtShvw/",
                "order_id": 303,
                "new_user": false,
                "token": "138ddd19a0436166354cccbacb4cbb0473104193",
                "campaigns": []
            },
            "page_name": "ThankYouPage",
            "page_slug": "thankyoupage"
        }
    ],
    "template_name": "orders/checkout.html",
    "errors": null,
    "pre_order": {...}
}

Example Scenario 2: Full Amount LoyaltyMoney Usage

LoyaltyMoney Usage Request:

  • A request is made to the LoyaltyMoneyUsagePage to use LoyaltyMoney for a portion of the order amount.

  • Consequently, the CreditCard payment option becomes selectable again.

CreditCard Flow:

  • Progress is made up to the InstallmentSelectionPage.

LoyaltyMoney Usage Request (Full Amount):

  • A request is sent to the LoyaltyMoneyUsagePage to pay the entire order amount using LoyaltyMoney.

  • Consequently, the CreditCard payment option becomes inactive, and an error occurs when attempting to send a request to the InstallmentSelectionPage, returning an error message.

Last updated

Was this helpful?