---
updatedAt: 2026-09-15T13:39:30.000Z
agentTools:
  projectIndex: https://docs.company.info/llms.txt
---

# NL Official Documents

📄 NL Official Documents API

## Purpose of the API

The **NL Official Documents API** allows you to **order, track, and
download official documents** from the Dutch Chamber of Commerce (KVK).

Instead of manually navigating the KVK website, you can programmatically
discover available documents, place orders, monitor their processing
status, and download the resulting files in multiple formats.<br />You can use this API to:

* **Discover** which official documents are available for a given
  organization or branch
* **Order** business register extracts (standard extracts)
* **Track** the asynchronous processing status of your orders
* **Download** completed documents in PDF, HTML, or JSON format
* **Reuse** previously ordered documents from cache without placing a
  new order

The API is ideal for KYC/KYB onboarding, compliance workflows, legal
due diligence, financial audits, and any process that requires official
Dutch trade register documents.

***

## How to use?

### 📌 Overview of the Flow

1. **Discover Supported Documents**<br />Start by calling<br />`GET /nl/organizations/official-documents/v1/`<br />to check which documents are available for a specific organization.
   The response includes document types, prices, expected delivery
   times, and available formats.

2. **Place an Order**<br />Once you have identified the document you want, call:<br />`POST /nl/organizations/official-documents/v1/orders`<br />providing the `documentType` and `organizationID` (and optionally
   `branchID`).

3. **Track Order Status**<br />Orders are processed **asynchronously**. Poll the order status by
   calling:<br />`GET /nl/organizations/official-documents/v1/orders/{order_id}`<br />until the status changes from `pending` to `done`.

4. **Download the Document**<br />When the status is `done`, download the document by calling:<br />`GET /nl/organizations/official-documents/v1/orders/{order_id}/document`<br />Specify the desired format via the `Accept` header.

5. **Reuse Existing Documents (Cache)**<br />Before placing a new order, you can check if a document is already
   available in the cache:<br />`GET /nl/organizations/official-documents/v1/documents`<br />If found, download it directly via:<br />`GET /nl/organizations/official-documents/v1/documents/{document_id}`

### 🌀 Flow Behavior

* Orders are processed **asynchronously**. The `POST` call returns
  immediately with a `pending` status — you must poll until the order
  completes.
* If an order fails during processing, you can retry specific
  activities using<br />`POST /nl/organizations/official-documents/v1/orders/{order_id}`.
* The cache endpoint (`/v1/documents`) returns documents previously
  ordered by any customer. Each document includes an `upToDate` flag
  indicating whether it reflects the latest KVK data.
* All list endpoints support **pagination** via `page[number]` and
  `page[size]`.
* All responses follow **JSON:API** conventions for consistency.

### 🔢 Versioning

Current version prefix:<br />`/nl/organizations/official-documents/v1/`

Future versions will follow `/v2/`, `/v3/`, etc.

***

## Base URL

<https://api.company.info>

***

## 🔑 Authentication

All requests must be authenticated using **one** of the following methods:

| Method           | Header                               | Description                                                             |
| ---------------- | ------------------------------------ | ----------------------------------------------------------------------- |
| **API Key**      | `X-API-KEY: <your-api-key>`          | Your unique API key. Validated against the Organization Management API. |
| **Bearer Token** | `Authorization: Bearer <your-token>` | A valid bearer token issued by the authentication service.              |

<Callout icon="💡" theme="default">
  ### You only need to provide **one** of these headers per request. If both are present, the bearer token takes precedence.
</Callout>

***

## 🧩 Core Concepts

Before diving into the endpoints, it helps to understand the domain<br />model:

| Concept      | Description                                                                                                                                                             |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Order**    | A request to retrieve an official document from the KVK. Orders are processed asynchronously and transition through statuses: `pending`, `done`, `failed`, `cancelled`. |
| **Document** | A completed, cached document that has been previously ordered. Documents can be reused without placing a new order.                                                     |

***

# All Endpoints

Below is a complete list of API endpoints.

