Skip to main content
This how-to covers creating a new Pleo Vendor for an active AS vendor that has no matching Pleo record. Run this after How to Fetch and Match Vendors, which covers fetching and matching vendors from both systems.

Prerequisites

Before you begin:

Scenario

This how-to continues from the How to Fetch and Match Vendors scenario: “Bright Office Ltd” (EXT-003) is active in the AS with no matching Pleo Vendor.

Steps

1. Create Vendors for New AS Entries

API Endpoint: POST /v1/vendors If an AS vendor has no matching Pleo Vendor, create a new Vendor. Providing externalId on creation sets the Vendor’s state to ACTIVE automatically. Example Pseudo:

Example Request

Example Response

What it looks like in Pleo Web App

  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.
“Bright Office Ltd” is now searchable and selectable in the Vendor field on an expense, confirming the Vendor was created as ACTIVE.
Vendor dropdown on an expense showing newly created Bright Office Ltd

Handling Edge Cases

The following apply to every write in this suite, Create, Unarchive, Update, and Archive alike, not just this page. The other how-tos link back here rather than repeating them.
  • Create collides with an existing externalId: externalId is unique per company, so this call returns 409 CONFLICT_EXCEPTION if a Vendor with that externalId already exists, active or archived. This should not happen for a vendor that went through matching correctly, since that step already checks both states, so treat it as a sign the prior fetch-and-match step missed something (for example, a race condition with a concurrent sync run). Look up the existing Vendor by that externalId and unarchive or update it instead of retrying Create, and log the anomaly for investigation.
  • Partial write failure: If one write (create, update, unarchive, or archive) fails partway through the batch, do not abort the entire run. Continue processing the remaining vendors, and log or report the specific vendor(s) that failed so they can be retried on the next sync cycle.
  • Unknown write outcome: If a create, update, unarchive, or archive request times out or the response is lost after the request was sent, its outcome is unknown, not necessarily a failure. Do not blindly re-send the same write on this run, since it may have already applied. Instead, re-fetch that specific Vendor’s current Pleo state before deciding: if it already matches the intended target state, treat the write as a no-op success and move on; if it does not, retry the write on the next sync cycle rather than immediately, so a slow-but-successful original request has time to be reflected before you re-check.

Result


What Comes Next?


this how-to is part of: