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

# Chart of Accounts Sync Overview

export const CoASyncDirectionDiagram = () => {
  const diagram = `
%%{init: {"themeVariables": {"fontSize": "18px"}}}%%
flowchart RL

subgraph AS["Accounting System / ERP"]
    source["Chart of Accounts"]
end

subgraph Integration["Chart of Accounts Sync Integration"]
    sync["Sync Logic + Reconciliation Engine"]
end

subgraph Pleo["Pleo"]
    target["Accounts"]
end

AS -.-> Integration
Integration -->|"Pleo Chart of Accounts API"| Pleo

style source white-space:normal
style sync white-space:normal
style target white-space:normal
style AS fill:none,stroke:#000000
style Integration fill:none,stroke:#000000
style Pleo fill:none,stroke:#000000
`;
  return <Mermaid chart={diagram} />;
};

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 section describes how to implement Chart of Accounts Sync between an Accounting System and Pleo.

It maps Chart of Accounts entries from the Accounting System to the equivalent Chart of Accounts in Pleo. Synchronisation is one-way, from the Accounting System into Pleo. The integration is responsible for all sync orchestration, reconciliation, and API operations.

The pages in this section cover the detailed implementation requirements for the sync process.

<CoASyncDirectionDiagram />

Chart of Accounts Sync is the first step in Pleo's account-to-expense chain. Accounts synced here are what bookkeepers assign to expense categories; stale or missing accounts result in exports referencing incorrect account data.

For the full account-to-expense chain, see [Platform Capabilities: Chart of Accounts Sync](/docs/current/platform/accounting-integrations/imports/accounts/accounts-sync-overview).

## Chart of Accounts Sync Execution Model

Chart of Accounts Sync is a deterministic reconciliation process executed by the integration.

On each sync run, the integration:

1. Retrieves active Accounts from the Accounting System
2. Retrieves the current state of Accounts from Pleo (active and archived)
3. Reconciles Pleo to match the Accounting System state
4. Applies the required create, update, unarchive, and archive operations via the Pleo API

<RememberCallout title="Remember">
  The goal of each sync run is to make Pleo reflect the current state of the Chart of Accounts in the Accounting System.
</RememberCallout>

Each sync run must be independent, repeatable, and produce a consistent end state.

## High-Level Process

```mermaid theme={null}
%%{init: {"themeVariables": {"fontSize": "12px"}}}%%
flowchart LR
    subgraph Cycle["Recurring Sync Cycle"]
        B[Sync Triggered]
        C[Fetch Active Accounts from AS]
        D[Fetch Active and Archived Accounts from Pleo]

        subgraph Step["Reconcile Accounts"]
            E[Match by externalId]
            F[Create / Unarchive / Update / Preserve]
            G[Archive Unmatched]
            E --> F --> G
        end

        B --> C --> D --> E
        G --> K[Sync Complete]
    end

    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 K white-space:normal
    style Cycle fill:none,stroke:#000000
    style Step fill:none,stroke:#000000
```

## Matching Model

Accounts are matched to their AS counterparts using the `externalId` field. For full matching rules, see [Sync Accounts](/docs/current/integration-design/accounting-integrations/imports/accounts/integration-design-accounts-sync).

## Sync Process

Chart of Accounts Sync runs as a single reconciliation step on every sync cycle.

The integration fetches all active accounts from the Accounting System and all accounts (active and archived) from Pleo, then reconciles the two using the `externalId` field.

### Reconciliation Outcomes

| Condition                                       | Result                                             |
| ----------------------------------------------- | -------------------------------------------------- |
| Matching active Account in Pleo, details match  | Preserve existing Account                          |
| Matching active Account in Pleo, details differ | Update Account name and code to match AS           |
| Matching archived Account in Pleo               | Unarchive Account and update details if needed     |
| No matching Account in Pleo                     | Create new Account with name, code, and externalId |

After all Accounting System accounts are processed, any remaining active Accounts in Pleo that had no match are archived.

For the full reconciliation algorithm and step-by-step implementation instructions, see [Sync Accounts](/docs/current/integration-design/accounting-integrations/imports/accounts/integration-design-accounts-sync).

## Execution Requirements

| Requirement               | Description                                                                                                                                                                                                                                                                       |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Scheduling Ownership      | The integration defines sync timing and execution frequency                                                                                                                                                                                                                       |
| Full Reconciliation       | Every sync execution reconciles against full Accounting System state                                                                                                                                                                                                              |
| Non-Overlapping Execution | Sync executions must not overlap                                                                                                                                                                                                                                                  |
| API Ownership             | All changes are applied through the [Pleo Chart of Accounts API](/reference/accounts/chart-of-accounts-api-overview). See the [how-to article](/docs/current/how-tos/accounting-integrations/imports/accounts/how-to-sync-accounts) for step-by-step implementation instructions. |
| Rate Limit Handling       | Scheduling must respect the [Pleo Chart of Accounts API rate limit](/docs/current/integration-design/accounting-integrations/imports/accounts/integration-design-accounts-periodicity#pleo-api-rate-limit).                                                                       |

For schedule, frequency, and rate limit details, see [Chart of Accounts Sync Periodicity and Scheduling](/docs/current/integration-design/accounting-integrations/imports/accounts/integration-design-accounts-periodicity).

## Processing Principles

| Principle                      | Description                                                                |
| ------------------------------ | -------------------------------------------------------------------------- |
| Unidirectional Sync            | Data only flows from the Accounting System into Pleo                       |
| Idempotent Execution           | Re-running the same sync with unchanged data produces the same final state |
| Deterministic Reconciliation   | Identical inputs must produce identical outputs                            |
| Non-Destructive Updates        | Accounts are archived instead of deleted                                   |
| Consistent Identity Resolution | Matching logic must behave consistently across executions                  |
| Stateless Execution            | Each sync run must independently reconcile against current source state    |

## Expected Outcome

After implementation:

* Pleo accurately reflects the Chart of Accounts from the Accounting System
* Accounts remain stable across repeated sync runs
* Outdated accounts are archived automatically
* Bookkeepers always have current, accurate accounts available for category assignment

***

## What Comes Next?

* [Sync Accounts](/docs/current/integration-design/accounting-integrations/imports/accounts/integration-design-accounts-sync)
* [Data Mapping](/docs/current/integration-design/accounting-integrations/imports/accounts/integration-design-accounts-data-mapping)
* [Sync Periodicity and Scheduling](/docs/current/integration-design/accounting-integrations/imports/accounts/integration-design-accounts-periodicity)

***

## Related Reading

* [Platform Capabilities: Chart of Accounts Sync Overview](/docs/current/platform/accounting-integrations/imports/accounts/accounts-sync-overview)
* [Chart of Accounts Sync Workflow Guide](/docs/current/guides/accounting-integrations/imports/accounts-sync-workflow-guide)
* [Connection and Authorisation Overview](/docs/current/integration-design/auth/integration-design-auth-overview)

***
