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

# Fackhandelsdata

> Connect Fackhandelsdata (FHD) to BrandGate: key, orders, stock, products, prices, customers and delivery status.

> [!NOTE]
>
> Status: **integration in progress**. Everything on this page is available in the API; FHD's own connector is being built against it.

> [!WARNING]
>
> **Draft mapping.** The field names in the table below are an approximation of Fackhandelsdata's own fields. Confirm them with the vendor before you build; the BrandGate side (endpoints, fields, rules) is final.

Fackhandelsdata (FHD) connects to BrandGate through the [API](/build-an-integration), with one key for each customer company.

## Get the key

**1. The company creates it**

A company admin opens **Settings → Integrations** in BrandGate and uses the **Fackhandelsdata** tile (or the generic **ERP or custom integration** tile) to create a key (**Generate API key**) for the ERP vendor. It has the scopes an ERP integration needs.

**2. The company sends it to FHD**

The key is shown once. The company sends it to FHD through a safe channel. It only ever gives access to that one company, and the company can revoke it at any time.

**3. Build against a test company first**

Ask BrandGate for a test company and a test key through [brandgate.dev/contact](https://www.brandgate.dev/contact). Switch to the customer's key at go-live.

## What FHD does

| FHD needs | How |
| - | - |
| Read BrandGate orders with lines and prices | [Orders](/api-reference/orders/list-orders), [webhooks](/webhooks) and a catch-up sweep |
| Return FHD's order number | [Acknowledge an order](/api-reference/orders/acknowledge-an-order) |
| Send stock levels | [Inventory update](/guides/erp-sync#3-stock-from-the-erp), up to 500 SKUs per request |
| Create and update products and base prices | [Send products, prices and customers](/guides/send-data) |
| Price lists and customer discounts | [Send products, prices and customers](/guides/send-data) |
| Create and update customers, with FHD's customer number | [Send products, prices and customers](/guides/send-data) |
| Delivery status and tracking | [Send products, prices and customers](/guides/send-data) |

## Rules that keep it safe

* **FHD owns** product master data, prices, price lists, customer master data and delivery status. **BrandGate owns** orders, invoices, payments, images and customer logins. See [who owns what](/guides/send-data#who-owns-what).
* **Every write is repeatable.** Send an [`Idempotency-Key`](/idempotency) and your own `external_id`; resending a batch never duplicates.
* **Store BrandGate's order `id` in FHD with a uniqueness rule**, and look it up before creating an order, so a retry after a crash never creates a second order. See the [integration model](/integration-model#idempotency-in-practice).

## Go live

Use the [go-live checklist](/build-an-integration#go-live-checklist).

## Connect it through the API

Building the connection yourself? These are the typical field matches. The steps are the same for every system: [Build an ERP integration](/build-an-integration).

| Fackhandelsdata | BrandGate |
| - | - |
| Artikel number, name, price, VAT, group | product `external_id` and `sku`, `name`, `unit_price`, `vat_rate`, `category` |
| Stock balance | [`POST /v1/inventory`](/guides/erp-sync#3-stock-from-the-erp) |
| Price lists | [price list](/guides/send-data#price-lists-and-customer-prices) |
| Customer number, name, e-mail, address, payment terms, price list | `customer_number` and `external_id`, `company_name`, `email`, `billing_address`, `payment_terms_days`, `price_list` |
| Order number and delivery status | acknowledge, then `shipped` / `delivered` with tracking |

> [!NOTE]
>
> Field names are the ones your ERP usually exposes; check them against your version. Amounts go to BrandGate as decimal strings with at most two decimals (`"299.50"`), so round before you send: ERPs that hold prices as floating-point numbers need `Math.round(x * 100) / 100`.

## What the API cannot hold yet

* Customer discounts in percent and per-article discount agreements. Send the resulting absolute price in the customer's price list.
* EAN and unit of measure.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.