> For the complete documentation index, see [llms.txt](https://help.openloyalty.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.openloyalty.io/technical-guide/data-exports/data-structure-and-types/unit-transfers.md).

# Unit Transfers

Every unit transfer (added, spent, expired, blocked, transferred), exported daily as a delta file.

The Unit Transfers file contains every unit movement on member wallets: units added, spent, expired, blocked, and transferred between members.

{% hint style="info" %}
**Delta export.** Each daily file contains the transfers that were created or updated during that day. A transfer reappears whenever its state changes, for example when it is cancelled or a pending transfer becomes active. Upsert on `transferId` and keep the row with the latest `updatedAt`.
{% endhint %}

**File:** `analytics/Points/points_YYYY_MM_DD.csv`\
**Primary key:** `transferId`

A sample file is provided below:

{% file src="/files/4MZ2BGCf6scdBa3CYuhv" %}

**Available Data** (in column order, see Column types for how each type is written):

<table data-header-hidden="false" data-header-sticky><thead><tr><th>Column</th><th width="131.06640625">Type</th><th width="154.05859375">Can be empty</th><th>Description</th></tr></thead><tbody><tr><td><code>transferId</code></td><td>uuid</td><td>No</td><td>Unique ID of the transfer</td></tr><tr><td><code>tenantId</code></td><td>uuid</td><td>No</td><td>ID of the tenant where the transfer was created</td></tr><tr><td><code>points</code></td><td>decimal</td><td>No</td><td>Number of units in the transfer. <strong>Always a positive number.</strong> Use <code>type</code> to determine the direction (see <a href="#transfer-types">Transfer types</a>).</td></tr><tr><td><code>memberId</code></td><td>uuid</td><td>No</td><td>ID of the member who owns the wallet</td></tr><tr><td><code>walletId</code></td><td>uuid</td><td>No</td><td>ID of the wallet (links to <code>walletId</code> in the Wallet Balance file and <code>defaultAccount.accountId</code> in the Members file)</td></tr><tr><td><code>walletTypeCode</code></td><td>string</td><td>No</td><td>Code of the wallet type</td></tr><tr><td><code>firstName</code></td><td>string</td><td>Yes</td><td>Member's first name</td></tr><tr><td><code>lastName</code></td><td>string</td><td>Yes</td><td>Member's last name</td></tr><tr><td><code>email</code></td><td>string</td><td>Yes</td><td>Member's email address</td></tr><tr><td><code>phone</code></td><td>string</td><td>Yes</td><td>Member's phone number</td></tr><tr><td><code>loyaltyCardNumber</code></td><td>string</td><td>Yes</td><td>Member's loyalty card number</td></tr><tr><td><code>type</code></td><td>enum</td><td>No</td><td>Type of the transfer: <code>adding</code>, <code>p2p_adding</code>, <code>spending</code>, <code>p2p_spending</code>, <code>blocked</code>, <code>expired</code> (see <a href="#transfer-types">Transfer types</a>)</td></tr><tr><td><code>createdAt</code></td><td>datetime</td><td>No</td><td>Date when the transfer was created</td></tr><tr><td><code>expiredAt</code></td><td>datetime</td><td>Yes</td><td>Date when the units of this transfer expire or are scheduled to expire</td></tr><tr><td><code>cancelled</code></td><td>boolean</td><td>Empty = false</td><td>Whether the transfer is cancelled</td></tr><tr><td><code>cancelledAt</code></td><td>datetime</td><td>Yes</td><td>Date when the transfer was cancelled</td></tr><tr><td><code>locked</code></td><td>boolean</td><td>Empty = false</td><td>Whether the transfer is currently pending, meaning its units are not yet active</td></tr><tr><td><code>unlockAt</code></td><td>datetime</td><td>Yes</td><td>Date when a pending transfer is scheduled to become active</td></tr><tr><td><code>comment</code></td><td>string</td><td>Yes</td><td>Comment on the transfer (for example a manual comment, the campaign name, or the reward name)</td></tr><tr><td><code>campaignId</code></td><td>uuid</td><td>Yes</td><td>ID of the campaign that created the transfer</td></tr><tr><td><code>transactionId</code></td><td>uuid</td><td>Yes</td><td>ID of the transaction that triggered the transfer</td></tr><tr><td><code>customEventId</code></td><td>uuid</td><td>Yes</td><td>ID of the custom event that triggered the transfer</td></tr><tr><td><code>internalEventName</code></td><td>string</td><td>Yes</td><td>Name of the internal event that triggered the transfer</td></tr><tr><td><code>performedAt</code></td><td>datetime</td><td>Yes</td><td>Business date of the transfer (the transaction's purchase date or the custom event's <code>eventDate</code>)</td></tr><tr><td><code>updatedAt</code></td><td>datetime</td><td>No</td><td>Date when the transfer was last updated</td></tr><tr><td><code>labels</code></td><td>json array</td><td>Yes</td><td>JSON with the custom attributes set on the transfer</td></tr></tbody></table>

**Transfer types**

<table data-header-hidden><thead><tr><th width="147.83984375"></th><th width="104.9375"></th><th></th></tr></thead><tbody><tr><td><code>type</code></td><td>Direction</td><td>Meaning</td></tr><tr><td><code>adding</code></td><td>+</td><td>Units added (campaign, manual, import). Can be pending (<code>locked</code>) and can be cancelled.</td></tr><tr><td><code>p2p_adding</code></td><td>+</td><td>Units received from another member</td></tr><tr><td><code>spending</code></td><td>−</td><td>Units spent, for example on a reward</td></tr><tr><td><code>p2p_spending</code></td><td>−</td><td>Units sent to another member</td></tr><tr><td><code>blocked</code></td><td>−</td><td>Units blocked. Can be cancelled, which releases them.</td></tr><tr><td><code>expired</code></td><td>−</td><td>Units that expired. Each expiry creates a <strong>new</strong> <code>expired</code> row. The original <code>adding</code> row is not modified.</td></tr></tbody></table>

{% hint style="warning" %}
Because `points` is always positive, a plain sum of the column is meaningless. Apply the sign from the table above before aggregating. See Reconciliation for how to rebuild a wallet balance from this file.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.openloyalty.io/technical-guide/data-exports/data-structure-and-types/unit-transfers.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
