> ## 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.

# Transaction mapping

> How an Indigo 8 POS invoice becomes an Omneo Transaction and a sales order becomes an Order, including which invoices are recorded and how each field maps.

Every Indigo 8 POS invoice becomes an Omneo Transaction. This page lists what each Transaction and line item is built from, so you can reconcile an invoice in Indigo 8 against the Transaction Omneo recorded.

## Which invoices are recorded

Each scheduled run reads the POS invoices dated on the current day and the previous day. The following rules apply:

| Rule | Result |
| - | - |
| The invoice's fulfilment location is listed in `exclude_fulfillment_ids` | The invoice is skipped. |
| No Profile holds the Indigo 8 Identity for the invoice's contact | Omneo rejects the invoice and records nothing. Contacts import before invoices in each run, so a new customer normally has a Profile by the time their invoice is read. |
| Omneo has already recorded the invoice | The existing Transaction is updated. Its line items are not added a second time, and its transaction date does not change. |

## Transaction fields

| Omneo field | Source in the Indigo 8 invoice |
| - | - |
| `external_id` | `Invoice_Number`. This is the unique key. |
| `receipt_ref` | `Invoice_Number`. |
| `order_number` | `SO_Number`, the sales order the invoice belongs to. |
| `profile_id` | The Profile holding the Indigo 8 Identity whose value is the invoice's `Contact_ID`. |
| `total` | `Invoice_Amount_IncTax`. |
| `transacted_at` | `Sale_Date` and `Sale_Time`, read as Melbourne time (`Australia/Melbourne`) and converted to UTC. |
| `currency` | `Sell_Currency`, when your tenant has that currency. |
| `location_id` | The Location matched from `Fulfillment_ID` and `Fulfillment_location`. A Location is created when none matches. See [Location matching](/extensions/indigo8/profile-sync#location-matching). |
| `staff_id` | `Salesperson_ID`. See [Staff](#staff). |
| `fees` | One entry per invoice extra, such as freight, carrying `Extra_Description` as the description and `Extra_Price` as the amount. Omitted when the invoice has no extras. |

## Line items

Each Indigo 8 invoice line becomes one Transaction item.

| Omneo field | Source in the Indigo 8 invoice line |
| - | - |
| `external_id` | The line position, starting at 0. |
| `name` | `Barcode`. |
| `quantity` | `Qty`. |
| `price_original` | `RRP`. |
| `price_current` | `Price_WTax`, the price including tax. |
| `price_sell` | `Price_After_Disc`, or `Price_WTax` when the line has no discounted price. |
| `price_tax` | `Price_WTax` divided by 11, which assumes a 10% tax is included in the price. |
| Product variant | The Product variant whose barcode is `Barcode`. Products import before invoices in each run, so new styles are in Omneo first. See [Product sync](/extensions/indigo8/product-sync). |

### Discounts

When the invoice carries a `Discount_Code` and a line has a `Price_After_Disc`, the line gets one entry in its `discounts` array:

| Discount field | Value |
| - | - |
| `amount` | `Price_WTax` minus `Price_After_Disc`, to two decimal places. |
| `reason_desc` | The invoice's `Discount_Code`. |

## Staff

Omneo matches the invoice's salesperson to a staff Profile through a `staff` Identity whose value is the Indigo 8 `Salesperson_ID`. When no staff Profile matches, Omneo creates one with:

* a first and last name taken from `Salesperson_Name`,
* a placeholder email address in the form `[Salesperson_ID]-I8-staff@example.com`,
* the status `staff`, and
* the `staff` Identity.

## Sales orders

Sales order import is available but is not part of the default schedule. When it is enabled for your tenant, each Indigo 8 sales order becomes an Omneo Order. Orders are mutable, so a sales order that Omneo has already recorded is updated in place. See [Orders](/concepts/commerce/orders).

| Omneo field | Source in the Indigo 8 sales order |
| - | - |
| `external_id`, `order_number`, `receipt_ref` | `SO_Number`. |
| `profile_id` | The Profile holding the Indigo 8 Identity whose value is the order's `Contact_ID`. |
| `total` | `Sale_Value_IncTax`. |
| `transacted_at` | `Sale_Date`, converted to UTC. |
| `currency` | `Sell_Currency`, when your tenant has that currency. |
| `location_id` | The Location whose `external_code` or `external_id` is `Fulfillment_ID`. A Location is created when none matches. |

Each order line carries its `Qty`, its `Barcode` as the name and Product variant, and `Price_Inc_Tax` as the original, current, and sell price. Sales orders carry no staff, discounts, or extras.

## Custom field mapping

The mappings above are the defaults. The `mapping` setting can add or override fields without an Omneo release. It holds a list of entries for each record type:

| Key | Applies to |
| - | - |
| `contact` | Contacts imported from Indigo 8 (applied when a Profile is created), and Profiles pushed to Indigo 8. |
| `order` | Invoices and sales orders. |
| `product` | Products. |
| `productVariant` | Product variants. |

Each entry names a path in the Indigo 8 record (`indigo8_id`) and the Omneo field it maps to (`omneo_id`). Dotted paths write nested fields. An entry can also:

* apply a `default` when the record has no value,
* convert the value with `format`, either `toString` or `parseBool`, and
* select one item from a list by matching one of its properties, using `where`, `eq`, and `value_of`.

Custom entries are applied after the default fields, so an entry that targets one of them overrides it. The Identity, tag, and Locations set on a new Profile cannot be overridden. Contact your Omneo account manager to configure them.

## Related

* [Indigo 8 overview](/extensions/indigo8/overview)
* [Transactions](/concepts/commerce/transactions)
* [Orders](/concepts/commerce/orders)
* [Transaction API](/api-reference/transaction)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.