| # | Method | Endpoint                         | Description                                      |
| - | ------ | -------------------------------- | ------------------------------------------------ |
| 1 | `GET`  | `/v1/`                           | Discover supported documents for an organization |
| 2 | `POST` | `/v1/orders`                     | Place a new document order                       |
| 3 | `GET`  | `/v1/orders`                     | List previously placed orders                    |
| 4 | `GET`  | `/v1/orders/{order_id}`          | Get a specific order                             |
| 5 | `POST` | `/v1/orders/{order_id}`          | Retry a failed order activity                    |
| 6 | `GET`  | `/v1/orders/{order_id}/document` | Download a document from an order                |
| 7 | `GET`  | `/v1/documents`                  | List available cached documents                  |
| 8 | `GET`  | `/v1/documents/{document_id}`    | Download a cached document                       |

> All endpoint paths are relative to `/nl/organizations/official-documents`.

**❗ These endpoints incur usage-based charges.**

***

## 1. Discover Supported Documents

```text
GET /nl/organizations/official-documents/v1/
```

Check which official documents are available for a specific organization.

### Description

Returns the list of document types available for the given Organization
ID (and optionally branch ID), including pricing, expected delivery
time, available formats, and availability status.

***

### Request Parameters

#### Headers

| Name            | Type   | Description                                                                   |
| --------------- | ------ | ----------------------------------------------------------------------------- |
| `X-API-KEY`     | string | Your API key. **Required** if `Authorization` is not provided.                |
| `Authorization` | string | Bearer token (`Bearer <token>`). **Required** if `X-API-KEY` is not provided. |

#### Query Parameters

| Parameter                | Type   | Required | Description             |
| ------------------------ | ------ | -------- | ----------------------- |
| `filter[organizationID]` | string | Yes      | The 8-digit KVK number. |
| `filter[branchID]`       | string | No       | The 12-digit branch ID. |

### Example Request

```curl
curl -X GET "https://api.company.info/nl/organizations/official-documents/v1/?filter[organizationID]=33302047" \
  -H "X-API-KEY: YOUR_API_KEY"
```

### Example Response

```json
{
  "data": {
    "type": "33302047",
    "attributes": {
      "organizationID": "33302047",
      "date": "2024-03-15T11:19:39+01:00",
      "documents": [
        {
          "documentType": "standardExtract",
          "mimeType": "text/html",
          "price": 2.95,
          "available": true,
          "expectedTime": 60,
          "description": "Business Register Extract"
        }
      ]
    }
  },
  "links": {
    "self": "https://api.company.info/nl/organizations/official-documents/v1/?filter[organizationID]=33302047"
  }
}
```

#### Response Fields — `data.attributes`

| Field            | Type   | Description                                              |
| ---------------- | ------ | -------------------------------------------------------- |
| `organizationID` | string | The KVK number of the organization.                      |
| `branchID`       | string | The branch ID (if requested).                            |
| `date`           | string | ISO 8601 timestamp of when the availability was checked. |
| `documents`      | array  | Array of available document types.                       |

#### Response Fields — `documents[]`

| Field          | Type    | Description                                               |
| -------------- | ------- | --------------------------------------------------------- |
| `documentType` | string  | The type of document (see Document Types below).          |
| `mimeType`     | string  | The available MIME type for this document.                |
| `price`        | number  | The price of the document (in EUR).                       |
| `available`    | boolean | Whether the document is currently available for ordering. |
| `expectedTime` | integer | Expected delivery time in seconds.                        |
| `description`  | string  | Human-readable description of the document.               |

***

## 2. 📝 Place an Order

```text
POST /nl/organizations/official-documents/v1/orders
```

Place a new order for an official document.

### Description

Creates a new document order. The order is processed asynchronously —
the response will include an order ID and a `pending` status. You must
poll the order status until it changes to `done` before downloading.

***

### ⁉️ Request Parameters

#### Headers

| Name            | Type   | Description                                                                   |
| --------------- | ------ | ----------------------------------------------------------------------------- |
| `X-API-KEY`     | string | Your API key. **Required** if `Authorization` is not provided.                |
| `Authorization` | string | Bearer token (`Bearer <token>`). **Required** if `X-API-KEY` is not provided. |
| `Content-Type`  | string | **Required.** `application/json`                                              |

#### Request Body

The body must contain a `data` object with the following fields:

