> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omneo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Transactions

> Completed, immutable purchase or return records linked to a customer profile.

A **Transaction** in Omneo is a completed, immutable record of a purchase or return. Once created, transactions cannot be edited, they are the source of truth for what a customer has bought and at what value.

Transactions are the primary driver of incentive calculations, aggregations, and tier progression.

## Key characteristics

* **Immutable**: transactions cannot be modified after creation. If a correction is needed, you must delete and recreate, or use the return mechanism.
* **Attribution**: transactions can be attributed to a known profile, or created as anonymous (guest) transactions that are later claimed.
* **Multi-channel**: transactions can originate from in-store POS, eCommerce, or manual entry via the API.
* **Side effects**: creating a transaction triggers Omneo to recalculate points, aggregations, tier progress, and any configured reactions.

## Transaction vs order

| Concept         | Description                                                                               |
| --------------- | ----------------------------------------------------------------------------------------- |
| **Transaction** | A completed, finalised purchase or return. Immutable.                                     |
| **Order**       | An unfinalised record (web order, layby). Mutable. Can become 0, 1, or many transactions. |

Orders are the "in-progress" state. Once payment is confirmed and the order is finalised, one or more transactions are created. The order remains as a reference record.

## Transaction fields

| Field         | Description                                      |
| ------------- | ------------------------------------------------ |
| `profile_id`  | The profile this transaction belongs to          |
| `external_id` | The POS or eCommerce receipt/order number        |
| `total`       | Total transaction value                          |
| `subtotal`    | Pre-discount total                               |
| `tax`         | Tax amount                                       |
| `discount`    | Total discount applied                           |
| `currency`    | Currency of the transaction                      |
| `location_id` | Store or location where the transaction occurred |
| `staff_id`    | Staff member who processed the transaction       |
| `occurred_at` | Date and time the transaction took place         |
| `items`       | Array of transaction line items (products)       |

## Transaction items

Each transaction contains one or more **Transaction Items**: individual product lines within the transaction. Each item has its own product reference, quantity, unit price, discount, and tax.

## Claiming anonymous transactions

Transactions created without a profile ID are stored as anonymous (guest) transactions. Customers can later claim these transactions by submitting their receipt details via Profile Portal or a claim flow, the transaction is then attributed to their profile and incentive calculations are applied retroactively.

## Incentive side effects

When a transaction is created with a profile, Omneo:

1. Recalculates points based on active point definitions
2. Updates profile aggregations (spend, frequency, etc.)
3. Evaluates tier progress
4. Fires any configured reactions (e.g., issue a reward on spend milestone)
