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

# How to Fetch and Match Vendors

> For Vendor Sync, how to fetch vendors from both systems and match them by externalId to decide what action each one needs.

export const FetchAndMatchVendorsDiagram = () => {
  const [isDark, setIsDark] = useState(false);
  useEffect(() => {
    const check = () => setIsDark(document.documentElement.classList.contains("dark"));
    check();
    const observer = new MutationObserver(check);
    observer.observe(document.documentElement, {
      attributes: true,
      attributeFilter: ["class"]
    });
    return () => observer.disconnect();
  }, []);
  const nodeFill = isDark ? "#212222" : "#EEF4F4";
  const nodeStroke = isDark ? "#848989" : "#E1E6E6";
  const nodeTextStyle = isDark ? ",color:#EEF4F4" : ",color:#131414";
  const s4Fill = isDark ? "#212222" : "#EEF4F4";
  const s4Stroke = isDark ? "#848989" : "#212222";
  const s4TextStyle = isDark ? ",color:#EEF4F4" : ",color:#212222";
  const linkStyle = isDark ? "" : "linkStyle default stroke:#848989,stroke-width:1px;";
  const diagram = `
%%{init: {"themeVariables": {"fontSize": "18px"}}}%%
flowchart LR
    S1["1. Fetch Active Vendors from AS"] --> S2["2. Fetch All Vendors from Pleo"] --> S3["3. Match by externalId<br><br>"] --> S4["Create, Update,\nUnarchive, and Archive Vendors"]

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

style S1 white-space:normal,fill:${nodeFill},stroke:${nodeStroke}${nodeTextStyle}
style S2 white-space:normal,fill:${nodeFill},stroke:${nodeStroke}${nodeTextStyle}
style S3 white-space:normal,fill:${nodeFill},stroke:${nodeStroke}${nodeTextStyle}
style S4 white-space:normal,fill:${s4Fill},stroke:${s4Stroke},stroke-dasharray:5 5${s4TextStyle}
${linkStyle}
`;
  return <Mermaid chart={diagram} />;
};

export const VendorSyncWorkflowDiagramTopNav = ({highlight}) => {
  const [isDark, setIsDark] = useState(false);
  useEffect(() => {
    const check = () => setIsDark(document.documentElement.classList.contains("dark"));
    check();
    const observer = new MutationObserver(check);
    observer.observe(document.documentElement, {
      attributes: true,
      attributeFilter: ["class"]
    });
    return () => observer.disconnect();
  }, []);
  const nodeFill = isDark ? "#212222" : "#EEF4F4";
  const nodeStroke = isDark ? "#848989" : "#E1E6E6";
  const nodeTextStyle = isDark ? ",color:#EEF4F4" : ",color:#131414";
  const subgraphFill = isDark ? "#131414" : "#ffffff";
  const subgraphStroke = isDark ? "#848989" : "#6B7070";
  const subgraphTextStyle = isDark ? ",color:#EEF4F4" : ",color:#6B7070";
  const linkStyle = isDark ? "" : "linkStyle default stroke:#848989,stroke-width:1px;";
  const highlightStyle = highlight ? `style ${highlight} stroke:#FEB6FE,stroke-width:2px` : "";
  const diagram = `
%%{init: {"themeVariables": {"fontSize": "18px"}}}%%
flowchart LR

subgraph AS["Accounting System"]
    source["Vendors"]
end

subgraph Pleo["Pleo APIs"]
    A["1. Fetch and<br>Match<br>Vendors<br>"]
    B["2. Create<br>Vendors<br>"]
    C["3. Unarchive<br>Vendors<br>"]
    D["4. Update<br>Vendors<br>"]
    E["5. Archive<br>Vendors<br>"]
    A --> B --> C --> D --> E
end

source --> A

click A "/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-fetch-and-match-vendors"
click B "/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-create-vendors"
click C "/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-unarchive-vendors"
click D "/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-update-vendors"
click E "/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-archive-vendors"

style A white-space:normal,fill:${nodeFill},stroke:${nodeStroke}${nodeTextStyle}
style B white-space:normal,fill:${nodeFill},stroke:${nodeStroke}${nodeTextStyle}
style C white-space:normal,fill:${nodeFill},stroke:${nodeStroke}${nodeTextStyle}
style D white-space:normal,fill:${nodeFill},stroke:${nodeStroke}${nodeTextStyle}
style E white-space:normal,fill:${nodeFill},stroke:${nodeStroke}${nodeTextStyle}
style source white-space:normal,fill:${nodeFill},stroke:${nodeStroke}${nodeTextStyle}

style AS fill:${subgraphFill},stroke:${subgraphStroke}${subgraphTextStyle}
style Pleo fill:${subgraphFill},stroke:${subgraphStroke}${subgraphTextStyle}

${highlightStyle}
${linkStyle}
`;
  return <Mermaid chart={diagram} />;
};

