Skip to main content
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, How to Unarchive Vendors, How to Update Vendors, and 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:

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.

Steps

1. Retrieve Active Vendors from the Accounting System

Fetch all active vendors from the AS. Example Pseudo:

Example Result


2. Retrieve All Vendors from Pleo

API Endpoint: POST /v1/vendors:search 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 flow and are not handled by Vendor Sync’s matching logic. Example Pseudo:
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

Example Response

Example Result

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.
Vendor dropdown on an expense showing active vendors


3. Match AS Vendors to Pleo Vendors by externalId

For each active AS vendor, attempt to find a matching Vendor in Pleo using externalId. Example Pseudo:
This step only determines the action needed for each vendor. See How to Create Vendors, How to Unarchive Vendors, How to Update Vendors, and How to Archive Vendors for how each action is executed.

Example Result


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, 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?


this how-to is part of: