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

# Sync Accounts

export const RememberCallout = ({title, children, icon = "🪢"}) => <div style={{
  backgroundColor: 'var(--recommended-bg)',
  borderLeft: '4px solid #f63b92',
  borderRadius: '10px',
  padding: '18px 22px',
  marginBottom: '20px',
  boxShadow: '1px 1px 3px rgba(0,0,0,0.06)'
}}>
    <div style={{
  display: 'flex',
  alignItems: 'flex-start',
  gap: '14px'
}}>
      <span style={{
  fontSize: '22px',
  lineHeight: '1',
  flexShrink: 0
}}>
        {icon}
      </span>
      <div>
        {title && <div style={{
  fontSize: '16px',
  fontWeight: 600,
  color: 'var(--recommended-title)',
  marginBottom: '6px'
}}>
            {title}
          </div>}
        <div style={{
  fontSize: '14px',
  lineHeight: 1.65
}}>
          {children}
        </div>
      </div>
    </div>
  </div>;

This page describes the Chart of Accounts Sync reconciliation process: synchronising active accounts from the Accounting System with Accounts in Pleo.

This step runs on every Chart of Accounts Sync cycle.

## Implementation

* [Chart of Accounts Sync Workflow Guide](/docs/current/guides/accounting-integrations/imports/accounts-sync-workflow-guide): workflow context and sequencing
* [How to Sync Accounts](/docs/current/how-tos/accounting-integrations/imports/accounts/how-to-sync-accounts): API usage and step-by-step instructions

For a conceptual overview of how AS accounts map to Pleo Accounts, see [Platform Capabilities: Chart of Accounts Sync](/docs/current/platform/accounting-integrations/imports/accounts/accounts-sync-overview).

## Matching Rules

* Matching is performed using the **`externalId`** field on both ends.
* The `externalId` is the long-lasting identifier of the account in the Accounting System.
* Name and code are not used for matching, only `externalId` is used.

## Sync Process

```mermaid theme={null}
%%{init: {"themeVariables": {"fontSize": "24px"}}}%%
flowchart TD
    A[1. Fetch active Accounts from AS] --> B[2. Fetch active and archived Accounts from Pleo]
    B --> C[3. Match each AS Account to Pleo Account by externalId]
    C -->|Found, Pleo<br> active, <br>details match| D[Preserve Account as-is]
    C -->|Found, Pleo<br> active, <br>details differ| E[Update name and code]
    C -->|Found, Pleo<br> archived| F[Unarchive Account and update if needed]
    C -->|Not found| G[Create new Account]
    D --> H[Continue to next account]
    E --> H
    F --> H
    G --> H
    C -->|Pleo active, <br>no matching<br> AS Account| I[4. Archive unmatched Accounts]

    style A white-space:normal
    style B white-space:normal
    style C white-space:normal
    style D white-space:normal
    style E white-space:normal
    style F white-space:normal
    style G white-space:normal
    style H white-space:normal
    style I white-space:normal
```

### 1. Fetch Active Accounts from the AS

Retrieve all active accounts from the Accounting System's Chart of Accounts.

Only active accounts are used for reconciliation. Inactive, blocked, or archived accounts in the AS are not synced into Pleo.

### 2. Fetch Accounts from Pleo

Retrieve both **active and archived** Accounts from Pleo for the connected company.

Including archived Accounts allows unarchiving rather than creating duplicates if an account becomes active in the AS again.

### 3. Match Accounts by externalId

For every active AS account, attempt to find a matching Account in Pleo using the `externalId` field on both ends.

#### externalId found, Account is active in Pleo, details match

The AS account is active and the matching Pleo Account is also active with the same name and code. No action required.

#### externalId found, Account is active in Pleo, details differ

The AS account is active and the matching Pleo Account is also active, but the name or code differs. **Update** the Account's name and code to match the AS.

#### externalId found, Account is archived in Pleo

The AS account is active but the matching Pleo Account is archived. **Unarchive** the Account and update its name and code if they differ from the AS.

#### externalId not found

The AS account is active but no matching Pleo Account exists. **Create a new Account** with the account's name, code, and externalId.

### 4. Archive Unmatched Accounts

Pleo Accounts that are active but have no matching active AS account must be **archived**.

This covers accounts that were previously present in the AS but have since been deactivated, blocked, or removed.

<RememberCallout title="Remember">
  Accounts are never permanently deleted. Archiving preserves historical data and allows unarchiving if the account becomes active in the AS again.
</RememberCallout>

## Default Tax Code Reference

If the Accounting System has a default tax code per account, that identifier can be stored in Pleo via the `taxCodeExternalId` field on the Account.

This is a reference only. Pleo **does not** automatically link it to a Tax Code in Pleo, apply it to expenses, or update the default tax code on any category mapped to the account. Partners can read this field back and use it to inform their own logic if needed.

***

## What Comes Next?

* [Chart of Accounts Sync Data Mapping](/docs/current/integration-design/accounting-integrations/imports/accounts/integration-design-accounts-data-mapping)

***

## Related Reading

* [How to Sync Accounts](/docs/current/how-tos/accounting-integrations/imports/accounts/how-to-sync-accounts)
* [Chart of Accounts Sync Workflow Guide](/docs/current/guides/accounting-integrations/imports/accounts-sync-workflow-guide)
* [Platform Capabilities: Chart of Accounts Sync](/docs/current/platform/accounting-integrations/imports/accounts/accounts-sync-overview)

***