| Field                            | Type   | Required | Description                                                |
| -------------------------------- | ------ | -------- | ---------------------------------------------------------- |
| `data.type`                      | string | Yes      | Must be `"orders"`.                                        |
| `data.attributes.documentType`   | string | Yes      | Must be `"standardExtract"`.                               |
| `data.attributes.organizationID` | string | Yes      | The 8-digit KVK number.                                    |
| `data.attributes.branchID`       | string | No       | The 12-digit branch ID (when targeting a specific branch). |

### Example Request

```curl
curl -X POST "https://api.company.info/nl/organizations/official-documents/v1/orders" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "data": {
          "type": "orders",
          "attributes": {
            "documentType": "standardExtract",
            "organizationID": "33302047"
          }
        }
      }'
```

### Example Response

```json
{
  "data": {
    "id": "01HS0SZQECSKQ8NV20391MZ0R1",
    "type": "orders",
    "attributes": {
      "documentType": "standardExtract",
      "status": "pending",
      "organizationID": "33302047",
      "mimeTypes": [
        "text/html",
        "application/pdf",
        "application/json"
      ],
      "createdAt": "2024-03-15T11:19:39+01:00"
    }  
  },
  "links": {
    "self": "https://api.company.info/nl/organizations/official-documents/v1/orders/01HS0SZQECSKQ8NV20391MZ0R1"
  }
}
```

#### Response Fields — `data`

| Field                       | Type      | Description                                                  |
| --------------------------- | --------- | ------------------------------------------------------------ |
| `id`                        | string    | Unique identifier (ULID) for the order.                      |
| `type`                      | string    | Always `"orders"`.                                           |
| `attributes.documentType`   | string    | The type of document ordered.                                |
| `attributes.status`         | string    | Current status: `pending`, `done`, `failed`, or `cancelled`. |
| `attributes.organizationID` | string    | The KVK number.                                              |
| `attributes.mimeTypes`      | \[]string | Available download formats.                                  |
| `attributes.createdAt`      | string    | ISO 8601 timestamp of when the order was created.            |
| `links.self`                | string    | Canonical URL to retrieve this order.                        |

<br />

***

## 3. 📋 List Orders

```text
GET /nl/organizations/official-documents/v1/orders
```

Retrieve a paginated list of previously placed orders.

### Description

Returns all orders matching the specified filters. Useful for finding
a previously placed order or auditing your order history.

***

### ⁉️ Request Parameters

#### Headers

| Name            | Type   | Description                                                                   |
| --------------- | ------ | ----------------------------------------------------------------------------- |
| `X-API-KEY`     | string | Your API key. **Required** if `Authorization` is not provided.                |
| `Authorization` | string | Bearer token (`Bearer <token>`). **Required** if `X-API-KEY` is not provided. |

#### Query Parameters

| Parameter                | Type    | Required | Description                                                    |
| ------------------------ | ------- | -------- | -------------------------------------------------------------- |
| `filter[organizationID]` | string  | No       | Filter by 8-digit KVK number.                                  |
| `filter[branchID]`       | string  | No       | Filter by 12-digit branch ID.                                  |
| `filter[documentType]`   | string  | No       | Filter by document type.                                       |
| `filter[status]`         | string  | No       | Filter by status: `pending`, `done`, `failed`, or `cancelled`. |
| `filter[date][from]`     | string  | No       | Filter by order date from (`YYYY-MM-DD`).                      |
| `filter[date][to]`       | string  | No       | Filter by order date to (`YYYY-MM-DD`).                        |
| `page[number]`           | integer | No       | Page number (default: `1`).                                    |
| `page[size]`             | integer | No       | Records per page (default: `10`, maximum: `20`).               |

### Example Request

```curl
curl -X GET "https://api.company.info/nl/organizations/official-documents/v1/orders?filter[status]=done&filter[organizationID]=33302047" \
  -H "X-API-KEY: YOUR_API_KEY"
```

### Example Response

```json
{
  "data": [
    {
      "id": "01HS0SZQECSKQ8NV20391MZ0R1",
      "type": "orders",
      "attributes": {
        "documentType": "standardExtract",
        "status": "done",
        "organizationID": "33302047",
        "mimeTypes": [
          "text/html",
          "application/pdf",
          "application/json"
        ],
        "createdAt": "2024-03-15T11:19:39+01:00"
      },
      "links": {
        "self": "https://api.company.info/nl/organizations/official-documents/v1/orders/01HS0SZQECSKQ8NV20391MZ0R1"
      }
    }
  ],
  "links": {
    "first": "...?page[number]=1&page[size]=10",
    "last": "...?page[number]=1&page[size]=10",
    "self": "...?page[number]=1&page[size]=10"
  },
  "meta": {
    "totalResults": 1,
    "totalPages": 1
  }
}
```

