> 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.md).

# Configure Order Intake

Configure and verify an Order workflow in the Document Intake Cockpit, from extracted fields and validation through approval and the Inbox queue.

Use this walkthrough to configure an **Order** (`ORDER_INTAKE`) workflow in the Document Intake Cockpit. When you finish, an incoming order can be validated, corrected, submitted for approval, approved or rejected, and found in the **Orders** queue.

{% hint style="info" %}
This is a reference configuration for an already provisioned Document Intake tenant, not a built-in template or deployment guide. Create the values described on these pages in your tenant.
{% endhint %}

{% hint style="warning" %}
This walkthrough configures order documents in the **Document Intake Cockpit**. It does not configure the separate [Order Intake Cockpit](https://developer.emporix.io/order-intake-cockpit/), which creates sales orders from uploaded purchase orders.
{% endhint %}

## Prerequisites

Before you start, you need the following:

* A provisioned Document Intake tenant with the current base schemas, including `documentMetadata` support for approval-matrix selection and approval history.
* Administrator access to the Document Intake Cockpit configuration pages.
* One active employee who can act as the test approver, plus a way to sign in as that employee for the approval test.
* An order PDF that contains a buyer or company name, at least one line item, and a total.
* The `invoice-save-action`, `business-rules-supervisor`, `invoice-approval-engine`, and `document-status-state-machine` cloud functions deployed in the tenant. They must appear in cloud-function selectors.
* The approved `approval-matrix-rule` source supplied by the team that provisions your tenant.
* **Customer** and **Product** sources configured in [Master Data](/document-intake-cockpit/configuration/master-data.md) if you want to follow the worked Auto Matching setup.
* A mailbox and Document Intake Value Streams to create the first document from an email, including post-parse automation that invokes `document-status-state-machine` after the Order mixin is persisted. These are configured outside the cockpit; see [Document Intake Process](/document-intake-cockpit/document-intake-process.md).

{% hint style="warning" %}
Do not use this walkthrough to bootstrap a blank tenant. Ask your implementation team to provision the Document Intake data model, cloud functions, approval-matrix rule source, and Value Streams first. Do not continue if any required function is missing: edits cannot be persisted, validation cannot select an approval matrix, or workflow statuses and approval cannot complete.
{% endhint %}

## Configuration flow

Follow these pages in order. Each page ends with a checkpoint; continue only after it passes.

1. [Document Type](/document-intake-cockpit/configuration-examples/order-intake/document-type.md) – Create **Order** and all fields used later.
2. [Auto Matching](/document-intake-cockpit/configuration-examples/order-intake/auto-matching.md) – Match customers by email and products by SKU, name, or an AI-assisted fallback.
3. [Business Rules](/document-intake-cockpit/configuration-examples/order-intake/business-rules.md) – Generate, test, deploy, and activate the required-company rule.
4. [Approval and Rejection](/document-intake-cockpit/configuration-examples/order-intake/approval.md) – Bind **Company ID** and **Total**, create a usable approval matrix, and add a rejection reason.
5. [State Transitions](/document-intake-cockpit/configuration-examples/order-intake/state-transitions.md) – Create the six statuses and connect validation and approval outcomes.
6. [Form Layout](/document-intake-cockpit/configuration-examples/order-intake/form-layout.md) – Build the form and header actions used beside the PDF.
7. [Orders Queue](/document-intake-cockpit/configuration-examples/order-intake/queue.md) – Create the **Orders** entry under **Inbox**.

For this walkthrough, intake persists the Order mixin, runs the matching configured in your tenant flow, and invokes `document-status-state-machine` so the document reaches **Parsed**. Validation starts when **Revalidate** is selected. The diagram summarizes the resulting workflow rather than one automatic function chain.

```mermaid
---
config:
  theme: base
  look: classic
  themeVariables:
    background: transparent
    lineColor: "#9CBBE3"
    arrowheadColor: "#9CBBE3"
    edgeLabelBackground: "#FFC128"
    edgeLabelTextColor: "#4C5359"
---
flowchart LR
    A@{ shape: stadium, label: "Order parsed" }
    M@{ shape: rounded, label: "Match customer and products" }
    B@{ shape: diamond, label: "Validation" }
    C@{ shape: rounded, label: "Validation Errors" }
    D@{ shape: rounded, label: "Pending Approval" }
    E@{ shape: stadium, label: "Approved" }
    F@{ shape: stadium, label: "Rejected" }

    A --> M
    M --> B
    B -->|Error| C
    C -->|Correct, save, revalidate| B
    B -->|Success| D
    D -->|Approve| E
    D -->|Reject| F

    classDef step fill:#F2F6FA,stroke:#4C5359,stroke-width:1px
    classDef decision fill:#A1BDDC,stroke:#4C5359,stroke-width:1px
    classDef waiting fill:#DDE6EE,stroke:#4C5359,stroke-width:1px
    classDef done fill:#3B73BB,stroke:#3B73BB,color:#FFFFFF,stroke-width:1px
    classDef stop fill:#F2F6FA,stroke:#E86C07,stroke-width:1px

    class A,M step
    class B decision
    class C,D waiting
    class E done
    class F stop
```

## Verifying the result

{% stepper %}
{% step %}

#### Process a test order

Send the test PDF through the configured mailbox and Value Streams. If you are validating only the cockpit configuration, your implementation team can instead provide an existing **Order** test document.
{% endstep %}

{% step %}

#### Confirm validation

Open **Inbox** → **Orders**, open the document, and select **Manage**. Confirm that its status is **Parsed**. If it remains **Start**, stop and ask the implementation team to verify the post-parse `document-status-state-machine` invocation.

Select **Revalidate**. If **Company ID** or **Company Name** is empty, the document must move to **Validation Errors** and list the missing-field issues.
{% endstep %}

{% step %}

#### Correct and revalidate

Select **Edit**, enter or select the company, and select **Save**. Then select **Revalidate**. The document must move to **Pending Approval**, select the matrix you created, and assign its first approver.
{% endstep %}

{% step %}

#### Complete approval

Sign in as the assigned approver, open the document from **Inbox** → **Orders**, select **Manage**, then select the **Approval** header action. Approve or reject the order. An approval moves the document to **Approved**. A rejection moves it to **Rejected** and records the selected rejection reason in **History**.
{% endstep %}

{% step %}

#### Check the queues

Confirm that the terminal document leaves **Needs attention** but remains on **All documents**.
{% endstep %}
{% endstepper %}

## Optional extensions

Add these integrations only when the core flow above works:

* Replace manual form fields with Customer and Product controls from [Lookups and Dropdowns](/document-intake-cockpit/configuration/form-layouts/form-layout-lookups.md).
* Restrict the **Orders** queue, **Order** documents, and configuration pages in [Access Configuration](/document-intake-cockpit/configuration/access-configuration.md).
* Add order-specific folders and classification instructions under **Configuration** → **Email Configuration**. See [Email Configuration](/document-intake-cockpit/configuration/email-configuration.md).
* Add a custom post-approval cloud function only if your implementation creates a sales order or starts another downstream process.

For the review workflow and troubleshooting information, see [Managing Documents](/document-intake-cockpit/cockpit-views/managing-a-document.md). The screens on the Configuration pages are the same editors this walkthrough uses. These example pages add the Order field values, function names, and checkpoints.


---

# 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.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.
