> ## 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 Workflow Guide

export const CreateUpdateArchiveAccountsDiagram = () => {
  const diagram = `
%%{init: {"themeVariables": {"fontSize": "14px"}}}%%
flowchart LR
    S1["1. Create Accounts for New AS Entries"] --> S2["2. Unarchive or Update Existing Accounts"] --> S3["3. Archive Accounts with No Matching AS Entry"]

click S1 "#1-create-accounts-for-new-as-entries"
click S2 "#2-unarchive-or-update-existing-accounts"
click S3 "#3-archive-accounts-with-no-matching-as-entry"

style S1 white-space:normal
style S2 white-space:normal
style S3 white-space:normal
`;
  return <Mermaid chart={diagram} />;
};

export const FetchAndMatchAccountsDiagram = () => {
  const diagram = `
%%{init: {"themeVariables": {"fontSize": "20px"}}}%%
flowchart LR
    S1["1. Fetch Active Accounts from AS"] --> S2["2. Fetch All Accounts from Pleo"] --> S3["3. Match by externalId"] --> S4["Create, Update,\nand Archive Accounts"]

click S1 "#1-retrieve-active-accounts-from-the-accounting-system"
click S2 "#2-retrieve-all-accounts-from-pleo"
click S3 "#3-match-as-accounts-to-pleo-accounts-by-externalid"

style S1 white-space:normal
style S2 white-space:normal
style S3 white-space:normal
style S4 white-space:normal,stroke-dasharray:5 5
`;
  return <Mermaid chart={diagram} />;
};

export const CoASyncOverviewDiagram = () => {
  const diagram = `
%%{init: {"themeVariables": {"fontSize": "16px"}}}%%
flowchart LR

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

subgraph Pleo["Pleo APIs"]
    A["1. Fetch and Match Accounts"]
    B["2. Create, Update, and Archive Accounts"]
    A --> B
end

source --> A

click A "#1-fetch-and-match-accounts"
click B "#2-create-update-and-archive-accounts"

style A white-space:normal
style B white-space:normal
style source white-space:normal

style AS fill:none,stroke:#000000
style Pleo fill:none,stroke:#000000
`;
  return <Mermaid chart={diagram} />;
};