***

## 4. 📄 Get a Single Order

```text
GET /nl/organizations/official-documents/v1/orders/{order_id}
```

Retrieve a specific order by its ID.

### Description

Returns the full details of the specified order, including its current
status and processing history. Use this to poll order status until it
reaches `done`.

***

### ⁉️ Request Parameters

#### Path

| Name       | Type   | Required | Description          |
| ---------- | ------ | -------- | -------------------- |
| `order_id` | string | Yes      | The ID of the order. |

#### Headers

| Name            | Type   | Description                                                                   |
| --------------- | ------ | ----------------------------------------------------------------------------- |
| `X-API-KEY`     | string | Your API key. **Required** if `Authorization` is not provided.                |
| `Authorization` | string | Bearer token (`Bearer <token>`). **Required** if `X-API-KEY` is not provided. |

### Example Request

```curl
curl -X GET "https://api.company.info/nl/organizations/official-documents/v1/orders/01HS0SZQECSKQ8NV20391MZ0R1" \
  -H "X-API-KEY: YOUR_API_KEY"
```

### Example Response

```json
{
  "data": {
    "id": "01HS0SZQECSKQ8NV20391MZ0R1",
    "type": "orders",
    "attributes": {
      "documentType": "standardExtract",
      "status": "done",
      "organizationID": "33302047",
      "mimeTypes": [
        "text/html",
        "application/pdf",
        "application/json"
      ],
      "createdAt": "2024-03-15T11:19:39+01:00"
    },
  },
  "links": {
    "self": "https://api.company.info/nl/organizations/official-documents/v1/orders/01HS0SZQECSKQ8NV20391MZ0R1"
  }
}
```

### Order Statuses

| Status      | Description                                         |
| ----------- | --------------------------------------------------- |
| `pending`   | The document is still being retrieved from the KVK. |
| `done`      | The document is ready for download.                 |
| `failed`    | An error occurred during processing.                |
| `cancelled` | The order was cancelled.                            |

***

## 5. 🔄 Retry a Failed Order Activity

```text
POST /nl/organizations/official-documents/v1/orders/{order_id}
```

Retry a specific activity on a failed order.

### Description

If an order fails during the ordering or conversion step, you can
retry the failed activity without placing a new order. This is useful
for transient failures.

***

### ⁉️ Request Parameters

#### Path

| Name       | Type   | Required | Description          |
| ---------- | ------ | -------- | -------------------- |
| `order_id` | string | Yes      | The ID of the order. |

#### Headers

| Name            | Type   | Description                                                                   |
| --------------- | ------ | ----------------------------------------------------------------------------- |
| `X-API-KEY`     | string | Your API key. **Required** if `Authorization` is not provided.                |
| `Authorization` | string | Bearer token (`Bearer <token>`). **Required** if `X-API-KEY` is not provided. |
| `Content-Type`  | string | **Required.** `application/json`                                              |

#### Request Body

| Field                      | Type   | Required | Description                                      |
| -------------------------- | ------ | -------- | ------------------------------------------------ |
| `data.type`                | string | Yes      | Must be `"orders"`.                              |
| `data.attributes.activity` | string | Yes      | The activity to retry: `"order"` or `"convert"`. |

### Example Request

```curl
curl -X POST "https://api.company.info/nl/organizations/official-documents/v1/orders/01HS0SZQECSKQ8NV20391MZ0R1" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "data": {
          "type": "orders",
          "attributes": {
            "activity": "convert"
          }
        }
      }'
```

### Example Response

`204 No Content` — the activity has been retried successfully.

***

## 6. 📥 Download a Document (from Order)

```text
GET /nl/organizations/official-documents/v1/orders/{order_id}/document
```

Download the document associated with a completed order.

### Description

Returns the document content in the format specified by the `Accept`
header. The order must have a status of `done` before the document can
be downloaded.

***

### ⁉️ Request Parameters

