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

# Tax Sync Overview

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

subgraph AS["Accounting System / ERP"]
    source["Tax Codes"]
end

subgraph Integration["Tax Sync Integration"]
    sync["Sync Logic + Reconciliation Engine"]
end

subgraph Pleo["Pleo"]
    target["Tax Codes"]
end

AS -.-> Integration
Integration -->|"Pleo Tax Codes 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 Tax Sync between an Accounting System and Pleo.

It maps tax code data from the Accounting System to the equivalent Tax Codes 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.

<TaxSyncDirectionDiagram />

Tax Sync ensures Pleo always has a current, accurate list of tax codes. Stale or missing tax codes result in expenses carrying incorrect tax data when exported.

For the full tax-to-expense chain, see [Platform Capabilities: Tax Sync](/docs/current/platform/accounting-integrations/imports/tax-codes/tax-sync-overview).

## Tax Sync Execution Model

Tax Sync is a deterministic reconciliation process executed by the integration.

On each sync run, the integration:

1. Retrieves relevant active Tax Codes from the Accounting System (filtering out irrelevant or inactive codes)
2. Retrieves the current state of Tax Codes 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 Tax Codes API

<RememberCallout title="Remember">
  The goal of each sync run is to make Pleo reflect the current active, relevant tax codes from 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 Relevant Active Tax Codes from AS]
        D[Fetch Active and Archived Tax Codes from Pleo]

        subgraph Step["Reconcile Tax Codes"]
            E[Match by code]
            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

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

## Sync Process

Tax Sync runs as a single reconciliation step on every sync cycle.

The integration fetches relevant active tax codes from the Accounting System and all Tax Codes (active and archived) from Pleo, then reconciles the two using the `code` field.

### Filtering

Before reconciliation, the integration must filter the tax codes retrieved from the Accounting System:

* **Exclude** tax codes not relevant to expense management (for example: Sales VAT)
* **Exclude** blocked, inactive, or archived tax codes

Only the filtered set of active, relevant tax codes is used for reconciliation.

### Reconciliation Outcomes

| Condition                                        | Result                                                          |
| ------------------------------------------------ | --------------------------------------------------------------- |
| Matching active Tax Code in Pleo, details match  | Preserve existing Tax Code                                      |
| Matching active Tax Code in Pleo, details differ | Update Tax Code name, rate, and type to match AS                |
| Matching archived Tax Code in Pleo               | Unarchive Tax Code and update details if needed                 |
| No matching Tax Code in Pleo                     | Create new Tax Code with code, name, rate, and type             |
| Duplicate codes in Pleo                          | Retain the Tax Code matching the AS rate; archive the duplicate |

After all Accounting System tax codes are processed, any remaining active Tax Codes in Pleo that had no match are archived.

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

## Tax Code Types

Pleo supports two tax code types: `inclusive` and `reverse`. For full type mapping rules, see [Tax Sync Data Mapping](/docs/current/integration-design/accounting-integrations/imports/tax-codes/integration-design-tax-sync-data-mapping).

## 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 Tax Codes API](/reference/tax-codes-overview). See the [how-to article](/docs/current/how-tos/accounting-integrations/imports/tax-codes/how-to-fetch-and-match-tax-codes) for step-by-step implementation instructions. |
| Rate Limit Handling       | Scheduling must respect the [Pleo Tax Codes API rate limit](/docs/current/integration-design/accounting-integrations/imports/tax-codes/integration-design-tax-sync-periodicity#pleo-api-rate-limit).                                                              |

For schedule, frequency, and rate limit details, see [Tax Sync Periodicity and Scheduling](/docs/current/integration-design/accounting-integrations/imports/tax-codes/integration-design-tax-sync-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        | Tax Codes 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 active, relevant tax codes from the Accounting System
* Tax Codes remain stable across repeated sync runs
* Outdated tax codes are archived automatically
* Bookkeepers always have current, accurate tax codes available for expense assignment

***

## What Comes Next?

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

***

## Related Reading

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

***
