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

# Managing Order Types

> Create, rename, duplicate, test and delete order types.

Order types are managed from **Workflow › Order Type** and from the order type editor.

> [!NOTE]
>
> Required permission:
>
> * View Order Type
> * Add Order Type
> * Edit Order Type
> * Delete Order Type

## Create an order type

Click **New** on the Order Types list.

![New Order Type dialog](https://mintcdn.com/mileapp-e5b5ea5a/MZrbk7DbLJ-tkmal/images/v4/workflow/order-type/create.png?fit=max\&auto=format\&n=MZrbk7DbLJ-tkmal\&q=85\&s=40076f63e1d789b429cfbcb105a5c326)

1. **Name**

The order type's name, for example *Pickup and Delivery*. Required.

2. **Code**

A short code used in order numbers, e.g. DO. Required, and unique in your organization: if another order type uses it, the dialog says **This code is already used by another Order Type**.

3. **Description**

Optional notes about what the order type is for.

Click **Create**. The new order type opens in the editor as a **Draft**. Add its fields, statuses and steps as described in [Building an Order Type](https://docs.mile.app/pages/workflow/order-type/building-an-order-type.md), then click **Save** to make it live.

> [!NOTE]
>
> **New** appears only for a role with **Add Order Type**.

## Rename an order type

In the editor, click the pencil icon (**Rename**) beside the tabs.

![Rename Order Type dialog](https://mintcdn.com/mileapp-e5b5ea5a/MZrbk7DbLJ-tkmal/images/v4/workflow/order-type/rename.png?fit=max\&auto=format\&n=MZrbk7DbLJ-tkmal\&q=85\&s=7e923edb38e0b71f62d774c53f2a1f93)

1. **Name**

Type the new name and click **Save**. Names are unique, so a name another order type already uses is refused. Saving the new name also saves the rest of your changes, the same way the editor's **Save** does.

The code cannot be changed after the order type is created.

## Duplicate or delete an order type

Open the **⋯** menu at the end of a row on the Order Types list.

![Order type row menu](https://mintcdn.com/mileapp-e5b5ea5a/MZrbk7DbLJ-tkmal/images/v4/workflow/order-type/row-menu.png?fit=max\&auto=format\&n=MZrbk7DbLJ-tkmal\&q=85\&s=fb364e31806fa1452a1a50299d69b516)

1. **Duplicate**

Creates a copy named after the original with " (copy)" added, for example *Pickup and Delivery (copy)*, with the same fields, statuses and steps and a numbered code, for example *PD2*. The copy opens in the editor as a draft. Secret webhook header values are not copied and must be entered again.

2. **Delete**

Deletes the order type after you confirm. Only an order type without orders can be deleted: for one that has orders, **Delete** is disabled and its tooltip says **This Order Type has orders and cannot be deleted.**

> [!NOTE]
>
> **Duplicate** appears only for a role with **Add Order Type**, and **Delete** only for a role with **Delete Order Type**.

## Test an order type

**Test order** in the editor runs the order type on sample values to show which path an order would take. It runs your current draft on the server. **Nothing is saved, no task is created and no call is sent.**

![Test order](https://mintcdn.com/mileapp-e5b5ea5a/MZrbk7DbLJ-tkmal/images/v4/workflow/order-type/test-order.png?fit=max\&auto=format\&n=MZrbk7DbLJ-tkmal\&q=85\&s=f17c750780262dd587e8fa2a8b96c7f1)

1. **Testing**

Shows the canvas is in test mode. Click its **×** to exit the test and go back to editing.

2. **Order values**

The order's hub and field values to test with. Required fields are marked.

3. **Answers**

The answers each Create task step would receive, per attempt, for example the *Approval result* of the Approval task. Pick **Approved** or **Rejected** to try both paths.

Click **Run**. The result shows **Finished with status …** or **Stopped at …** with the reason, for example *no rule matched*. The canvas replays the run step by step: use **Play**, **Pause**, **Previous step**, **Next step** and **Show the result**, and change the **Speed**. Each step is marked *done*, *waiting*, *not taken* or *stopped*. **Reset** clears the run.

If the draft has problems, the test says **Fix the problems first** and names them.

## Order type states

| State | Meaning |
| - | - |
| **Draft** | Created but never live. No orders can be created from it yet. |
| **Published** | Live. New orders use it. |
| **Published · draft changes** | Live, with saved changes that are not live yet because they have problems. New orders keep using the live version until the problems are fixed and you save again. |


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