> ## 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 Update Vendors

> For Vendor Sync, how to update a Pleo Vendor's details to match its corresponding active AS vendor.

This how-to covers updating a Pleo Vendor's details to match its corresponding active AS vendor.

Run this after [How to Fetch and Match Vendors](https://developers.pleo.io/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-fetch-and-match-vendors.md) found a matching Pleo Vendor whose details differ from the AS.

## Prerequisites

Before you begin:

* You have completed [How to Fetch and Match Vendors](https://developers.pleo.io/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-fetch-and-match-vendors.md) and found a matching Pleo Vendor whose details differ from the AS
* Your integration is authenticated using one of the [supported authentication methods](https://developers.pleo.io/docs/current/integration-design/auth/integration-design-auth-overview.md#authentication-policy-overview)
* Your integration can call Pleo's Vendors API endpoints

## Scenario

This how-to continues from the [How to Fetch and Match Vendors](https://developers.pleo.io/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-fetch-and-match-vendors.md) scenario: "Kaffehuset AS" (EXT-004) is active in both systems, but its country and currency differ (Pleo has `SE`/`SEK`, the AS has `DK`/`DKK`).

## Steps

Remember

Run this call inside your per-company concurrency lock, shared with Vendor Creation. See [How to Create Vendors](https://developers.pleo.io/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-create-vendors.md#steps) for what this prevents and why every write in this suite needs it.

### 1. Update the Vendor

**API Endpoint**: PUT [`/v1/vendors/{id}`](https://developers.pleo.io/reference/external-vendors/update-a-vendor)

The "Kaffehuset AS" Vendor's country and currency are updated from `SE`/`SEK` to match the AS values of `DK`/`DKK` in this example.

Note

The fetched Vendor object (from [How to Fetch and Match Vendors](https://developers.pleo.io/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-fetch-and-match-vendors.md)) isn't the same shape as the PUT request body, so don't send it back as-is.

* **Client-writable on update:** `companyId`, `externalId`, `code`, `name`, `country`, `defaultCurrency`, `registrationNumber`, `taxRegistrationNumber`, `state`
* **Server-managed (read-only, present on the fetched/response object but not accepted in the PUT body):** `id`, `accountingSystem`, `createdAt`, `updatedAt`

Build a dedicated update payload from only the writable fields, rather than mutating and re-sending the fetched object.

Note

Don't copy a blank, malformed, or non-ISO `country` or `defaultCurrency` value from the AS record into this payload.

* If the incoming `country` value is invalid, omit it from `updatePayload` instead. This preserves the existing Pleo value, rather than overwriting it with bad data. Log the invalid value for investigation.
* If the incoming `defaultCurrency` value is invalid, either skip updating that vendor and log it for investigation, or send a fallback value and continue: fall back to the existing Pleo Vendor's `defaultCurrency`, or to a fallback currency your integration preconfigures for the company. `defaultCurrency` is required by the Vendors API, so it can't be omitted from `updatePayload`. Log the invalid value for investigation either way.

This follows the same [invalid-value handling rule](https://developers.pleo.io/docs/current/integration-design/accounting-integrations/imports/vendors/integration-design-vendor-sync-data-mapping.md#vendors-data-mapping) used elsewhere in Vendor Sync.

**Example Pseudo:**

```pseudo theme={null}
if detailsDiffer(matchedVendor, vendor):
    if isValidCurrency(vendor.defaultCurrency):
        currency = vendor.defaultCurrency
    else:
        logDataQualityIssue(vendor, field = "defaultCurrency")
        currency = matchedVendor.defaultCurrency  # or a preconfigured fallback currency
        # or: skip updating this vendor, log it, and continue with the next one

    updatePayload.companyId               = matchedVendor.companyId
    updatePayload.externalId              = vendor.externalId
    updatePayload.code                    = vendor.code
    updatePayload.name                    = vendor.name
    if isValidCountry(vendor.country):
        updatePayload.country             = vendor.country
    else:
        logDataQualityIssue(vendor, field = "country")
    updatePayload.defaultCurrency          = currency
    updatePayload.registrationNumber      = vendor.registrationNumber
    updatePayload.taxRegistrationNumber   = vendor.taxRegistrationNumber
    updatePayload.state                   = "ACTIVE"
    PUT updatePayload to Pleo /v1/vendors/{matchedVendor.id}
```

**OAuth 2.0**

```bash theme={null}
curl -X PUT "https://external.staging.pleo.io/v1/vendors/b2c3d4e5-f678-901f-2345-bcd67f89aabc" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json;charset=UTF-8" \
  -d '{
        "companyId": "12abc3d4-e567-890e-1234-abc56e78fabc",
        "externalId": "EXT-004",
        "code": "1004",
        "name": "Kaffehuset AS",
        "country": "DK",
        "defaultCurrency": "DKK",
        "registrationNumber": "556677-8899",
        "taxRegistrationNumber": "SE556677889901",
        "state": "ACTIVE"
      }'
```

**API Key**

```bash theme={null}
curl --request PUT \
  -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/b2c3d4e5-f678-901f-2345-bcd67f89aabc" \
  -d '{
        "companyId": "12abc3d4-e567-890e-1234-abc56e78fabc",
        "externalId": "EXT-004",
        "code": "1004",
        "name": "Kaffehuset AS",
        "country": "DK",
        "defaultCurrency": "DKK",
        "registrationNumber": "556677-8899",
        "taxRegistrationNumber": "SE556677889901",
        "state": "ACTIVE"
      }' \
| jq
```

#### Example Response

```json theme={null}
{
  "data": {
    "id": "b2c3d4e5-f678-901f-2345-bcd67f89aabc",
    "companyId": "12abc3d4-e567-890e-1234-abc56e78fabc",
    "externalId": "EXT-004",
    "code": "1004",
    "name": "Kaffehuset AS",
    "country": "DK",
    "defaultCurrency": "DKK",
    "registrationNumber": "556677-8899",
    "taxRegistrationNumber": "SE556677889901",
    "state": "ACTIVE",
    "accountingSystem": "custom_api_integration",
    "createdAt": "2026-06-01T08:48:52.799351Z",
    "updatedAt": "2026-07-08T09:20:10.215202Z"
  }
}
```

Remember

As this is a PUT action, include the current values for every field, including `externalId` and `state`; only the fields that changed should have new values.

#### 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 and type "Kaffehuset" to search.

"Kaffehuset AS" now shows Denmark, confirming the country/currency update was applied.

![Vendor dropdown on an expense showing Kaffehuset AS updated to Denmark](https://mintcdn.com/pleo-61d4d38b/OQXz7YYPcGlsTpec/images/current/accounting-integrations/imports/vendor-sync/ui-vendors-active-updated-kaffehuset.png?fit=max\&auto=format\&n=OQXz7YYPcGlsTpec\&q=85\&s=4ec03d678fedd5708b8bc814636c3bdd)

***

## Handling Edge Cases

See [Handling Edge Cases](https://developers.pleo.io/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-create-vendors.md#handling-edge-cases) on How to Create Vendors for partial-failure and unknown-outcome handling, which applies to this write too.

***

## Result

| Vendor | AS Status | Pleo State Before | Action | Final Pleo State |
| - | - | - | - | - |
| Kaffehuset AS (EXT-004) | Active | Active, country differed | Updated | Active |

***

## What Comes Next?

[How to Archive Vendors →](https://developers.pleo.io/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-archive-vendors.md)

***

this how-to is part of:

[Vendor Sync Workflow Guide](https://developers.pleo.io/docs/current/guides/accounting-integrations/imports/vendor-sync-workflow-guide.md)

***

## Related Reading

* [How to Fetch and Match Vendors](https://developers.pleo.io/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-fetch-and-match-vendors.md)
* [How to Archive Vendors](https://developers.pleo.io/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-archive-vendors.md)
* [Vendor Sync Data Mapping](https://developers.pleo.io/docs/current/integration-design/accounting-integrations/imports/vendors/integration-design-vendor-sync-data-mapping.md)
* [Platform Capabilities: Vendor Sync](https://developers.pleo.io/docs/current/platform/accounting-integrations/imports/vendors/vendor-sync-overview.md)

***
