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

# Customer - cus_*

> Tables in the Customer data package (cus_*).

The Customer package contains the core identity and profile data of customers, including contact information, address details, loyalty card information, linked customers and current consent status. It serves as the master data foundation for linking loyalty activity, communication targeting, app usage and transactional behaviour across the platform.

## Scope

This package includes:

* Customer identity and contact data
* Address information
* Loyalty card details
* Household or linked-customer relationships
* Consent definitions and current consent status per user

It does not include behavioural data, transactions, campaign activity, or historical consent events.

## Key Principle

The Customer package represents **who the customer is and their current state**, not what they have done.

## Address — `cus_address`

### Definition

| Property     | Type   | Description                                                      |
| ------------ | ------ | ---------------------------------------------------------------- |
| CustomerId   | string | Foreign key referencing the customer to whom the address belongs |
| City         | string | City where the customer lives                                    |
| ZipCode      | string | Postal code of the customer's address                            |
| Region       | string | Region where the customer lives                                  |
| CountryCode  | string | Code of country where the customer lives                         |
| AddressLine1 | string | Street name and street number                                    |
| AddressLine2 | string | Apartment number                                                 |

### Sample data

| CustomerId | City   | ZipCode | Region         | CountryCode | AddressLine1         | AddressLine2 |
| ---------- | ------ | ------- | -------------- | ----------- | -------------------- | ------------ |
| 001        | Aarhus | 2100    | Capital Region | DK          | Østerbrogade 12      | 3rd Floor    |
| 002        | Aarhus | 8000    | Midtjylland    | DK          | Søndergade 45        | Apt 12       |
| 003        | Berlin | 10115   | Berlin         | DE          | Friedrichstrasse 101 | 2B           |

## Consent — `cus_consent`

### Definition

| Property      | Type      | Description                                                    |
| ------------- | --------- | -------------------------------------------------------------- |
| Id            | int       | Internal surrogate key for the consent record (Primary Key)    |
| ConsentId     | string    | External consent identifier                                    |
| Key           | string    | Consent key, unique across consent types (e.g., agreement.cpl) |
| Name          | string    | Multilingual names (by language code ISO-639-1) of the consent |
| Component     | string    | Component to which this consent corresponds                    |
| Version       | int       | Version number of the consent definition                       |
| Revision      | int       | Revision number of the consent definition                      |
| IsActive      | boolean   | Represents whether the consent is active                       |
| IsPublished   | boolean   | Indicates whether the consent is published                     |
| EffectiveFrom | timestamp | Consent effective-from date/time (UTC, ISO-8601)               |
| ExpiresAt     | timestamp | Consent expiration date/time (UTC, ISO-8601)                   |
| ConsentType   | string    | Consent type                                                   |

### Sample data

| Id | ConsentId | Key             | Name              | Component | Version | Revision | IsActive | IsPublished | EffectiveFrom        | ExpiresAt            | ConsentType   |
| -- | --------- | --------------- | ----------------- | --------- | ------- | -------- | -------- | ----------- | -------------------- | -------------------- | ------------- |
| 1  | 021       | agreement.cpl   | Marketing Consent | loyalty   | 1       | 0        | true     | true        | 2024-01-01T00:00:00Z | 2025-01-01T00:00:00Z | Communication |
| 2  | 092       | agreement.email | Email Consent     | crm       | 2       | 1        | true     | true        | 2024-02-01T00:00:00Z | 2025-02-01T00:00:00Z | Marketing     |
| 3  | 023       | agreement.sms   | SMS Consent       | crm       | 1       | 0        | false    | false       | 2024-03-01T00:00:00Z | 2024-12-31T00:00:00Z | Communication |

## Customer — `cus_customer`

### Definition

| Property         | Type      | Description                                                                 |
| ---------------- | --------- | --------------------------------------------------------------------------- |
| Id               | string    | Id of customer                                                              |
| FirstName        | string    | Customer first name                                                         |
| LastName         | string    | Customer last name                                                          |
| Phone            | string    | Customer phone number                                                       |
| Email            | string    | Customer Email                                                              |
| Birthdate        | date      | Date of birth (date-time, UTC)                                              |
| SelectedStoreId  | string    | Id of the selected store                                                    |
| IsActive         | boolean   | Determines whether the customer is active                                   |
| CreatedAt        | timestamp | Date of customer creation (UTC)                                             |
| ExternalMetadata | string    | Metadata of the customer (e.g. JSON with external system attributes)        |
| LoyaltyProgram   | string    | Loyalty Program or Tier for the Customer (examples: Silver, Gold, Freemium) |
| IsEmployee       | boolean   | Determines whether the customer is an employee                              |
| Nationality      | string    | Nationality or country of the customer                                      |
| PersonalId       | string    | Id of the person (Employee bonuses feature)                                 |
| Gender           | string    | Gender of the person                                                        |

### Sample data

