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

# Import and Export

> Create or update many orders from an .xlsx or .csv file, and download the Orders list as a file.

From **Activities › Order** you can import many orders from a file and export the list you see as a file.

## Import orders

<Note>
  Required permission:

  * View Order
  * Add Order
</Note>

**Import** is shown when at least one Order Type is published. One import fills one Order Type.

1. Open **Activities › Order** and click **Import**.
2. Choose the **Order Type**, download its template and fill it in.
3. Upload the file and click **Next** to check it.
4. Review the preview and start the import.

<div align="center">
  <img src="https://mintcdn.com/mileappv4/is2Iz6JyejGk_jkF/images/v4/activities/order/import-orders.png?fit=max&auto=format&n=is2Iz6JyejGk_jkF&q=85&s=52fdcae0a1711ccdf4852b9d52bfac41" alt="Import orders dialog" width="600" data-path="images/v4/activities/order/import-orders.png" />
</div>

1. **Order Type**

The Order Type the rows are imported into.

2. **Download template**

Downloads an `.xlsx` file whose columns are that Order Type's fields. Fill one row per order. A list (line items) field takes one row per line: rows with the same order key form one order.

3. **Upload a file**

Choose a `.xlsx` or `.csv` file, or drop it on the box. A file of another type is refused ("Choose a .xlsx or .csv file."), as is a file over 10 MB. Click the bin icon to remove the file and choose another.

4. **Next**

Checks the file and opens the preview. Nothing is created yet.

### Step 2: Preview

The dialog moves through three steps, **File**, **Preview** and **Result**, shown at the top.

The preview lists every row with what will happen to it:

* **New**: a new order will be created.
* **Updates …**: an order that already exists (matched by the Order Type's unique value) will be updated. An order that has already finished is not updated.
* **Replaced**: a later row in the same file has the same order, so this row is skipped ("Replaced by row …").
* **Error**: the row is wrong, for example a required value is missing or a number is below its minimum. The error is shown on the row.

Click a count at the top of the preview to show only those rows. If any row has an error, the import cannot start: "Fix the rows with errors in the file, then upload it again." Use **Back** to choose the fixed file.

When there are no errors, click **Import … rows** to start.

<Note>
  The preview expires after a while. If it does, you see "The preview expired. Upload the file again."
</Note>

### Step 3: Result

The import runs in the background ("Importing… 12 of 40"). You can close the dialog; the import keeps running and the new orders appear in the list.

When it finishes, you see how many orders were created, updated and refused, for example "37 created · 2 updated · 1 refused". If any row was refused, **Download refused rows** downloads a file with those rows and the reason for each, so you can fix and import them again. **Open orders** shows the Orders list.

Each imported order starts its Order Type's steps the same way as an order created from the web app, and its **History** shows how it was created.

## Export orders

<Note>
  Required permission:

  * View Order
</Note>

Click **Export** on the Orders list. The export takes the same search and filters you have set on the list, so filter first to export only the orders you need.

1. You see "Export started. The file downloads when it is ready."
2. When the file is ready, it downloads as an `.xlsx` file and you see "Export ready: … orders."

If the export fails, you see "Could not export orders. Try again." The **Export** button is disabled while an export is running.

## Related

* [Order](/pages/activities/order/introduction)
* [Creating an order](/pages/activities/order/creating-an-order)
* [Order Type](/pages/workflow/order-type/introduction)


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