#### Path

| Name       | Type   | Required | Description          |
| ---------- | ------ | -------- | -------------------- |
| `order_id` | string | Yes      | The ID of the order. |

#### Headers

| Name            | Type   | Description                                                                                                       |
| --------------- | ------ | ----------------------------------------------------------------------------------------------------------------- |
| `X-API-KEY`     | string | Your API key. **Required** if `Authorization` is not provided.                                                    |
| `Authorization` | string | Bearer token (`Bearer <token>`). **Required** if `X-API-KEY` is not provided.                                     |
| `Accept`        | string | **Required.** The desired content type: `application/pdf`, `application/json`, `application/zip`, or `text/html`. |

### Example Request

```curl
curl -X GET "https://api.company.info/nl/organizations/official-documents/v1/orders/01HS0SZQECSKQ8NV20391MZ0R1/document" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Accept: application/pdf" \
  --output document.pdf
```

### Example Response

The response body contains the document content in the requested format.

| Accept Header      | Response Content                          |
| ------------------ | ----------------------------------------- |
| `application/pdf`  | Binary PDF file                           |
| `application/json` | JSON representation of the document       |
| `application/zip`  | ZIP archive containing the document files |
| `text/html`        | HTML representation of the document       |

***

## 7. 📋 List Cached Documents

```text
GET /nl/organizations/official-documents/v1/documents
```

Retrieve a paginated list of previously ordered documents available
in cache.

### Description

Returns documents that have been previously ordered (by you or another
customer) and are available for immediate download. This allows you to
reuse existing documents without placing a new order and incurring
additional charges. Each document includes an `upToDate` flag indicating
whether it reflects the latest KVK data.

***

### ⁉️ Request Parameters

#### Headers

| Name            | Type   | Description                                                                   |
| --------------- | ------ | ----------------------------------------------------------------------------- |
| `X-API-KEY`     | string | Your API key. **Required** if `Authorization` is not provided.                |
| `Authorization` | string | Bearer token (`Bearer <token>`). **Required** if `X-API-KEY` is not provided. |

#### Query Parameters

| Parameter                | Type    | Required | Description                                      |
| ------------------------ | ------- | -------- | ------------------------------------------------ |
| `filter[organizationID]` | string  | Yes      | Filter by 8-digit KVK number.                    |
| `filter[branchID]`       | string  | No       | Filter by 12-digit branch ID.                    |
| `filter[type]`           | string  | Yes      | Filter by document type.                         |
| `filter[date][from]`     | string  | No       | Filter by document date from (`YYYY-MM-DD`).     |
| `filter[date][to]`       | string  | No       | Filter by document date to (`YYYY-MM-DD`).       |
| `page[number]`           | integer | No       | Page number (default: `1`).                      |
| `page[size]`             | integer | No       | Records per page (default: `10`, maximum: `20`). |

### Example Request

```curl
curl -X GET "https://api.company.info/nl/organizations/official-documents/v1/documents?filter[organizationID]=33302047&filter[type]=standardExtract" \
  -H "X-API-KEY: YOUR_API_KEY"
```

### Example Response

```json
{
  "data": [
    {
      "id": "MDFLRVI5TldFMkdHN0I1Nkc1MENSQ1hRV0s...",
      "type": "documents",
      "attributes": {
        "type": "standardExtract",
        "organizationID": "33302047",
        "mimeTypes": [
          "text/html",
          "application/pdf",
          "application/json"
        ],
        "createdAt": "2024-03-15T11:20:15+01:00",
        "upToDate": true
      },
      "links": {
        "self": "https://api.company.info/nl/organizations/official-documents/v1/documents/MDFLRVI5TldFMkdHN0I1Nkc1MENSQ1hRV0s"
      }
    }
  ],
  "links": {
    "first": "...?page[number]=1&page[size]=10",
    "last": "...?page[number]=1&page[size]=10",
    "self": "...?page[number]=1&page[size]=10"
  },
  "meta": {
    "totalResults": 1,
    "totalPages": 1
  }
}
```

#### Response Fields — `data[]`

