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

# Customers

> Customers in Spicom are created automatically when you import contracts via CSV.

# Customers

In Spicom, **customers are not created manually**.\
They are automatically generated when you import contracts using a CSV file that includes a `customer_name` column.

Every contract must belong to one customer, and the customer is created on-the-fly during the import process.

<Callout type="warning">
  The field <code>customer\_name</code> is required for every contract.\
  If it is missing, the import will fail.
</Callout>

***

## How Customers Are Created

Customers are created **indirectly** through your CSV import.

When Spicom processes a contract line in the CSV:

* If `customer_name` **does not exist yet**, a **new customer** is created.
* If `customer_name` **already exists**, the contract is linked to that customer.
* If `customer_email` is provided, it is attached to the customer the first time it appears.

This ensures your customer list stays clean and consistent.

***

## Required Field

### `customer_name`

This is the only required field for customer creation.\
It must be:

* a string
* non-empty
* consistent across your CSV rows

Example:

Acme Corp
Acme corp
ACME CORP

→ would create **three separate customers** because they differ.

<Callout type="tip">
  Use consistent naming in your CSV to prevent duplicates.
</Callout>

***

## How Spicom Uses Customers

Once customers exist, Spicom automatically groups contracts under them to compute:

* **Total monthly revenue**
* **Workforce cost allocation**
* **Share of global costs**
* **Real margin per customer**

All values update instantly whenever contracts, workforce, or global costs change.

***

## Customer Overview Example

| Metric                | Value     |
| --------------------- | --------- |
| Contracts             | 3         |
| Total monthly revenue | €3,800    |
| Workforce cost        | €2,450    |
| Global cost share     | €480      |
| **Real margin**       | **€870**  |
| **Margin %**          | **22.8%** |

***

## Best Practices

* Keep <code>customer\_name</code> exactly identical across all CSV rows belonging to the same client.
* Include a customer email whenever possible.
* Avoid trailing spaces, typos, or inconsistent casing.
* Validate your CSV before importing large datasets.
