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

# Profile sync

> How Indigo 8 contacts become Omneo Profiles, how Profile changes reach Indigo 8, and how delegated Profile creation keeps both systems in step from the start.

The Indigo 8 extension keeps Indigo 8 contacts and Omneo Profiles aligned in both directions. Contacts come into Omneo on the hourly import, Profile changes go out to Indigo 8 as they happen, and an Identity links each pair.

## Indigo 8 to Omneo

Each scheduled run reads the contacts created or changed in Indigo 8 on the current day and the previous day. A contact whose email address contains the `exclude_email_pattern` text is skipped.

### How a Profile is matched

Omneo tries each step in order and stops at the first match.

<Steps>
  <Step title="By Identity">
    The Indigo 8 `Contact_ID` is looked up as an Omneo Identity, using the handle configured for your tenant, `indigo8` by default.
  </Step>

  <Step title="By email">
    Omneo matches on the contact's email address.
  </Step>

  <Step title="By creating a Profile">
    A contact that matches no Profile creates one.
  </Step>
</Steps>

### Updating a matched Profile

Omneo compares the contact with the matched Profile and updates the Profile only when one of these fields differs:

| Omneo field | Source in the Indigo 8 contact |
| - | - |
| `first_name` | `Contact_First`, or `Unknown` when blank. Compared without regard to case or surrounding spaces. |
| `last_name` | `Contact_Last`, or `Unknown` when blank. Compared the same way. |
| `email` | `Contact_Email`, when present. |
| `joined_at` | `Created_Date`, read as Melbourne time (`Australia/Melbourne`) and converted to UTC. |
| `mobile_phone` | `Contact_Phone`, when it is a valid phone number. Numbers without a country code are read as Australian. |
| `birth_day`, `birth_month` | `Contact_Birthday`, in the form `Mar 05`. Indigo 8 does not supply a birth year. |

When Omneo updates a Profile that was matched by email, it also adds the Indigo 8 Identity to it. Addresses, locations, and custom mappings are not changed on a matched Profile.

### Creating a Profile

A new Profile takes the fields above, plus:

| Omneo field | Value |
| - | - |
| `email` | `Contact_Email`. A contact with no email address is given a placeholder in the form `[Contact_ID]@example.com` so the Profile can still be created. |
| `joined_location_id`, `preferred_location_id` | The Location matched from the contact's `Store_ID`. See [Location matching](#location-matching). |
| `addresses` | One address built from `Contact_Address1`, `Contact_Address2`, `Contact_City`, `Contact_State`, `Contact_Country`, and `Contact_Zip`. Added only when the first line, city, postcode, country, and state are all present and the country and state match ones Omneo knows, by name or ISO code. |
| `identities` | The Indigo 8 Identity, holding the `Contact_ID`. |
| `tags` | `created-indigo8`. |

Custom contact mappings are applied when the Profile is created. See [Custom field mapping](/extensions/indigo8/transaction-mapping#custom-field-mapping).

### Location matching

Indigo 8 contacts and invoices name a store by its Indigo 8 ID. Omneo matches that ID to a Location in this order:

1. A Location custom field written by an earlier import (see below).
2. The Location's `external_code`.
3. The Location's `external_id`.
4. The Location's name, ignoring case, against the Indigo 8 store name.

When nothing matches, Omneo creates a Location named after the Indigo 8 store, with the Indigo 8 ID as its `external_id` and `external_code` and the tag `created-indigo8`. Either way, Omneo records the Indigo 8 ID on the Location as a custom field in the namespace `indigo8-[subdomain]-contact-store-id` (for contacts) or `indigo8-[subdomain]-invoice-fulfillment-id` (for invoices), handle `id`, so later imports match it directly.

To control the names and details of your Locations, create them in CX Manager before the first import and set their `external_id` or `external_code` to the Indigo 8 ID. See [Locations](/concepts/commerce/locations).

## Omneo to Indigo 8

When a Profile is created or updated in Omneo, the extension creates or updates the Indigo 8 contact.

* If the Profile already carries the Indigo 8 Identity, that contact is updated.
* Otherwise Indigo 8 creates or matches a contact, and Omneo adds the returned `Contact_ID` to the Profile as its Indigo 8 Identity.

| Indigo 8 field | Source in the Omneo Profile |
| - | - |
| `Contact_First` | `first_name` |
| `Contact_Last` | `last_name` |
| `Contact_Email` | `email` |
| `Avail_Points` | `combined_balance_dollars`, the combined dollar value of the Profile's rewards and redeemable points. See [Core fields](/concepts/profiles/core-fields). |
| `Contact_Phone` | `mobile_phone`, when present. |
| `Contact_Address1`, `Contact_Address2`, `Contact_City`, `Contact_State`, `Contact_State_Code`, `Contact_Country`, `Contact_Country_code`, `Contact_Zip` | The Profile's address, each field only when present. |
| `Contact_Birthday` | The full birth date, in the form `YYYY-MM-DD`. Sent only when the Profile has a birth day, month, and year. |

Custom contact mappings are applied on top of these fields.

## Delegated Profile creation

By default, a Profile created in Omneo reaches Indigo 8 a moment later through the Profile webhook. With delegated Profile creation turned on, Omneo hands the creation of every new Profile to the extension instead:

<Steps>
  <Step title="Indigo 8 first">
    The extension creates the contact in Indigo 8.
  </Step>

  <Step title="Omneo second">
    The extension creates the Profile in Omneo with the new `Contact_ID` already attached as its Indigo 8 Identity, and Omneo returns that Profile to the caller.
  </Step>
</Steps>

Every new Profile therefore has an Indigo 8 contact from the moment it exists, whichever channel created it. If Indigo 8 cannot be reached, Omneo still creates the Profile, and the Indigo 8 contact follows through the Profile webhook.

Delegated Profile creation is a tenant-level setting that Omneo turns on for you. See [Setup](/extensions/indigo8/setup).

## Related

* [Indigo 8 overview](/extensions/indigo8/overview)
* [Identities](/concepts/profiles/identities)
* [Profiles](/concepts/profiles/overview)
* [Locations](/concepts/commerce/locations)


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