> ## Documentation Index
> Fetch the complete documentation index at: https://agents.concierca.ch/llms.txt
> Use this file to discover all available pages before exploring further.

# Suppliers

> Supplier master data: name, currency, lead times, and target stock defaults.

## What it is

Supplier master data — name, currency, default lead time, and target stock days. Suppliers provide the **defaults** for procurement math: a [Product](/api/data-model/products) without its own `lead_time_days` / `target_stock_days` inherits its supplier's `default_*` values. [Purchase Order Lines](/api/data-model/purchase-orders) and products reference suppliers via `supplier_id`.

Fully editable in the app; also ingest-enabled for syncing from an external system.

## How it gets data

Ingest-enabled — `POST /api/ingest/suppliers` (see [Ingest API](/api/ingest)):

```http theme={null}
POST /api/ingest/suppliers
Authorization: Bearer pk_...
Content-Type: application/json
```

* One JSON record per request; unknown fields are dropped.
* **Idempotent upsert** on `(tenant_id, external_id)` — use a stable supplier code as `external_id`.
* `tenant_id` / `workspace_id` come from the API key context, never from the body.

Minimal example payload:

```json theme={null}
{
  "external_id": "SUP-001",
  "name": "Atelier Milano",
  "currency": "EUR",
  "default_lead_time_days": 60,
  "default_lead_time_buffer_days": 14,
  "default_target_stock_days": 120
}
```

## Fields

| Field                           | Label            | Type     | Writable  | Description                                                                                   |
| ------------------------------- | ---------------- | -------- | --------- | --------------------------------------------------------------------------------------------- |
| `name`                          | Name             | text     | ✓         | Supplier display name                                                                         |
| `external_id`                   | External ID      | text     | ✓         | Stable supplier code — the upsert key                                                         |
| `currency`                      | Currency         | text     | ✓         | Default purchasing currency                                                                   |
| `default_lead_time_days`        | Lead Time (days) | number   | ✓         | Default lead time, inherited by products without their own                                    |
| `default_lead_time_buffer_days` | Buffer (days)    | number   | ✓         | Default buffer on top of the lead time                                                        |
| `default_target_stock_days`     | Target Stock (d) | number   | ✓         | Default target coverage after replenishment                                                   |
| `comment`                       | Comment          | text     | ✓         | Free-text note (payment terms, contacts, quirks)                                              |
| `id`                            | ID               | text     | read-only | Internal row id — referenced by `products.supplier_id` and `purchase_order_lines.supplier_id` |
| `created_at`                    | Created          | datetime | read-only | Row creation time                                                                             |

<Note>
  Like every workspace table, suppliers also carry the system columns `tenant_id`, `workspace_id`, and `updated_at` — set automatically, never sent by integrations.
</Note>

## Query it

```json theme={null}
{
  "method": "tools/call",
  "params": {
    "name": "data_query",
    "arguments": {
      "view_slug": "suppliers",
      "select_fields": ["name", "currency", "default_lead_time_days", "default_target_stock_days"],
      "limit": 50
    }
  }
}
```