| Id  | FirstName | LastName | Phone       | Email                                       | Birthdate            | SelectedStoreId | IsActive | CreatedAt            | ExternalMetadata | LoyaltyProgram | IsEmployee | Nationality | PersonalId | Gender |
| --- | --------- | -------- | ----------- | ------------------------------------------- | -------------------- | --------------- | -------- | -------------------- | ---------------- | -------------- | ---------- | ----------- | ---------- | ------ |
| 001 | Anna      | Jensen   | +4512345678 | [anna.j@email.dk](mailto:anna.j@email.dk)   | 1990-04-12T00:00:00Z | 091             | true     | 2024-01-15T10:22:11Z | "source":"app"   | Gold           | false      | DK          | 071        | Female |
| 002 | Lars      | Nielsen  | +4598765432 | [lars.n@email.dk](mailto:lars.n@email.dk)   | 1985-09-03T00:00:00Z | 052             | true     | 2023-11-02T08:45:55Z | "source":"erp"   | Silver         | true       | DK          | 088        | Male   |
| 003 | Maria     | Olsen    | +4911122233 | [maria.o@email.de](mailto:maria.o@email.de) | 1993-07-21T00:00:00Z | 083             | false    | 2024-03-08T16:01:44Z | "source":"app"   | Freemium       | false      | DE          | 045        | Female |

## Customer Consent — `cus_customerconsent`

### Definition

| Property         | Type      | Description                                                                                           |
| ---------------- | --------- | ----------------------------------------------------------------------------------------------------- |
| Id               | int       | Internal surrogate key for the user-consent record (PK).                                              |
| ConsentId        | int       | Foreign key to consent definition selected by the user.                                               |
| CustomerId       | string    | Identifier of the user who accepted/revoked the consent.                                              |
| IsActive         | boolean   | Indicates whether the consent is currently active for the user.                                       |
| AcceptedAt       | timestamp | UTC date/time when consent was accepted by the user (ISO 8601).                                       |
| AcceptedBy       | string    | Who accepted the consent (e.g., user, service representative); free-form string.                      |
| ActivationSource | string    | Source that triggered activation (examples: WEB, EMAIL, TELEF, SKM, BUTIK, MOAPP, M16AP, FRDKA, KNB). |
| RevokedAt        | timestamp | UTC date/time when consent was revoked (NULL if still active).                                        |
| RevokedBy        | string    | Who revoked the consent (e.g., user, service representative); free-form string.                       |

### Sample data

| Id | ConsentId | CustomerId | IsActive | AcceptedAt           | AcceptedBy   | ActivationSource | RevokedAt            | RevokedBy |
| -- | --------- | ---------- | -------- | -------------------- | ------------ | ---------------- | -------------------- | --------- |
| 1  | 1         | 021        | false    | 2024-01-05T09:15:00Z | user         | WEB              | 2024-03-15T08:20:00Z | user      |
| 2  | 2         | 052        | false    | 2024-02-10T14:30:00Z | service\_rep | EMAIL            | 2025-03-20T08:20:00Z | user      |
| 3  | 3         | 033        | true     | 2024-02-11T14:30:00Z | user         | TELEF            | NULL                 | NULL      |

## Linked Customer — `cus_linkedcustomer`

### Definition

| Property          | Type      | Description                                                                            |
| ----------------- | --------- | -------------------------------------------------------------------------------------- |
| PrimaryCustomerId | string    | Id of primary customer in the link.                                                    |
| RelatedCustomerId | string    | Id of related customer in the link.                                                    |
| CreatedAt         | timestamp | Creation timestamp (UTC, ISO 8601).                                                    |
| RelationshipType  | string    | Type of relationship between customers (Enum: MergedMembership, AdditionalCardHolder). |

### Sample data

| PrimaryCustomerId | RelatedCustomerId | CreatedAt            | RelationshipType     |
| ----------------- | ----------------- | -------------------- | -------------------- |
| 001               | 002               | 2024-01-10T09:00:00Z | AdditionalCardHolder |
| 003               | 004               | 2024-02-15T14:30:00Z | MergedMembership     |
| 005               | 006               | 2024-03-20T11:45:00Z | AdditionalCardHolder |

## Loyalty Card — `cus_loyaltycard`

### Definition

| Property   | Type      | Description                                     |
| ---------- | --------- | ----------------------------------------------- |
| Id         | string    | Id of loyalty card (primary key).               |
| CustomerId | string    | Id of customer owning this card.                |
| CreatedAt  | timestamp | Date and time of card creation (UTC, ISO 8601). |
| UpdatedAt  | timestamp | Date and time of card update (UTC, ISO 8601).   |
| State      | string    | Loyalty card state.                             |
| Type       | string    | Loyalty card type.                              |

### Sample data

| Id  | CustomerId | CreatedAt            | UpdatedAt            | State    | Type     |
| --- | ---------- | -------------------- | -------------------- | -------- | -------- |
| 001 | 011        | 2024-01-01T09:00:00Z | 2024-01-01T09:00:00Z | Active   | Virtual  |
| 002 | 022        | 2024-02-10T10:15:00Z | 2024-02-12T08:30:00Z | Active   | Physical |
| 003 | 033        | 2024-02-12T14:30:00Z | 2024-02-20T14:35:00Z | Inactive | Virtual  |

## Customer Identity — `cus_customer_identity`

### Definition

| Property   | Type      | Description                                                 |
| ---------- | --------- | ----------------------------------------------------------- |
| Id         | string    | Id of the customer identity record                          |
| CustomerId | string    | Id of the customer                                          |
| CreatedAt  | timestamp | Date and time of customer identity creation (UTC, ISO 8601) |

### Sample data

| Id  | CustomerId | CreatedAt            |
| --- | ---------- | -------------------- |
| 001 | 028        | 2024-01-01T09:00:00Z |
| 002 | 093        | 2024-03-11T09:00:00Z |
| 003 | 027        | 2024-02-08T09:00:00Z |