export const WhatComesNext = ({children, href}) => <div className="mt-4">
    <a href={href} className="
        inline-flex items-center justify-center
        rounded-full
        bg-black text-white dark:bg-[#1f262b]
        px-5 py-2.5 text-sm font-medium
        no-underline border-0
        hover:bg-[#ffe6ea] dark:hover:bg-[#2b1f23]
        hover:text-black
        transition-colors
      ">
      {children} →
    </a>
  </div>;

export const RecommendedCallout = ({title, children, icon = "⭐"}) => <div style={{
  backgroundColor: 'var(--recommended-bg)',
  borderLeft: '4px solid #f8f1ac',
  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>;

<RecommendedCallout title="Recommended Workflow">
  This guide covers [Integration Level 3](/docs/current/getting-started/accounting-integrations-overview), which enables syncing the Chart of Accounts from your Accounting System into Pleo. It builds on Level 2 (Tags Sync) and ensures bookkeepers can assign the correct accounts to expense categories before export.
</RecommendedCallout>

## What You'll Have Built

After implementing this workflow:

* Active accounts from the AS are reflected as Accounts in Pleo.
* Accounts are automatically kept up to date on a scheduled basis.
* Bookkeepers can assign current, accurate accounts to expense categories in Pleo.
* The integration aligns with Pleo's Chart of Accounts Sync guarantees and matching model.

## Who This Guide Is For

This guide is intended for:

* Integration developers
* Solution architects
* Accounting platform integrators

It focuses on **workflow understanding**, not implementation details.

## Before You Start

You should be familiar with:

* Pleo's [supported authentication](/docs/current/integration-design/auth/integration-design-auth-overview#authentication-policy-overview) methods.
* The [Chart of Accounts Sync](/docs/current/platform/accounting-integrations/imports/accounts/accounts-sync-overview) platform capabilities page.

## Chart of Accounts Sync Workflow Overview

The Chart of Accounts in the Accounting System is the definitive list of accounts used to classify and bookkeep expenses. Each account has a code (the account number visible to admins/bookkeepers), a name, and a stable `externalId` that uniquely identifies it in the AS.

Chart of Accounts Sync copies this structure into Pleo. The Accounting System is the source of truth; the integration's role is to keep Pleo's Accounts aligned with the current state of the AS so bookkeepers always have accurate, up-to-date options when assigning accounts to expense categories.

Unlike Tags Sync, Chart of Accounts Sync does not have a selection step. All active accounts from the AS are synchronised into Pleo.

<CoASyncOverviewDiagram />

The how-to articles in this section use a consistent example to illustrate each step. The table below shows the starting state in both systems before the sync runs.

| Account (AS)           | AS Status | Account (Pleo)         | Pleo Status    | Desired Pleo State   |
| ---------------------- | --------- | ---------------------- | -------------- | -------------------- |
| 1000 - Office Supplies | Active    | 1000 - Office Supplies | Active         | Active (no change)   |
| 2000 - Travel          | Active    | 2000 - Travel          | Archived       | Unarchived           |
| 3000 - Software        | Active    | —                      | Does not exist | Created              |
| 4000 - Marketing       | Active    | 4000 - Advertising     | Active         | Updated to match AS  |
| —                      | —         | 5000 - Entertainment   | Active         | Archived (not in AS) |

The two steps progress as follows:

| Step                                    | Integration action                                          | Outcome                                       |
| --------------------------------------- | ----------------------------------------------------------- | --------------------------------------------- |
| 1. Fetch and Match Accounts             | Fetches accounts from AS and Pleo, matches by `externalId`  | Each account is paired with a required action |
| 2. Create, Update, and Archive Accounts | Creates, updates, unarchives, and archives Accounts in Pleo | Pleo reflects the current Chart of Accounts   |

***

## Steps

### 1. Fetch and Match Accounts

#### Purpose

This step runs at the start of every Chart of Accounts Sync cycle. The integration retrieves all active accounts from the Accounting System and all Accounts from Pleo (active and archived), then matches them using the `externalId` field to determine what action is needed for each account.

#### Input

* Active accounts from the AS Chart of Accounts
* Active and archived Accounts from Pleo. Archived Accounts are included so they can be unarchived rather than duplicated if an account becomes active in the AS again.

#### Workflow Process

<FetchAndMatchAccountsDiagram />

#### Output

* Each AS account matched to a Pleo Account (or identified as new)
* Each Pleo Account identified as requiring creation, unarchiving, updating, or no action
* Active Pleo Accounts with no AS match flagged for archiving

#### Why It Matters

The matching step is the foundation of the reconciliation. Accurate matching by `externalId` ensures accounts are updated rather than duplicated, and that accounts removed from the AS are archived rather than left stale in Pleo.

#### Integration Design

If you're an integration developer or architect, read the [Sync Accounts](/docs/current/integration-design/accounting-integrations/imports/accounts/integration-design-accounts-sync) integration design doc before implementing this step. It covers the matching rules, archiving behaviour, the `taxCodeExternalId` reference field, and how the sync handles each reconciliation outcome.

#### Step-by-Step Instructions

When you're ready to start implementing, follow the step-by-step instructions in the accompanying how-to article.

<WhatComesNext href="/docs/current/how-tos/accounting-integrations/imports/accounts/how-to-sync-accounts">
  How to Fetch and Match Accounts
</WhatComesNext>

***

### 2. Create, Update, and Archive Accounts

#### Purpose

This step runs immediately after the matching step. For each account requiring action, the integration creates, updates, unarchives, or archives the corresponding Account in Pleo. After all AS accounts are processed, any active Pleo Account with no matching AS account is archived.

#### Input

* Active accounts from the AS Chart of Accounts (used to drive create, update, and unarchive operations)
* The matched account set from Step 1, identifying which Pleo Accounts require action and which active Pleo Accounts have no AS match

#### Workflow Process

<CreateUpdateArchiveAccountsDiagram />

#### Output

* Accounts created for AS accounts with no existing match in Pleo
* Archived Accounts unarchived where an active AS account matches
* Account names and codes updated where they differ from the current AS
* Active Accounts archived where their AS account is no longer active

#### Why It Matters

These write operations bring Pleo's Chart of Accounts into alignment with the AS. Without them, the account list in Pleo will drift out of date, causing bookkeepers to assign incorrect accounts to expense categories before export.

#### Integration Design

If you're an integration developer or architect, read the [Sync Accounts](/docs/current/integration-design/accounting-integrations/imports/accounts/integration-design-accounts-sync) integration design doc before implementing this step. It covers the API operations, request and response structure, and the data mapping requirements.

#### Step-by-Step Instructions

When you're ready to start implementing, follow the step-by-step instructions in the accompanying how-to article.

<WhatComesNext href="/docs/current/how-tos/accounting-integrations/imports/accounts/how-to-create-update-archive-accounts">
  How to Create, Update, and Archive Accounts
</WhatComesNext>

***

## What Comes Next?

Once Chart of Accounts Sync is live, admin/bookkeepers and spenders can start using the synced accounts in Pleo:

* [How to set up your categories](https://help.pleo.io/en/support/solutions/articles/103000254857-how-to-set-up-your-categories): See how Admins/Bookkeepers map accounts to expense categories in Pleo.
* [Get reimbursed for out-of-pocket expenses](https://help.pleo.io/en/support/solutions/articles/103000281947-get-reimbursed-for-out-of-pocket-expenses): See how spenders assign a category when submitting an expense via the Pleo Mobile App.

To extend your integration further:

* [Tax Sync](/reference/tax-codes-overview): Sync tax codes from your Accounting System into Pleo.

***

## Related Reading

* [Integration Design: Chart of Accounts Sync Overview](/docs/current/integration-design/accounting-integrations/imports/accounts/integration-design-accounts-overview)
* [Platform Capabilities: Chart of Accounts Sync](/docs/current/platform/accounting-integrations/imports/accounts/accounts-sync-overview)

***
