# Manage data for profile-based loyalty programs

> You can manage the data of each profile-based loyalty program directly from the program dashboard.

> For the complete documentation index, see [llms.txt](https://docs.talon.one/llms.txt).

<FeatureAccessInfoBox/>

## Import loyalty points

Import loyalty points from a marketing or BI tool into Talon.One.
When you import points, they are added to potential existing points for the given
customer profile.

1. On the leftmost menu, click <Loyalty className="icon"/> **Loyalty**.
1. Click the name of the program where you want to import points.
1. In the top-right corner of the dashboard,
   click **Manage Loyalty Data** > <Import className="icon"/> **Import Loyalty Points**.
1. In the pop-up that appears, click <Import className="icon"/> **Upload a CSV File** to select a CSV file of loyalty
   points from your computer.

   :::tip
   - To see the required structure of the CSV file, click **Download a sample file**.
   - To learn more about the required structure of the CSV file,
     see the [API docs](/management-api#tag/Loyalty/operation/importLoyaltyPoints).
   :::

1. Click **Import Loyalty Points**.

## Import customers into loyalty tiers

After creating a profile-based loyalty program, you can import customers into the
tiers. The behavior of the import is as follows:

- If the customer isn't already in a tier, they are assigned to the tier specified in the CSV file during the import.
- If the customer is already in a tier, but the tier doesn't match the one in the CSV file, they are assigned to a new tier that matches the information in the CSV file.
- If the customer is already in the tier that is specified in the CSV file, only the expiration date is updated.

To import the customers:

1. On the leftmost menu, click <Loyalty className="icon"/> **Loyalty**.
1. Click the name of the loyalty program that contains the tiers you want to populate.
1. In the top-right corner of the dashboard, click
   **Manage Loyalty Data** > <Import className="icon"/> **Import Customers into Tiers**.
1. In the pop-up that appears, click <Import className="icon"/> **Upload a CSV File** to select a CSV file of loyalty
   tiers from your computer.

   :::tip
   - To see the required structure of the CSV file, click **download a sample file**.
   - To learn more about the required structure of the CSV file,
     see the [API docs](/management-api#tag/Loyalty/operation/importLoyaltyCustomersTiers).
   - We recommend limiting your file size to 500 MB.
   :::

1. Click **Import Customers into Tiers**.

## Export the transaction logs

Download a CSV file with all loyalty point transactions made by a given customer. You can

customer behavior.

1. On the leftmost menu, click <Loyalty className="icon"/> **Loyalty**.
1. Click the name of the program whose transaction logs you want to export.
1. In the top-right corner of the dashboard,
   click **Manage Loyalty Data** > <Export className="icon"/>  **Export Transactions Logs**.
1. In **Transaction logs after**, set the initial date.
1. (Optional) In **Transaction logs before**, set the end date. The default end date is the
   current date.
1. In **Date format**, select the date format of your choice.
1. In **Customer integration ID**, enter the [ID of the customer](/docs/product/applications/display-customer-profiles.md).
1. Click **Export Data**.

   :::note
   The time in exported transaction logs is in UTC.
   :::

:::note
You can also export the transaction logs for a given customer from their specific [customer
profile](/docs/product/applications/display-customer-profiles).
:::

## Export the loyalty balances

Download a CSV file containing the point balances of all users of a loyalty program for a
given date and time. Use it to get the number of [active, pending, expired, and spent points](/docs/product/loyalty-programs/profile-based/profile-based-overview.md#points-overview)
for each customer.

1. On the leftmost menu, click <Loyalty className="icon"/> **Loyalty**.
1. Click the name of the program whose balance you want to export.
1. In the top-right corner of the dashboard,
   click **Manage Loyalty Data** > <Export className="icon"/> **Export Loyalty Balance**.
1. In **Date and time**, select the date and time for which you want to export the loyalty
   balance.
1. Click **Export Loyalty Balance**.

:::note
In the exported file, all timestamp values follow `UTC+00:00`.
:::

## Export loyalty tier data

Download a CSV file containing the user profiles belonging to specific tiers.

<FeatureAccessInfoBox>
Only users with permissions to manage a loyalty program can export its loyalty tier data.
</FeatureAccessInfoBox>

1. On the left-most menu, click <Loyalty className="icon"/> **Loyalty**.
1. Click the name of the program whose tier data you want to export.
1. At the top right of the dashboard, click **Manage Loyalty Data** > <Export className="icon"/> **Export Loyalty Tiers**.
1. In **Tier name**, select the tier whose data you want to export.
1. In **Subledger name**, select the subledger of your choice.
   :::note
   If the loyalty program has no subledgers, the **Main ledger** is selected by default.
   :::
1. Click **Export Loyalty Tiers**.

:::note
If you do not select any **Tier name** or **Subledger name**, the CSV file will
contain data from all the tiers and subledgers that exist in the loyalty program.
:::

## Export the dashboard data

Download a CSV file with program member data, program point data, or
all [the dashboard](/docs/product/loyalty-programs/profile-based/profile-based-overview.md#the-loyalty-dashboard) data.
You can export the dashboard data for the entire loyalty program, the main ledger,
or for a specific subledger.

:::note
A member is a customer with active or pending points in the loyalty program.
:::

To export the dashboard data:

1. On the leftmost menu, click <Loyalty className="icon"/> **Loyalty**.
1. Click the name of the program whose transaction log you want to export.
1. To export the dashboard data for:
   - The entire loyalty program:

     In the top right corner of the dashboard,
     click **Manage Loyalty Data** > <Export className="icon"/> **Export Dashboard Data**.
   - A specific subledger:
     1. From the **Subledger** dropdown, select a subledger name.
     1. To the right of the time frame filters, click <Export className="icon"/> **Export**.
1. Click **Custom** and set custom start and end dates or select a predefined time frame:
  - **Yesterday**: The previous day.
  - **7D**: The previous 7 days.
  - **30D**: The previous 30 days.
  - **3M**: The previous 3 months.
  - **6M**: The previous 6 months.
  - **YTD**: Year to date.
  - **Max**: The maximum time period for which data is available.

  :::note
  The predefined time frames do not include the current day. For example, if the current date
  is October 8 and you selected **7D** as your preferred time frame, you'll see data for
  October 1-7, including the first day and the last day.
  :::
1. Choose what data you want to export:
   - **Program members overview**, including all new members per day and the total number
     of members.
   - **Points total overview** for all active points, pending points, and expired points.
   - **Earned and redeemed points**, including those managed manually and by the Rule Builder.
   - All the options above.

   :::note
   If you are exporting data from **Members Overview**, **Program members overview** is
   selected by default. If you are exporting data from **Points Overview**, **Points total overview**
   and **Earned and redeemed points** are the default selection.
   :::
1. Click **Export Dashboard Data**.

## Obtain the loyalty transactions of a customer

Programmatically get information about the loyalty point transactions of an individual user
and, for example, provide this data to your customers. To do so, use the
[List customer's loyalty transactions](/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions)
endpoint.

You can filter transactions by date and select how many you want to obtain. If you don't apply
filters, you obtain the last 50 loyalty transactions for the given [integration ID](/docs/product/applications/display-customer-profiles.md#customer-profile-overview).

:::note
Unlocking a [reward](/docs/product/rewards/overview.md) also creates a loyalty transaction that deducts the points required to unlock it.
:::

## Obtain the loyalty balances of a customer

Programmatically get information about the [loyalty point balances](/docs/product/loyalty-programs/profile-based/profile-based-overview.md#points-overview)
of an individual user. You can provide this data to your customers so they are aware of how
many points they can use, or how many points they have already spent.

Use the [Get customer's loyalty balances](/integration-api#tag/Loyalty/operation/getLoyaltyBalances)
endpoint to obtain the following loyalty point balances:

- Active points
- Pending points
- Spent points
- Expired points
- Negative points

You can filter balances by date, and obtain loyalty points balances for past dates too. If
you don't apply filters, you obtain all points balances on the current date for the given
[integration ID](/docs/product/applications/display-customer-profiles.md#customer-profile-overview).

:::important
When a customer uses their loyalty points, the oldest active points that are about to expire
are redeemed first.
:::

## Manually add loyalty points

To manually add loyalty points to your customer's wallet:

1. On the left-side menu of your Application, click <Customers className="icon"/> **Customers**.
1. Select the **Customer Integration ID** of your choice and click the **Loyalty Points** tab.
1. In **Loyalty program**, select the program to which you want to add points.
1. In **Ledger**, select the ledger to which you want to add points.
1. Click <Settings className="icon"/> > <Add className="icon"/> **Add Points**.
1. In **Points**, enter the number of points to add to the customer's wallet.
1. In **Reason**, enter the reason for adding the points.
1. In **Start date**, select when the points become active.
   - With **Program default**, the points become active based on the date set in the
     loyalty program.
   - With **Immediate**, the points become active immediately.
   - In **Custom**, you can choose **Relative start** or **Absolute start**.

     {
<details>
  <summary>Examples: Points activation relative to session closure</summary>
    
      For all the examples mentioned in this table, we assume that the customer session
      closes on <code>12 October 2024, 07:20:50</code>.
    
    
      
      <colgroup>
	      <col span="2" style={{width:50+"%"}}/>
	    </colgroup>
      
        
          Time after session closure
          Points become active on
        
      
      
        
          
            <code>1</code> days, Same time as session closure
          
          
            <code>13 October 2024, 07:20:50</code>
          
        
        
          
            <code>1</code> days, Start of day (00:00:00)
          
          
             <code>13 October 2024, 00:00:00</code>
          
        
        
          
            <code>1</code> days, End of day (23:59:59)
          
          
            <code>13 October 2024, 23:59:59</code>
          
        
        
          
            <code>1</code> weeks, Same weekday as session close
          
          
           <code>19 October 2024, 07:20:50</code>
          
        
        
          
            <code>1</code> weeks, End of week (Sunday 23:59:59)
          
          
           <code>20 October 2024, 23:59:59</code>
          
        
        
          
            <code>1</code> months, Same day as session closure
          
          
            <code>12 November 2024, 07:20:50</code>
          
        
        
          
            <code>1</code> months, End of month (23:59:59)
          
          
            <code>30 November 2024, 23:59:59</code>
          
        
      
      
    
</details>
}
1. In **Expiry date**, select when the points expire.
   - With **Program default**, the points expire based on the date set in the loyalty
     program.
   - With **Unlimited**, the points stay active for an unlimited period of time.
   - In **Custom**, you can choose **Relative expiration** or **Absolute expiration**.

     {
<details>
  <summary>Examples: Points expiry relative to start date</summary>
    
      For all the examples mentioned in this table, we assume:
        
        The customer session closes on <code>12 October 2024, 07:20:50</code>.
        The rewarded loyalty points are active immediately.
        
    
    
      
      <colgroup>
	      <col span="2" style={{width:50+"%"}}/>
	    </colgroup>
      
        
          Time after start date
          Points expire on
        
      
      
        
          
            <code>1</code> days, Same time as start date
          
          
            <code>13 October 2024, 07:20:50</code>
          
        
        
          
            <code>1</code> days, Start of day (00:00:00)
          
          
             <code>13 October 2024, 00:00:00</code>
          
        
        
          
            <code>1</code> days, End of day (23:59:59)
          
          
            <code>13 October 2024, 23:59:59</code>
          
        
        
          
            <code>1</code> weeks, Same weekday as start date
          
          
           <code>19 October 2024, 07:20:50</code>
          
        
        
          
            <code>1</code> weeks, End of week (Sunday 23:59:59)
          
          
           <code>20 October 2024, 23:59:59</code>
          
        
        
          
            <code>1</code> months, Same day as start date
          
          
            <code>12 November 2024, 07:20:50</code>
          
        
        
          
            <code>1</code> months, End of month (23:59:59)
          
          
            <code>30 November 2024, 23:59:59</code>
          
        
      
      
    
</details>
}
1. Click **Add Points**.

## Manually deduct loyalty points

To manually deduct loyalty points from your customer's wallet:

1. On the left-side menu of your Application, click <Customers className="icon"/> **Customers**.
1. Select the **Customer Integration ID** of your choice and click the **Loyalty Points** tab.
1. In **Loyalty program**, select the program from which you want to deduct points.
1. In **Ledger**, select the ledger from which you want to deduct points.
1. Click <Settings className="  icon"/> > <Deduct className="icon"/> **Deduct Points**.
1. In **Points**, enter the number of points to deduct from the customer's
   wallet.

   The number of points to be deducted can exceed the active points balance only if [negative points](/docs/product/loyalty-programs/profile-based/use-negative-points) balance is enabled for the loyalty program.

   - **Negative balance enabled**: If negative points balance is enabled for the loyalty program, you can deduct more points than the active points balance.

   - **Negative balance disabled**: If negative points balance is not enabled for the loyalty program, you can deduct a number of points less than or equal to the current active points balance.

1. In **Reason**, enter the reason for deducting the points.
1. Click **Deduct Points**.

## Related pages

- [Display customer profiles](/docs/product/applications/display-customer-profiles.md)
- [Display customer sessions](/docs/product/applications/display-customer-sessions.md)
- [Use subledgers](/docs/product/loyalty-programs/use-subledgers.md)
- [Get customer's loyalty balances endpoint](/integration-api#tag/Loyalty/operation/getLoyaltyBalances)
