# Manage data for card-based loyalty programs

> You can import and export loyalty card data, update card statuses, link cards to customer profiles, and manually add to or deduct points from loyalty cards.

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

<FeatureAccessInfoBox/>

## Import loyalty cards into a program

You can import a CSV file containing [loyalty cards](/docs/product/loyalty-programs/card-based/card-based-overview.md)
into a loyalty program at any time.

:::note
Cards can be imported with or without [customer profiles linked to them](/docs/product/loyalty-programs/card-based/card-based-overview.md#linked-customers), depending on whether your import file contains Customer IDs.
:::

1. On the leftmost menu, click <Loyalty className="icon"/> **Loyalty**.
1. Click the name of the card-based loyalty program where you want to import cards.
1. At the top-right of the page,
   click **Manage Loyalty Data** > <Upload className="icon"/> **Import Loyalty Cards**.
1. In the pop-up that appears, click **Upload a CSV file**.

   :::tip
   To see the required structure of the CSV file, click **Download a sample file**.
   :::

1. Select a CSV file with the cards you want to import.
1. Click **Import Cards**.

## Link customer profiles to a loyalty card

Link one or more [customer profiles](/docs/product/applications/display-customer-profiles.md)
to a given [loyalty card](/docs/product/loyalty-programs/card-based/card-based-overview.md)
programmatically.

When a customer profile is [linked to a card](/docs/product/loyalty-programs/card-based/manage-loyalty-cards.md#link-customer-profiles-to-a-loyalty-card),
the card is set as **Registered**. You can then use the [**Loyalty card is registered** condition](/docs/product/rules/conditions/available-conditions.md#loyalty-conditions)
to create different rules and restrict the use of cards that are not registered. For example,
you can create a referral code or display a given notification only if the loyalty card has
customer profiles linked to it.

To link a customer profile to a card, use the [Link customer to loyalty card](/integration-api#tag/Loyalty-cards/operation/linkLoyaltyCardToProfile)
endpoint.

:::tip
[Edit the **card user limit**](/docs/product/loyalty-programs/manage-loyalty-programs.md#manage-general-program-settings)
in the loyalty program <Settingsmenu className="icon"/> **Settings** to modify the number of customers that can be linked to
the loyalty card.
:::

Once a customer profile is linked to a loyalty card, we start collecting data, such as the
card's [balances and transaction logs](/docs/product/loyalty-programs/card-based/card-based-overview.md#transactions),
for that specific profile. You can then share this information with your customer.

:::note
The card code and the card's loyalty balances and transaction logs originally come from
the integration layer's requests to the [List customer data](/integration-api#tag/Customer-profiles/operation/getCustomerInventory) endpoint.
:::

## Import loyalty points into a card

You can import loyalty points into a [loyalty card](/docs/product/loyalty-programs/card-based/card-based-overview.md#list-loyalty-cards)
at any time:

1. On the leftmost menu, click <Loyalty className="icon"/> **Loyalty**.
1. Click the name of the loyalty program where you want to import points.
1. At the top-right of the page, click **Manage Loyalty Data** > <Up className="icon"/> **Import Loyalty Points**.
1. In the pop-up that appears, click <Up 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**.
   :::

1. Click **Import Loyalty Points**.

## Export loyalty cards

Download a CSV file containing the loyalty cards in your loyalty program. You can use the
exported card codes to, for example, print physical loyalty cards or integrate with other
tools.

1. On the leftmost menu, click <Loyalty className="icon"/> **Loyalty**.
1. Click the name of the card-based loyalty program containing the cards you want to
   export.
1. At the top-right of the page,
   click **Manage Loyalty Data** > <Download className="icon"/> **Export Loyalty Cards**.
1. (Optional) To export only the loyalty cards that belong to a specific batch, in
   **Batch ID**, enter a batch ID. If you don't specify one, all the loyalty cards in the
   loyalty program are exported.
1. In **Date format**, select the date format of your choice.
1. Click **Export Loyalty Cards**.

## Export the transaction logs

Download a CSV file with the loyalty point transactions made with [a given card](/docs/product/loyalty-programs/card-based/card-based-overview.md).
This allows you, for example, to import this data in other BI tools to analyze the use of
the card.

{/* :::note
Unlocking a [reward](/docs/product/rewards/overview.md) connected to a card-based loyalty program creates a loyalty transaction that deducts points equal to the reward's **Points required** setting.
::: */}

1. On the leftmost menu, click <Loyalty className="icon"/> **Loyalty**.
1. Click the name of the card-based loyalty program containing the card whose transaction
   logs you want to export.
1. Find the card you want to export, then
   click <Settings className="icon"/> > <Download className="icon"/> **Export Transaction Logs**.

   :::note
   You can also export the transaction logs from the [**Transactions** tab](/docs/product/loyalty-programs/card-based/card-based-overview.md#transactions)
   of the loyalty card page.
   :::

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 **Code**, enter the [identification code of the card](/docs/product/loyalty-programs/card-based/card-based-overview.md#list-loyalty-cards)
   you want to export.
1. In **Date format**, select the date format of your choice.
1. Click **Export Data**.

## Export the loyalty balances

Download a CSV file containing the 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#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. At the top-right of the dashboard, click **Manage Loyalty Data** > <Down 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`.
:::

## Transfer loyalty data to a new card

In case of a broken, stolen, or lost loyalty card, you can copy the original card data
to a newly created card.

The new card has the same [linked customers](/docs/product/loyalty-programs/card-based/card-based-overview.md#linked-customers)
and the same [loyalty point balances and transactions](/docs/product/loyalty-programs/card-based/card-based-overview.md#transactions)
as the original one, but its [code](/docs/product/loyalty-programs/card-based/card-based-overview.md#list-loyalty-cards)
is different. The new card's status is <StateLabel type="active" name="Active" />.

:::important
The status of the original card is updated to <StateLabel type="blocked" name="Blocked" />
after the new card is created. You cannot reactivate the card or transfer data from it
again, but you can export the transaction logs at any time.
:::

1. On the leftmost menu, click <Loyalty className="icon"/> **Loyalty**.
1. Click the name of the loyalty program that contains the card you want to
   transfer and block.
1. To the left of the card you want to transfer and block,
   click <Settings className="icon"/> > **Transfer & Block**.
1. In **New code**, enter a unique identification code for the new loyalty card.
1. In **Reason**, enter the reason for transferring and blocking the existing card.
1. Click **Transfer & Block**.
1. In the pop-up that appears, click **Transfer & Block**.

:::note
You can also transfer data to a new card and block the old card via the <Settings className="icon" /> button
from the loyalty card page or by using the [Transfer loyalty card data](/management-api#tag/Loyalty-cards/operation/transferLoyaltyCard)
endpoint.
:::

## Change a loyalty card status

You can manually update the status of a loyalty card.

To activate a loyalty card:

1. On the leftmost menu, click <Loyalty className="icon"/> **Loyalty**.
1. Click the name of the loyalty program containing the card you want to activate.
1. Find the card you want to activate, then
   click <Settings className="icon"/> > <Success className="icon"/> **Activate**

:::tip
You can also activate a loyalty card on the loyalty card page.
:::

To deactivate a loyalty card:

1. On the leftmost menu, click <Loyalty className="icon"/> **Loyalty**.
1. Click the name of the loyalty program containing the card you want to deactivate.
1. Find the card you want to deactivate, then
   click <Settings className="icon"/> > <Disable className="icon"/> **Deactivate**.

:::tip
You can also deactivate a loyalty card on the loyalty card page.
:::

## Manually add loyalty points

You can manually add loyalty points to a loyalty card.

1. On the leftmost menu, click <Loyalty className="icon"/> **Loyalty**.
1. Click the name of the loyalty program that contains the card you want to manually add
   points to.
1. Click the **code** of the required card.
1. Click the **Transactions** tab.
1. To the right of the **Ledgers** dropdown,
   click <Settings className="icon"/> > <Add className="icon"/> **Add Points**.
1. In **Points**, enter the number of points you want to add.
1. In **Reason**, enter the reason for adding points.
1. In **Start date**, select when your points become active.
   - With **Program default**, the points become active based on the
     date set in the loyalty program.
     :::note
     You can [edit the default start date](/docs/product/loyalty-programs/manage-loyalty-programs.md#manage-general-program-settings)
     in the loyalty program.
     :::
   - With **Immediate**, the points become active immediately.
   - In **Custom**, you can choose a **Relative start date** or an **Absolute start date**.

     {
<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 your points expire.
   - With **Program default**, the points expire based on the date set in the loyalty program.
     :::note
     You can [edit the default expiration date](/docs/product/loyalty-programs/manage-loyalty-programs.md#manage-general-program-settings)
     in the loyalty program.
     :::
   - With **Unlimited**, the points stay active for an unlimited period of time.
   - In **Custom**, you can choose a **Relative expiration date** or an **Absolute expiration date**.

     {
<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

You can manually deduct loyalty points from a loyalty card.

1. On the leftmost menu, click <Loyalty className="icon"/> **Loyalty**.
1. Click the name of the loyalty program that contains the card you want to manually
   deduct points from.
1. Click the **code** of the required card.
1. Click the **Transactions** tab.
1. To the right of the **Subledgers** dropdown,
   click <Settings className="icon"/> > <Deduct className="icon"/> **Deduct Points**.
1. In **Points**, enter the number of points you want to deduct.
1. In **Reason**, enter the reason for deducting points.
1. Click **Deduct Points**.

## Delete a loyalty card

You can delete a loyalty card at any point. By deleting a loyalty card, you also delete the
corresponding loyalty point Transactions, lists of linked customers, and metadata.

1. On the leftmost menu, click <Loyalty className="icon"/> **Loyalty**.
1. Click the name of the card-based loyalty program containing the card you want to delete.
1. Find the card you want to delete, then
   click <Settings className="icon"/> > <Delete className="icon"/> **Delete**.
1. In the pop-up that appears, click **Delete Card**.

:::note
You can also delete a loyalty card via the <Settings className="icon"/> button on the loyalty card page.
:::

## Related pages

- [Loyalty card overview](/docs/product/loyalty-programs/card-based/card-based-overview.md)
- [Use subledgers](/docs/product/loyalty-programs/use-subledgers.md)