export const WhatComesNext = ({children, href}) => <div className="mt-4">
    <a href={href} className="btn-primary">
      {children} →
    </a>
  </div>;

export const NoteCallout = ({title, children}) => <div className="callout-box callout-note">
    <div className="callout-row">
      <span className="callout-icon">
        <svg width="22" height="22" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,104a79.86,79.86,0,0,1-30.59,62.92A24.29,24.29,0,0,0,168,186v6a8,8,0,0,1-8,8H96a8,8,0,0,1-8-8v-6a24.11,24.11,0,0,0-9.3-19A79.87,79.87,0,0,1,48,104.45C47.76,61.09,82.72,25,126.07,24A80,80,0,0,1,208,104Z" opacity="0.2" /><path d="M176,232a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h80A8,8,0,0,1,176,232Zm40-128a87.55,87.55,0,0,1-33.64,69.21A16.24,16.24,0,0,0,176,186v6a16,16,0,0,1-16,16H96a16,16,0,0,1-16-16v-6a16,16,0,0,0-6.23-12.66A87.59,87.59,0,0,1,40,104.49C39.74,56.83,78.26,17.14,125.88,16A88,88,0,0,1,216,104Zm-16,0a72,72,0,0,0-73.74-72c-39,.92-70.47,33.39-70.26,72.39a71.65,71.65,0,0,0,27.64,56.3A32,32,0,0,1,96,186v6h64v-6a32.15,32.15,0,0,1,12.47-25.35A71.65,71.65,0,0,0,200,104Zm-16.11-9.34a57.6,57.6,0,0,0-46.56-46.55,8,8,0,0,0-2.66,15.78c16.57,2.79,30.63,16.85,33.44,33.45A8,8,0,0,0,176,104a9,9,0,0,0,1.35-.11A8,8,0,0,0,183.89,94.66Z" /></svg>
      </span>
      <div>
        {title && <div className="callout-title">
            {title}
          </div>}
        <div className="callout-body">
          {children}
        </div>
      </div>
    </div>
  </div>;

export const RememberCallout = ({title, children}) => <div className="callout-box callout-remember">
    <div className="callout-row">
      <span className="callout-icon">
        <svg width="22" height="22" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,98.34,172.39,155.8c11.46,22.93-1.72,45.86-10.11,57a8,8,0,0,1-12,.83L42.34,105.76A8,8,0,0,1,43,93.85c29.65-23.92,57.4-10,57.4-10l57.27-57.46a8,8,0,0,1,11.31,0L229.66,87A8,8,0,0,1,229.66,98.34Z" opacity="0.2" /><path d="M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z" /></svg>
      </span>
      <div>
        {title && <div className="callout-title">
            {title}
          </div>}
        <div className="callout-body">
          {children}
        </div>
      </div>
    </div>
  </div>;

<VendorSyncWorkflowDiagramTopNav highlight="A" />

<div className="border-[1px] rounded-none p-4 bg-[#ffffff] border-[#FEB6FE] dark:bg-[#131414] dark:border-[#FEB6FE]">
  <FetchAndMatchVendorsDiagram />
</div>

This how-to covers the fetch and match phase of Vendor Sync: retrieving vendors from the Accounting System and Vendors from Pleo, then determining what action is needed for each. For the write operations, see [How to Create Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-create-vendors), [How to Unarchive Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-unarchive-vendors), [How to Update Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-update-vendors), and [How to Archive Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-archive-vendors).

Your integration must:

* Retrieve active vendors from the AS
* Retrieve all Vendors (active and archived) from Pleo
* Match AS vendors to Pleo Vendors by `externalId` to determine what action is needed

## Prerequisites

Before you begin:

* You're familiar with the [Vendor Sync Implementation Overview](/docs/current/integration-design/accounting-integrations/imports/vendors/integration-design-vendor-sync-overview) and [Sync Vendors](/docs/current/integration-design/accounting-integrations/imports/vendors/integration-design-vendor-sync)
* Your integration is authenticated using one of the [supported authentication methods](/docs/current/integration-design/auth/integration-design-auth-overview#authentication-policy-overview)
* Your integration can call Pleo's Vendors API endpoints
* Your integration can call the target Accounting System's own API to fetch active vendors

## Scenario

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

| Vendor (AS)                 | AS Status | Vendor (Pleo)            | Pleo Status    |
| --------------------------- | --------- | ------------------------ | -------------- |
| Acme Supplies (EXT-001)     | Active    | Acme Supplies (EXT-001)  | Active         |
| Nordic Freight (EXT-002)    | Active    | Nordic Freight (EXT-002) | Archived       |
| Bright Office Ltd (EXT-003) | Active    | —                        | Does not exist |
| Kaffehuset AS (EXT-004)     | Active    | Kaffehuset AS (EXT-004)  | Active         |
| —                           | —         | Old Print Shop (EXT-005) | Active         |

## Steps

### 1. Retrieve Active Vendors from the Accounting System

Fetch all active vendors from the AS.

**Example Pseudo:**

```pseudo theme={null}
rawActiveASVendors = fetchActiveVendorsFromAS()

// Apply the data integrity rules from Vendor Sync's design:
// https://docs.pleo.io/docs/current/integration-design/accounting-integrations/imports/vendors/integration-design-vendor-sync
activeASVendors = []
externalIdCounts = countBy(rawActiveASVendors, v => v.externalId)

for vendor in rawActiveASVendors:
    if isEmpty(vendor.externalId):
        logError("Skipped vendor with empty/null externalId", vendor)
        continue
    if externalIdCounts[vendor.externalId] > 1:
        logError("Skipped vendor with duplicate externalId", vendor)
        continue
    activeASVendors.push(vendor)
```

<NoteCallout title="Note">
  After this filtering, `activeASVendors` is the set your integration uses for matching, for creating new Pleo Vendors, and later for working out which Pleo Vendors have no matching active AS vendor.

  <br />

  <br />

  A skipped vendor (empty or duplicate `externalId`) doesn't count as "not in the AS" for that last step. It's excluded because its identity can't be trusted yet, not because it's confirmed inactive.

  <br />

  <br />

  See [How to Archive Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-archive-vendors#1-archive-the-vendor) for why that distinction matters.
</NoteCallout>

#### Example Result

| Vendor            | externalId | Code | Country | Currency |
| ----------------- | ---------- | ---- | ------- | -------- |
| Acme Supplies     | EXT-001    | 1001 | GB      | GBP      |
| Nordic Freight    | EXT-002    | 1002 | DK      | DKK      |
| Bright Office Ltd | EXT-003    | 1003 | GB      | GBP      |
| Kaffehuset AS     | EXT-004    | 1004 | DK      | DKK      |

***

### 2. Retrieve All Vendors from Pleo

**API Endpoint**: POST [`/v1/vendors:search`](/reference/external-vendors/fetches-vendors-by-search-criteria)

Fetch both active and archived Vendors from Pleo. Including archived Vendors allows unarchiving rather than creating duplicates.

Filter the search to the `ACTIVE` and `ARCHIVED` states explicitly using the `states` field. This excludes `DRAFT` Vendors, which belong to the [Vendor Creation](/docs/current/platform/exports/vendors/vendor-creation-overview) flow and are not handled by Vendor Sync's matching logic.

**Example Pseudo:**

```pseudo theme={null}
pleoVendors = []
cursor = null

do:
    page = fetchVendorsFromPleo(states: ["ACTIVE", "ARCHIVED"], after: cursor)
    pleoVendors.extend(page.data)
    cursor = page.pagination.endCursor
while page.pagination.hasNextPage
```

Fetch every page before matching. Acting on a partial (first-page-only) result set can miss Vendors and cause them to be incorrectly archived or recreated. If any page fetch fails partway through, abort the sync run entirely rather than matching against an incomplete result set; retry the full fetch on the next cycle.

#### Example Request

<Tabs>
  <Tab title="OAuth 2.0">
    ```bash theme={null}
    curl -X POST "https://external.staging.pleo.io/v1/vendors:search?company_id=12abc3d4-e567-890e-1234-abc56e78fabc" \
      -H "Authorization: Bearer <access_token>" \
      -H "Content-Type: application/json;charset=UTF-8" \
      -d '{"states": ["ACTIVE", "ARCHIVED"]}'
    ```
  </Tab>

  <Tab title="API Key">
    ```bash theme={null}
    curl --request POST \
      -u "pls_1ab2cd3e4f5g6h7a89b012c34de56f78_gabc90:" \
      -H "Accept: application/json;charset=UTF-8" \
      -H "Content-Type: application/json;charset=UTF-8" \
      "https://external.staging.pleo.io/v1/vendors:search?company_id=12abc3d4-e567-890e-1234-abc56e78fabc" \
      -d '{"states": ["ACTIVE", "ARCHIVED"]}' \
    | jq
    ```
  </Tab>
</Tabs>

#### Example Response

```json theme={null}
{
  "data": [
    {
      "id": "d4e5f6a7-b890-123b-4567-def89b01cabc",
      "companyId": "12abc3d4-e567-890e-1234-abc56e78fabc",
      "name": "Acme Supplies",
      "code": "1001",
      "externalId": "EXT-001",
      "country": "GB",
      "defaultCurrency": "GBP",
      "state": "ACTIVE",
      "accountingSystem": "custom_api_integration",
      "createdAt": "2026-06-01T08:46:55.778461Z",
      "updatedAt": "2026-06-01T08:47:11.345094Z"
    },
    {
      "id": "c3d4e5f6-a789-012a-3456-cde78a90babc",
      "companyId": "12abc3d4-e567-890e-1234-abc56e78fabc",
      "name": "Nordic Freight",
      "code": "1002",
      "externalId": "EXT-002",
      "country": "DK",
      "defaultCurrency": "DKK",
      "state": "ARCHIVED",
      "accountingSystem": "custom_api_integration",
      "createdAt": "2026-06-01T08:47:59.430364Z",
      "updatedAt": "2026-06-01T08:49:41.829869Z"
    },
    {
      "id": "b2c3d4e5-f678-901f-2345-bcd67f89aabc",
      "companyId": "12abc3d4-e567-890e-1234-abc56e78fabc",
      "name": "Kaffehuset AS",
      "code": "1004",
      "externalId": "EXT-004",
      "country": "SE",
      "defaultCurrency": "SEK",
      "state": "ACTIVE",
      "accountingSystem": "custom_api_integration",
      "createdAt": "2026-06-01T08:48:52.799351Z",
      "updatedAt": "2026-06-01T08:49:30.424444Z"
    },
    {
      "id": "a1b2c3d4-e567-890e-1234-abc56e78fabc",
      "companyId": "12abc3d4-e567-890e-1234-abc56e78fabc",
      "name": "Old Print Shop",
      "code": "1005",
      "externalId": "EXT-005",
      "country": "GB",
      "defaultCurrency": "GBP",
      "state": "ACTIVE",
      "accountingSystem": "custom_api_integration",
      "createdAt": "2026-06-01T08:49:26.679397Z",
      "updatedAt": "2026-06-01T08:49:26.679397Z"
    }
  ],
  "pagination": {
    "hasPreviousPage": false,
    "hasNextPage": false,
    "endCursor": "V5MEDOJJYJDJTLHZ2BMGH62EGU",
    "total": 4
  }
}
```

<NoteCallout title="Note">
  Check `hasNextPage` to know when to stop paginating. That's the only reliable signal.

  <br />

  <br />

  `endCursor` is not a reliable signal on its own: it can still be a non-null string on the last page, as the example above shows.
</NoteCallout>

#### Example Result

| Vendor         | externalId | Status                                                         |
| -------------- | ---------- | -------------------------------------------------------------- |
| Acme Supplies  | EXT-001    | Active                                                         |
| Nordic Freight | EXT-002    | Archived                                                       |
| Kaffehuset AS  | EXT-004    | Active (country and currency differ from AS: SE/SEK vs DK/DKK) |
| Old Print Shop | EXT-005    | Active                                                         |

#### What it looks like in Pleo Web App

Pleo has no dedicated Vendors list page, so the Vendor field on an expense's detail panel is used to confirm which Vendors are currently active and searchable:

1. Select **Accounting** from the main left-hand navigation.
2. Select **Export** from the sub-menu.
3. Click on a row to open the details panel for that expense.
4. Select the **Vendor** drop-down menu to view active Vendors.

<div style={{ textAlign: "center" }}>
  <img src="https://mintcdn.com/pleo-61d4d38b/OQXz7YYPcGlsTpec/images/current/accounting-integrations/imports/vendor-sync/ui-vendors-active-starting-position.png?fit=max&auto=format&n=OQXz7YYPcGlsTpec&q=85&s=3335f6f2cd8a6cc2b799541528569e60" alt="Vendor dropdown on an expense showing active vendors" width="100%" style={{ display: "block", margin: "0 auto" }} data-path="images/current/accounting-integrations/imports/vendor-sync/ui-vendors-active-starting-position.png" />
</div>

<br />

<RememberCallout title="Remember">
  Archived Vendors do not appear in this dropdown.
</RememberCallout>

***

### 3. Match AS Vendors to Pleo Vendors by externalId

For each active AS vendor, attempt to find a matching Vendor in Pleo using `externalId`.

<NoteCallout title="Note">
  Pleo enforces `externalId` uniqueness per company at the database level. Creating a Vendor with an `externalId` already used by another Vendor for that company, archived ones included, is rejected with `409 CONFLICT_EXCEPTION`.

  <br />

  <br />

  Existing Pleo Vendor records should therefore already be unique, but that doesn't guarantee it. A pair of Pleo Vendors sharing an `externalId` from legacy data, or from any other source of bad data, can still be present.

  <br />

  <br />

  Defend against that case when matching, as shown below.
</NoteCallout>

**Example Pseudo:**

```pseudo theme={null}
pleoExternalIdCounts = countBy(pleoVendors, v => v.externalId)
pleoVendorsByExternalId = {}
poisonedExternalIds = new Set()

for vendor in pleoVendors:
    if pleoExternalIdCounts[vendor.externalId] > 1:
        logError("Skipped Pleo Vendor with duplicate externalId", vendor)
        poisonedExternalIds.add(vendor.externalId)
        continue
    pleoVendorsByExternalId[vendor.externalId] = vendor

actions = []

for vendor in activeASVendors:
    if poisonedExternalIds.has(vendor.externalId):
        logError("Skipped AS Vendor: matching externalId has a Pleo-side duplicate", vendor)
        continue

    matchedVendor = pleoVendorsByExternalId[vendor.externalId]

    if matchedVendor is null:
        if pendingActivationExternalIds.has(vendor.externalId):
            logInfo("Skipped: externalId already claimed by an in-flight Vendor Creation attempt", vendor)
            continue
        actions.add({ action: "CREATE", asVendor: vendor })
    else if matchedVendor.state == "ARCHIVED":
        actions.add({ action: "UNARCHIVE", asVendor: vendor, pleoVendor: matchedVendor })
    else if detailsDiffer(matchedVendor, vendor):
        actions.add({ action: "UPDATE", asVendor: vendor, pleoVendor: matchedVendor })
    // else: no action needed
```

<NoteCallout title="Note">
  The `pleoVendorsByExternalId` map built in the pseudo-code above deliberately skips any `externalId` with a Pleo-side duplicate, so a lookup against it returns `null` for those, exactly like it would for an `externalId` that has no Pleo Vendor at all.

  <br />

  <br />

  The `poisonedExternalIds` check above catches that case first, so the AS vendor is skipped before it ever reaches the `CREATE` branch. Without that check, it would be indistinguishable from a genuine new Vendor and get created.

  <br />

  <br />

  Creating one anyway would add a third, conflicting Pleo Vendor for the same `externalId`. Leave the existing (duplicated) Pleo Vendors untouched until the duplicate is resolved manually.
</NoteCallout>

<NoteCallout title="Note">
  `pendingActivationExternalIds`, checked in the pseudo-code above, is the set of AS-assigned `externalId`s that [Vendor Creation](/docs/current/integration-design/exports/vendors/integration-design-vendor-creation-create-and-activate#failure-handling) has already created in the AS, but not yet activated in Pleo.

  <br />

  <br />

  Skip creation for these. Creating one anyway would produce a duplicate Vendor once Vendor Creation's own activation step succeeds or is retried.

  <br />

  <br />

  See [Concurrency with Vendor Creation](/docs/current/integration-design/accounting-integrations/imports/vendors/integration-design-vendor-sync#concurrency-with-vendor-creation) for the full race this prevents.
</NoteCallout>

This step only determines the action needed for each vendor. See [How to Create Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-create-vendors), [How to Unarchive Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-unarchive-vendors), [How to Update Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-update-vendors), and [How to Archive Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-archive-vendors) for how each `action` is executed.

#### Example Result

| AS Vendor                   | Pleo Vendor              | Pleo Status                         | Action    |
| --------------------------- | ------------------------ | ----------------------------------- | --------- |
| Acme Supplies (EXT-001)     | Acme Supplies (EXT-001)  | Active, matches                     | No action |
| Nordic Freight (EXT-002)    | Nordic Freight (EXT-002) | Archived                            | Unarchive |
| Bright Office Ltd (EXT-003) | —                        | Does not exist                      | Create    |
| Kaffehuset AS (EXT-004)     | Kaffehuset AS (EXT-004)  | Active, country and currency differ | Update    |
| —                           | Old Print Shop (EXT-005) | Active                              | Archive   |

<RememberCallout title="Remember">
  Matching only ever uses `externalId`.

  <br />

  <br />

  If a vendor's `name` or `code` changes in the AS, that's not a signal to create a new vendor. It's still the same vendor: match it by `externalId` and treat the change as an update.
</RememberCallout>

***

## Handling Edge Cases

* **Empty result set:** If either fetch returns no vendors (no active vendors in the AS, or no Vendors in Pleo), the matching step has nothing to pair up. This is a normal outcome, not an error; the one-sided steps still run as normal, for example Create for every AS vendor when Pleo has none, or, when the AS has none, treating every active Pleo Vendor as unmatched for this run following the normal [two-consecutive-run archive safeguard](/docs/current/integration-design/accounting-integrations/imports/vendors/integration-design-vendor-sync#4-archive-unmatched-vendors), not archiving them immediately on this single run.
* **Already-active or already-archived conflicts:** Matching a vendor that requires no change (Pleo already reflects the AS's active state and details) is expected and should not be logged as a discrepancy.

***

## What Comes Next?

<WhatComesNext href="/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-create-vendors">
  How to Create Vendors
</WhatComesNext>

***

<div className="text-xs uppercase" style={{ fontVariant: 'small-caps' }}>
  this how-to is part of:
</div>

<div className="mt-4 flex flex-wrap gap-2">
  <a
    href="/docs/current/guides/accounting-integrations/imports/vendor-sync-workflow-guide"
    className="inline-flex items-center rounded-full border border-gray-300 dark:border-gray-600
px-3 py-1 text-xs font-medium
bg-white dark:bg-[#1f262b] text-black dark:text-white
hover:bg-gray-100 dark:hover:bg-[#2b2f33]
transition-colors"
  >
    Vendor Sync Workflow Guide
  </a>
</div>

***

## Related Reading

* [How to Create Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-create-vendors)
* [How to Unarchive Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-unarchive-vendors)
* [How to Update Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-update-vendors)
* [How to Archive Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-archive-vendors)
* [Sync Vendors Integration Design](/docs/current/integration-design/accounting-integrations/imports/vendors/integration-design-vendor-sync)
* [Vendor Sync Data Mapping](/docs/current/integration-design/accounting-integrations/imports/vendors/integration-design-vendor-sync-data-mapping)
* [Platform Capabilities: Vendor Sync](/docs/current/platform/accounting-integrations/imports/vendors/vendor-sync-overview)

***
