---
title: "Vendor Matching In Master Database Using API"
slug: "vendor-matching-in-master-database-using-api"
updated: 2025-07-09T08:32:04Z
published: 2025-07-09T08:32:04Z
canonical: "knowledge-base.rossum.ai/vendor-matching-in-master-database-using-api"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://knowledge-base.rossum.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Vendor Matching In Master Database Using API

Using a webhook extension, you can do many extra activities that Rossum application does not do by default, for example validating the extracted vendor data against your database to match the correct vendor. We have published [a sample vendor matching webhook](https://github.com/rossumai/fuzzy-vendor-matching-webhook-python) that you can use on your Rossum account, set up and deploy all by yourself. Let's have a look at how to do it.

![](https://cdn.document360.io/1bb6f6bc-c04c-4ace-a1e8-8c4cfd3fbc98/Images/Documentation/Devs%20-%20Vendor%20Matching%20In%20Master%20Database%20Using%20API%2001.gif)

However we would first encourage you to check out our own [data matching extension](/help/docs/master-data-hub-extension).

## 1. Set up a PostgreSQL database

To set up a PostgreSQL database, you may need to first download and install a management tool such as [pgAdmin](https://www.pgadmin.org/download/). Using this tool, create a database that your webhook will use to match the vendor data.

As the sample vendor matching webhook code uses a fuzzy matching trigram extension, you must call the extension before running the code. After you have created the database, run the following query once:

```plaintext
CREATE EXTENSION IF NOT EXISTS pg_trgm;
```

This will initialize the trigram functionality that is used in the webhook code.

## 2. Set up the microservice

Set up the microservice, install the required dependencies using command line:

```plaintext
$ sudo apt install python3-pip
$ pip3 install -r requirements.txt
```

To allow the webhook to communicate with your PostgreSQL database, edit the access credentials stored in `config.py` and `~/.pgpass` file.

> [!NOTE]
> 📘 Using .pgpass file
> 
> `.pgpass` file shall be added manually to the same level where `webhook.py` is located. The file should contain credentials to your database in the following format:
> 
> *your_host:your_port:db_name:username:password*
> 
> There is no need to add the password to the database to `config.py` script. `psygopg2` will automatically look for the password in this file.

## 3. Fill the database with the vendor data

You can use the data stored in `supportive_data` folder to fill your database for testing purposes. To import the testing vendor data to database, run:

```plaintext
$ python3 import_vendor_data.py supportive_data/vendor_data_de.csv
```

## 4. Add datapoints for matching to your schema

To see the matching happening, you must configure the schema appropriately. Update the schema for the webhook to work, using the example schema file `example_schema.json` in the GitHub repository. You can change the schema [using the Schema Editor](/help/docs/extraction-schema-editor-in-rossum) in the Rossum UI.

## 5. Run the microservice

To run the webhook, proceed with steps 1-4 as described in [this article.](/help/docs/how-to-run-an-extension-microservice)
