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

# Company Rules

> Configure how companies are matched, how customer numbers are handled, and how company fields are mapped between HubSpot and Tripletex.

Use **Company Rules** to control how the integration searches for existing customers in Tripletex and how new customer data should be created from HubSpot.

## Company search property

Select the search parameter for the sync to decide which HubSpot field should be used to search for existing customers in Tripletex.

Choose a field that is stable and likely to be unique, such as a company name, email, phone number, or VAT-related identifier.

<Frame>
  ![Company Search Property](https://framerusercontent.com/images/qKrpm53ktHQRVnsTC3mR4GPia4.png?height=939\&width=1920)
</Frame>

### Example

If you use the company name field in HubSpot and map it to the customer name field in Tripletex:

* the integration will search Tripletex using that value
* if a match is found, the customer will be updated
* if no match is found, a new customer will be created

This helps reduce duplicate customers.

<Note>
  If the selected search field is missing, the sync can fail.
</Note>

## Tripletex customer number preference

Go to the **Tripletex customer number preference** section.

You can choose one of two ways to handle customer numbers when a new customer is created.

<Frame>
  ![Tripletex Customer Number Preference](https://framerusercontent.com/images/KAl8NT9QVX9bqyaDlhnV8dgVLU.png?height=939\&width=1920)
</Frame>

### Option 1: Let Tripletex create the customer number

Choose **Let Tripletex create the customer number** if you want Tripletex to generate the customer number automatically.

Then select the HubSpot field where that generated number should be stored.

### Option 2: Take Tripletex customer number from HubSpot

Choose **Take Tripletex customer number from HubSpot** if you want a HubSpot field to provide the customer number that should be used in Tripletex.

## Company field mappings

Use **Company field mappings** to control which HubSpot company properties populate the matching fields in Tripletex when a new customer is created.

Some fields may already be mapped by default.

To edit mappings:

1. Open the mapping tab
2. Use **Actions**
3. Click **Edit Mapping**

<Frame>
  ![Company Field Mappings](https://framerusercontent.com/images/7QZvVqlaPf6txT3L3xJGpQEOxuw.png?height=942\&width=1903)
</Frame>

<Note>
  Make sure your search field and customer number strategy are set before enabling sync. This helps keep customer creation predictable and avoids duplicates.
</Note>
