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

> For Vendor Sync, how to unarchive a Pleo Vendor once its corresponding AS vendor becomes active again.

This how-to covers unarchiving a Pleo Vendor whose matching AS vendor is active again.

Run this after [How to Fetch and Match Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-fetch-and-match-vendors.md) found a matching Pleo Vendor in `ARCHIVED` state for an active AS vendor.

## Prerequisites

Before you begin:

* You have completed [How to Fetch and Match Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-fetch-and-match-vendors.md) and found a matching Pleo Vendor in `ARCHIVED` state
* Your integration is authenticated using one of the [supported authentication methods](/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](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-fetch-and-match-vendors.md) scenario: "Nordic Freight" (EXT-002) is active in the AS, but its matching Pleo Vendor is `ARCHIVED`.

## Steps

Remember

Run this call inside your per-company concurrency lock, shared with Vendor Creation. See [How to Create Vendors](/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. Unarchive the Vendor

**API Endpoint**: POST [`/v1/vendors/{id}:activate`](/reference/external-vendors/activate-a-vendor)

**Example Pseudo:**

```pseudo theme={null}
if matchedVendor.state == "ARCHIVED":
    activateRequest.externalId = vendor.externalId
    activateRequest.code       = vendor.code
    POST activateRequest to Pleo /v1/vendors/{matchedVendor.id}:activate
```

The "Nordic Freight" Vendor is unarchived in this example.

**OAuth 2.0**

```bash theme={null}
curl -X POST "https://external.staging.pleo.io/v1/vendors/c3d4e5f6-a789-012a-3456-cde78a90babc:activate" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json;charset=UTF-8" \
  -d '{
        "externalId": "EXT-002",
        "code": "1002"
      }'
```

**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/c3d4e5f6-a789-012a-3456-cde78a90babc:activate" \
  -d '{
        "externalId": "EXT-002",
        "code": "1002"
      }' \
| jq
```

This endpoint returns `204 No Content` on success. The Vendor's `state` is now `ACTIVE`.

#### 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 "Nordic" to search.

"Nordic Freight" is now searchable in the Vendor field on an expense, confirming it is no longer archived.

![Vendor dropdown on an expense showing unarchived Nordic Freight](https://mintcdn.com/pleo-61d4d38b/OQXz7YYPcGlsTpec/images/current/accounting-integrations/imports/vendor-sync/ui-vendors-active-unarchived-nordic-freight.png?fit=max\&auto=format\&n=OQXz7YYPcGlsTpec\&q=85\&s=a85b117140bf7137ac9b4d348d90a6fd)

Remember

If the AS vendor's other details (name, country, currency, registration or tax numbers) also differ from Pleo, follow this with [How to Update Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-update-vendors.md).

***

## Handling Edge Cases

**Vendor is already `ACTIVE`:** treat the call as a no-op rather than an error. This can happen if a previous sync run partially completed. See [Handling Edge Cases](/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 here too.

***

## Result

| Vendor | AS Status | Pleo State Before | Action | Final Pleo State |
| - | - | - | - | - |
| Nordic Freight (EXT-002) | Active | Archived | Unarchived | Active |

***

## What Comes Next?

[How to Update Vendors →](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-update-vendors.md)

***

this how-to is part of:

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

***

## Related Reading

* [How to Fetch and Match Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-fetch-and-match-vendors.md)
* [How to Update Vendors](/docs/current/how-tos/accounting-integrations/imports/vendors/how-to-update-vendors.md)
* [Sync Vendors Integration Design](/docs/current/integration-design/accounting-integrations/imports/vendors/integration-design-vendor-sync.md)
* [Platform Capabilities: Vendor Sync](/docs/current/platform/accounting-integrations/imports/vendors/vendor-sync-overview.md)

***