| Field                       | Type      | Description                                          |
| --------------------------- | --------- | ---------------------------------------------------- |
| `id`                        | string    | Unique identifier for the cached document.           |
| `type`                      | string    | Always `"documents"`.                                |
| `attributes.type`           | string    | The type of document.                                |
| `attributes.organizationID` | string    | The KVK number.                                      |
| `attributes.branchID`       | string    | The Branch KVK number.                               |
| `attributes.mimeTypes`      | string\[] | Available download formats.                          |
| `attributes.createdAt`      | string    | ISO 8601 timestamp of when the document was created. |
| `attributes.upToDate`       | boolean   | Whether the document reflects the latest KVK data.   |
| `links.self`                | string    | Canonical URL to download this document.             |

***

## 8. 📥 Download a Cached Document

```text
GET /nl/organizations/official-documents/v1/documents/{document_id}
```

Download a document directly from cache.

### Description

Returns the document content in the format specified by the `Accept`
header. This allows downloading without placing a new order.

***

### ⁉️ Request Parameters

#### Path

| Name          | Type   | Required | Description             |
| ------------- | ------ | -------- | ----------------------- |
| `document_id` | string | Yes      | The ID of the document. |

#### Headers

| Name            | Type   | Description                                                                                    |
| --------------- | ------ | ---------------------------------------------------------------------------------------------- |
| `X-API-KEY`     | string | Your API key. **Required** if `Authorization` is not provided.                                 |
| `Authorization` | string | Bearer token (`Bearer <token>`). **Required** if `X-API-KEY` is not provided.                  |
| `Accept`        | string | **Required.** The desired content type: `application/pdf`, `application/json`, or `text/html`. |

### Example Request

```curl
curl -X GET "https://api.company.info/nl/organizations/official-documents/v1/documents/MDFLRVI5TldFMkdHN0I1Nkc1MENSQ1hRV0s" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Accept: application/pdf" \
  --output cached_document.pdf
```

### Example Response

The response body contains the document content in the requested format
(same as Endpoint 6).

***

# 📑 Document Types

| Document Type     | Description               | Required Attributes |
| ----------------- | ------------------------- | ------------------- |
| `standardExtract` | Business Register Extract | `organizationID`    |

### Document-Specific Attributes

Some attributes are optional when placing an order:

| Attribute  | Description             |
| ---------- | ----------------------- |
| `branchID` | The 12-digit branch ID. |

***

# 📤 Supported Formats

Documents can be downloaded in the following formats via the `Accept`
header:

| MIME Type          | Format | Description                               |
| ------------------ | ------ | ----------------------------------------- |
| `application/pdf`  | PDF    | Portable Document Format (binary)         |
| `application/json` | JSON   | JSON representation of the document       |
| `application/zip`  | ZIP    | ZIP archive containing the document files |
| `text/html`        | HTML   | HTML representation of the document       |

<Callout icon="⚠️" theme="warn">
  ### Not all formats may be available for every document type. Check

  the `mimeTypes` field in the order or document response to see which
  formats are supported.
</Callout>

***

# 🔢 Pagination

The API uses **JSON:API-style pagination** with `meta` and `links`
objects on list endpoints (`GET /v1/orders` and `GET /v1/documents`).

### Request Parameters

| Parameter      | Type    | Description                                                   |
| -------------- | ------- | ------------------------------------------------------------- |
| `page[number]` | integer | The page number you want to retrieve (1-based, default: `1`). |
| `page[size]`   | integer | How many records per page (default: `10`, maximum: `20`).     |

### Response Fields

```json
"meta": {
  "totalResults": 150,
  "totalPages": 15
},
"links": {
  "first": "...?page[number]=1&page[size]=10",
  "last": "...?page[number]=15&page[size]=10",
  "self": "...?page[number]=2&page[size]=10",
  "next": "...?page[number]=3&page[size]=10",
  "prev": "...?page[number]=1&page[size]=10"
}
```

* Use `links.next` until it no longer appears or until you have all
  records.
* Use `totalResults` and `totalPages` to build progress indicators or
  pagination controls in your UI.

***

# 🔄 Typical Order Workflow

Here is a recommended workflow for ordering and downloading documents:

1. **Discover available documents** (Endpoint 1) — check what is
   available for the target organization.
2. **Check cache first** (Endpoint 7) — see if the document you need
   has already been ordered and is available for immediate download.
3. **Download from cache** (Endpoint 8) — if found and `upToDate` is
   `true`, download directly and skip ordering.
