> For the complete documentation index, see [llms.txt](https://typless.gitbook.io/typlessapi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://typless.gitbook.io/typlessapi/automation-use-cases/supplier-descriptions.md). Agents can also search and read this documentation through its [MCP server](https://typless.gitbook.io/typlessapi/~gitbook/mcp).

# Supplier descriptions

Using feedback and supplier descriptions to steer a pretrained model for individual suppliers, with examples in Python and Node.

### Overview

A pretrained model reads every supplier's documents with the same field descriptions. Most suppliers are extracted correctly that way, but some have their own conventions: dates in the US format, two numbers that look like an invoice number, amounts with a comma as the decimal separator. This guide shows how to fix such a supplier without touching the document type: you confirm one of its documents, which creates the supplier, and give the supplier a description. Examples are in **Python** and **Node**.

The examples use the **pretrained-invoice** document type from the [Pretrained invoice](https://typless.gitbook.io/typlessapi/automation-use-cases/pretrained-invoice.md) guide and a supplier, *Kestrelwood Logistics GmbH*, that writes dates as MM/DD/YYYY: `10/06/2026` is 6 October 2026, not 10 June.

**This guide shows you how to**

1. [Confirm a document to create the supplier](#id-1.-confirm-a-document)
2. [Write the supplier description](#id-2.-write-the-supplier-description)
3. [Extract the supplier's next documents](#id-3.-extract-the-next-documents)

## Get your API Key

The *Authorization* header for your API key is: `Token YOUR-API-KEY` ([Login](https://app.typless.com/login/?redirect=https://docs.typless.com/) if you do not see one).\
You can also obtain the **API key** by visiting the [API Keys page](https://app.typless.com/settings/api-keys).

<figure><img src="https://2174127710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FePXqOCeLb4FOuZhmYG8X%2Fuploads%2Fgit-blob-05bd0b7a3f05edcaa4e7e94708a8c16da9596015%2Fimage.png?alt=media" alt=""><figcaption><p>Getting your API key</p></figcaption></figure>

## Which description to use

| The problem affects                      | Fix it in                                                                                                                                                                 |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| One field, for all suppliers             | The field's description in the document type                                                                                                                              |
| The kind of documents, for all suppliers | The document type's ***Description***                                                                                                                                     |
| Documents of one supplier                | The supplier description (this guide)                                                                                                                                     |
| One document only                        | `additional_extraction_fields` in the request, see [Custom pretrained document](https://typless.gitbook.io/typlessapi/automation-use-cases/custom-pretrained-document.md) |

See [Descriptions and presets](https://typless.gitbook.io/typlessapi/typless/document-type/descriptions-and-presets.md) for all descriptions.

## 1. Confirm a document

[Extract](https://typless.gitbook.io/pages/HQp5SyW3P3MvOPcSKSWu#id-2.-extract-data-from-documents) a document of the supplier and let your users check it. Then send the correct values with [**add-document-feedback**](https://typless.gitbook.io/typlessapi/api-docs/api-schema.md#api-add-document-feedback):

* `document_object_id` is the `object_id` of the extraction result.
* `learning_fields` contains every field of the document type, with `""` for fields that are not on the document.
* `supplier_name` is the supplier's name the way you want to see it in Typless. Use the same name for all its documents; letter case doesn't matter.

<details>

<summary><strong>1 Collect the checked values</strong> <em><mark style="color:green;">(Lines 3-20)</mark></em></summary>

Values your users confirmed or corrected, one entry per field of the document type.

</details>

<details>

<summary><strong>2 Send the feedback</strong> <em><mark style="color:green;">(Lines 22-30)</mark></em></summary>

Send the values with the `object_id` of the extraction.

</details>

{% tabs %}
{% tab title="Python" %}
{% code lineNumbers="true" %}

```python
import requests

learning_fields = [
    {"name": "supplier_name", "value": "Kestrelwood Logistics GmbH"},
    {"name": "supplier_vat_id", "value": "ATU12345678"},
    {"name": "buyer_name", "value": "Typless Demo Buyer d.o.o."},
    {"name": "buyer_vat_id", "value": "SI87654321"},
    {"name": "invoice_number", "value": "KL-5531"},
    {"name": "payment_reference", "value": "KL5531"},
    {"name": "invoice_date", "value": "2026-10-06"},
    {"name": "payment_due_date", "value": "2026-11-05"},
    {"name": "service_date", "value": "2026-10-06"},
    {"name": "net_amount", "value": "395.00"},
    {"name": "vat_amount", "value": "79.00"},
    {"name": "total_amount", "value": "474.00"},
    {"name": "IBAN", "value": "AT000000000000000002"},
    {"name": "payment_purpose_code", "value": ""},
    {"name": "purchasing_order", "value": ""},
    {"name": "currency", "value": "EUR"}
]

payload = {
    "document_type_name": "pretrained-invoice",
    "document_object_id": "<object_id from the extraction result>",
    "learning_fields": learning_fields
}

headers = {"Authorization": "<<apiKey>>"}
response = requests.post("https://developers.typless.com/api/v1/add-document-feedback", json=payload, headers=headers)
print(response.json())
```

{% endcode %}
{% endtab %}

{% tab title="Node" %}

```javascript
const learningFields = [
  { name: 'supplier_name', value: 'Kestrelwood Logistics GmbH' },
  { name: 'supplier_vat_id', value: 'ATU12345678' },
  { name: 'buyer_name', value: 'Typless Demo Buyer d.o.o.' },
  { name: 'buyer_vat_id', value: 'SI87654321' },
  { name: 'invoice_number', value: 'KL-5531' },
  { name: 'payment_reference', value: 'KL5531' },
  { name: 'invoice_date', value: '2026-10-06' },
  { name: 'payment_due_date', value: '2026-11-05' },
  { name: 'service_date', value: '2026-10-06' },
  { name: 'net_amount', value: '395.00' },
  { name: 'vat_amount', value: '79.00' },
  { name: 'total_amount', value: '474.00' },
  { name: 'IBAN', value: 'AT000000000000000002' },
  { name: 'payment_purpose_code', value: '' },
  { name: 'purchasing_order', value: '' },
  { name: 'currency', value: 'EUR' }
];

fetch('https://developers.typless.com/api/v1/add-document-feedback', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json', 'Authorization': '<<apiKey>>' },
  body: JSON.stringify({
    document_type_name: 'pretrained-invoice',
    document_object_id: '<object_id from the extraction result>',
    learning_fields: learningFields
  })
})
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
```

{% endtab %}
{% endtabs %}

The supplier now appears in the document type's ***Models*** view. It is matched to the supplier's next documents by their content, so the next invoice of *Kestrelwood Logistics GmbH* is recognised even before anybody confirms it.

{% hint style="info" %}
You can also confirm documents in the [training room](https://typless.gitbook.io/typlessapi/typless-hub/document-type.md#training-room): upload the document, correct the values and confirm them.
{% endhint %}

## 2. Write the supplier description

1. On the ***Document types*** page, open the actions menu of **pretrained-invoice** and choose ***Models***.
2. Open the actions menu of *Kestrelwood Logistics GmbH* and choose ***Edit description***.
3. Describe the supplier's convention and click ***Save***:

*This supplier writes dates as MM/DD/YYYY, for example 10/06/2026 is 6 October 2026.*

<figure><img src="https://2174127710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FePXqOCeLb4FOuZhmYG8X%2Fuploads%2Fgit-blob-e87e92f3fcdb334e72627c6e14566a74c1315cd9%2Fdocument-type-03-edit-description.png?alt=media" alt=""><figcaption><p>Supplier description</p></figcaption></figure>

Good supplier descriptions are short and specific:

* State the rule and give one example from a real document.
* Name the label the supplier uses: *The invoice number is the number after "Račun št.", not the order number.*
* Say what to ignore: *Ignore the second page, it repeats the first page in German.*
* Don't repeat the field descriptions; the model already has them.

## 3. Extract the next documents

Nothing changes in your integration. When a new document is matched to *Kestrelwood Logistics GmbH*, Typless adds the supplier description to the extraction. The result contains the `supplier_id` of the matched supplier, so you can check which supplier a document was matched to.

If a supplier is not recognised, confirm one or two more of its documents: Typless compares new documents with the confirmed documents of every supplier.

{% hint style="success" %}
Keep confirming documents of all suppliers. Each confirmation keeps the supplier list complete, so you can react quickly when a supplier changes its documents.
{% endhint %}

## Running Typless live

The only thing that you need to do to automate your manual data entry is to integrate those simple API calls into your system.

{% hint style="success" %}
Have any questions, or do you need some help? Contact us via email <mark style="color:green;">**<support@typless.com>**</mark>**.**
{% endhint %}
