> For the complete documentation index, see [llms.txt](https://developer.emporix.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.emporix.io/document-intake-cockpit/configuration-examples/order-intake/document-type.md).

# Document Type

Create the Order document type and define every field required by validation, approval, the review form, and line-item calculations.

Create the **Order** (`ORDER_INTAKE`) document type and all fields used later in this walkthrough. Keep the keys and capitalization exactly as shown because rules, actions, and form bindings depend on the resulting paths.

{% hint style="info" %}
For the general UI procedure, see [Document Configuration](/document-intake-cockpit/configuration/document-configuration.md).
{% endhint %}

## Creating the type and schema

{% stepper %}
{% step %}

#### Open Document Configuration

In the Document Intake Cockpit, open **Configuration** → **Document Configuration**. Select **New Document Type**.
{% endstep %}

{% step %}

#### Enter the type details

Set **ID** to `ORDER_INTAKE` and **Name (EN)** to **Order**. **Order** appears under **Documents**. Select **Save**.
{% endstep %}

{% step %}

#### Open the schema

Select **Configure schema**, or use the type row's edit action to open **Schema Editor**. Work on the **Attributes** tab.
{% endstep %}

{% step %}

#### Add the field groups

Add the groups and nested fields from [Order schema](#order-schema). Turn on **Nullable** for every extracted leaf field. Validation must happen after the document exists, through the [Business Rules](/document-intake-cockpit/configuration-examples/order-intake/business-rules.md).
{% endstep %}

{% step %}

#### Save the schema

Select **Save** on **Attributes**.
{% endstep %}
{% endstepper %}

<figure><img src="https://1808414410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPBaf05o2vgbdikMFDTyz%2Fuploads%2Fgit-blob-7a52efc87bcb5642fb7b0c4443a6e15e03c8b68e%2Fdocument_configuration_new_type.png?alt=media" alt="New Document Type dialog with ID and Name (EN)"><figcaption><p>New document type with ID ORDER_INTAKE and name Order</p></figcaption></figure>

<figure><img src="https://1808414410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPBaf05o2vgbdikMFDTyz%2Fuploads%2Fgit-blob-97f71a84c016c1ad2bf185a0db75b153bbb15d73%2Fdocument_configuration_schema.png?alt=media" alt="Schema Editor Attributes tree with nested header, customer, line items, and total"><figcaption><p>Schema Editor Attributes for Order with Header, customer, line items, and Total</p></figcaption></figure>

## Order schema

Every field below is in this **Order** schema. **Name** is the label in Schema Editor, and the last segment of **Path** is the key. Turn on **Nullable** for every leaf field.

### Header

| Name         | Path                              | Type     | What it is for                                                                                |
| ------------ | --------------------------------- | -------- | --------------------------------------------------------------------------------------------- |
| **Header**   | `header`                          | `OBJECT` | Buyer, company, and order currency                                                            |
| **Customer** | `header.customer`                 | `OBJECT` | Buyer details filled from the PDF or selected during review                                   |
| **Name**     | `header.customer.name`            | `TEXT`   | Buyer name                                                                                    |
| **Address**  | `header.customer.address`         | `OBJECT` | Buyer address, overwritable from the customer's default address                               |
| **City**     | `header.customer.address.city`    | `TEXT`   | Buyer city                                                                                    |
| **Country**  | `header.customer.address.country` | `TEXT`   | Buyer country                                                                                 |
| **Street**   | `header.customer.address.street`  | `TEXT`   | Buyer street                                                                                  |
| **Email**    | `header.customer.email`           | `TEXT`   | Buyer email, overwritable from the customer dropdown                                          |
| **ID**       | `header.customer.id`              | `TEXT`   | Customer record ID, set during review with **Customer ID**, often empty after intake          |
| **Company**  | `header.company`                  | `OBJECT` | Company used for approval                                                                     |
| **ID**       | `header.company.id`               | `TEXT`   | Company record ID, set during review with **Company ID**. Approval reads this path.           |
| **Name**     | `header.company.name`             | `TEXT`   | Company name from the PDF or company dropdown. The business rule requires it before approval. |
| **Currency** | `header.currency`                 | `TEXT`   | ISO 4217 currency code, for example `EUR`. Currency controls use this path.                   |

### Shipping address

| Name                 | Path                      | Type     | What it is for                                                                                         |
| -------------------- | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| **Shipping address** | `shippingAddress`         | `OBJECT` | Delivery address beside **Header**, outside **Customer**. The customer dropdown does not overwrite it. |
| **City**             | `shippingAddress.city`    | `TEXT`   | Delivery city                                                                                          |
| **Country**          | `shippingAddress.country` | `TEXT`   | Delivery country                                                                                       |
| **Street**           | `shippingAddress.street`  | `TEXT`   | Delivery street                                                                                        |

### Line items

| Name            | Path                   | Type                               | What it is for                                                                              |
| --------------- | ---------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------- |
| **Line Items**  | `lineItems`            | `ARRAY` of `OBJECT`                | One row per product                                                                         |
| **ID**          | `lineItems.id`         | `TEXT`                             | Catalog product ID, set during review with the **Product** lookup, often empty after intake |
| **Name**        | `lineItems.name`       | `TEXT`                             | Product name from the PDF, replaceable with the catalog name                                |
| **SKU**         | `lineItems.sku`        | `TEXT`                             | Product code from the PDF, replaceable with the catalog SKU (`code`)                        |
| **Amount**      | `lineItems.amount`     | `DECIMAL`, precision `0.01`        | Line net amount, normally quantity × unit price                                             |
| **Unit Price**  | `lineItems.unitPrice`  | `DECIMAL`, precision `0.01`        | Price for one item                                                                          |
| **Tax**         | `lineItems.tax`        | `DECIMAL`, precision `0.01`        | Tax on the line, as extracted or edited                                                     |
| **Total Price** | `lineItems.totalPrice` | `DECIMAL`, precision `0.01`        | Line gross total from the PDF, including tax when the source document presents it that way  |
| **Quantity**    | `lineItems.quantity`   | `DECIMAL`, precision **None (−1)** | Quantity ordered. **None (−1)** allows more than two decimal places.                        |

### Total

| Name      | Path    | Type                        | What it is for                                                                                              |
| --------- | ------- | --------------------------- | ----------------------------------------------------------------------------------------------------------- |
| **Total** | `total` | `DECIMAL`, precision `0.01` | Order amount used for approval. It stays independent of the line table unless you add a rule or hook later. |

{% hint style="info" %}
Write clear **Description (EN)** instructions for extraction. For example, describe **Header** → **Customer** as the buyer, **Header** → **Company** as the seller or legal entity used for approval, and **Total** as the final order amount used for approval.
{% endhint %}

## Checkpoint

Before continuing, reopen **Configure schema** and confirm:

* `header.customer.name`, `header.company.id`, `header.company.name`, `header.currency`, `lineItems`, and `total` exist.
* All extracted leaf fields are nullable.
* **Line Items** is an **ARRAY** whose item type is **OBJECT**.

Next, configure [Auto Matching](/document-intake-cockpit/configuration-examples/order-intake/auto-matching.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.emporix.io/document-intake-cockpit/configuration-examples/order-intake/document-type.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