4. **Place an order** (Endpoint 2) — if not cached or out of date,
   place a new order.
5. **Poll for completion** (Endpoint 4) — periodically check the order
   status until it is `done`.
6. **Download the document** (Endpoint 6) — download in your preferred
   format.

### Example Polling Loop

```curl
# Poll every 10 seconds until status is "done"
curl -X GET "https://api.company.info/nl/organizations/official-documents/v1/orders/01HS0SZQECSKQ8NV20391MZ0R1" \
  -H "X-API-KEY: YOUR_API_KEY"
```

***

# ⚠️ Rate Limiting / Other Limitations

* Some environments may enforce **rate limits** per API key.
* Document ordering is subject to KVK processing times — the
  `expectedTime` field in the discovery response gives an estimate.
* Wherever possible, check the cache before placing new orders to
  avoid unnecessary charges.

***

# ⚠️ Possible errors / unexpected behavior

Below is a table with the most common HTTP error responses.

| Status  | Error                 | Description                                                        | How to solve                                                                                                   |
| ------- | --------------------- | ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------- |
| **400** | Bad Request           | Validation error (invalid KVK number, missing required attributes) | Validate parameter names and formats. Check required attributes for the document type.                         |
| **401** | Unauthorized          | Missing or invalid credentials                                     | Ensure `X-API-KEY` or `Authorization: Bearer <token>` is present, not expired, and has sufficient permissions. |
| **403** | Forbidden             | Insufficient permissions for the operation                         | Check that your API key is authorized for the Official Documents API.                                          |
| **404** | Not Found             | Order or document not found                                        | Confirm the `order_id` / `document_id` exists.                                                                 |
| **406** | Not Acceptable        | Requested content type is not supported                            | Check the `Accept` header — use one of: `application/pdf`, `application/json`, or `text/html`.                 |
| **423** | Locked                | The document is not ready yet                                      | The order is still processing. Wait and retry the download later.                                              |
| **500** | Internal Server Error | Unexpected server error                                            | Retry the request after some time. If it persists, contact support with `X-Correlation-Id`.                    |

### Example Error Response

```json
{
  "errors": [
    {
      "status": "423",
      "code": "423",
      "title": "failed on downloading document",
      "detail": "the requested document is not ready yet"
    }
  ]
}
```

***

# 🛠️ Try it yourself!

<Callout icon="✅" theme="okay">
  ### Ready to try it out? Head over to our [API reference](https://docs.company.info) where you can easily test the API yourself.
</Callout>

From there, you can:

* Explore endpoints
* Play with example requests and responses
* See schemas and parameter details
* Use your own API key to test real responses

***

# 🔤 Glossary

| Term                | Definition                                                                                                                 |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| **Order**           | A request to retrieve an official document from the KVK. Orders are processed asynchronously.                              |
| **Document**        | A completed, cached official document available for download without placing a new order.                                  |
| **Organization ID** | Official 8-digit identifier (KVK number) issued by the Dutch Chamber of Commerce (KvK).                                    |
| **Branch ID**       | A 12-digit identifier for a specific branch of an organization.                                                            |
| **Document Type**   | The kind of official document: `standardExtract`.                                                                          |
| **ULID**            | Universally Unique Lexicographically Sortable Identifier — used for order IDs.                                             |
| **JSON:API**        | A specification for building APIs in JSON with consistent structure for `data`, `included`, `meta`, `links`, and `errors`. |
| **MIME Type**       | The format of the document content: `application/pdf`, `application/json`, `application/zip` or `text/html`.               |
| **Cache**           | Previously ordered documents stored for reuse. Check the `upToDate` flag to determine freshness.                           |

***

### Processing History Titles

| Title                  | Description                                                   |
| ---------------------- | ------------------------------------------------------------- |
| `orderIsProcessing`    | The order is currently being processed.                       |
| `orderIsDone`          | The order has completed successfully.                         |
| `conversionFailure`    | The document conversion step failed.                          |
| `timeout`              | The order timed out waiting for a response from KVK.          |
| `companyNotFound`      | The specified company was not found in the KVK register.      |
| `documentTypeNotFound` | The requested document type is not available.                 |
| `notAvailable`         | The document is not available for the specified organization. |

***