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

# CSV imports

> Prepare core data and address book CSV files before importing them into Batchlane.

Batchlane imports CSV files by filename. Upload one or more supported files, run **Validate / dry run**, fix every reported row error, then queue the import. Dry runs do not create jobs, documents, lots, items, customers, or audit events.

The first data row is row 2 because row 1 is the header row.

## Import rules

* Owners and admins can import core data.
* File names matter. Unsupported file names are rejected.
* Referenced records must already exist or be included in the same import bundle.
* Dry-run errors should be fixed in the source CSV, not worked around inside the app.
* Queued import jobs store their source bundle as an import document for audit history.

## Core data files

Upload these files from Settings > Import / Export.

| File                    | Required columns                                   | Optional columns                                                                            |
| ----------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `items.csv`             | `sku`, `name`                                      | `type`, `unit`, `storage`, `reorder_point`, `standard_cost`, `shelf_life_days`, `allergens` |
| `lots.csv`              | `internal_lot`, `sku`, `quantity`                  | `supplier`, `supplier_lot`, `location`, `unit`, `cost`, `status`, `received_at`, `expiry`   |
| `recipes.csv`           | `code`, `output_sku`, `yield_quantity`             | `name`, `version`, `yield_unit`, `status`                                                   |
| `recipe_components.csv` | `recipe_code`, `component_sku`, `quantity`         | `version`, `unit`, `component_type`                                                         |
| `orders.csv`            | `order_number`, `customer`, `item_sku`, `quantity` | `unit`, `status`, `requested_ship_date`, billing address columns, shipping address columns  |

Core imports are validated and applied in this order: items, lots, recipes, recipe components, then orders.

## Accepted values

| Field           | Accepted values                                                 |
| --------------- | --------------------------------------------------------------- |
| Item `type`     | `raw_material`, `packaging`, `wip`, `finished`, `finished_good` |
| Lot `status`    | `available`, `hold`, `quarantined`, `consumed`, `shipped`       |
| Recipe `status` | `draft`, `active`                                               |
| Order `status`  | `draft`, `allocated`, `partially_allocated`                     |
| Dates           | `YYYY-MM-DD`                                                    |

Blank item type defaults to raw material. Blank lot status defaults to available. Blank recipe status defaults to draft. Numeric quantities and yields must be greater than zero. Costs and reorder points must be zero or greater.

## Address book files

Upload these files from Address Book > Import / Export. See [Address book](/address-book) for operating context.

| File            | Required columns | Optional columns                                                   |
| --------------- | ---------------- | ------------------------------------------------------------------ |
| `customers.csv` | `name`           | `customer_code`, `code`, `contact_email`, `phone`, address columns |
| `suppliers.csv` | `name`           | `code`, `contact_email`, `phone`, `approved`, address columns      |

Address columns use the `address_` prefix: `address_label`, `address_line1`, `address_line2`, `address_city`, `address_region`, `address_postal_code`, `address_country`, `address_contact_name`, and `address_phone`. Repeat a customer or supplier row to load multiple addresses for the same company. Company-level fields must be blank or match across repeated rows. `address_line1` is required when any address fields are filled. Address labels must be unique per customer or supplier in the same import. Blank address labels default to `Default`. Blank address country values default to `US`.

## Examples

Example `items.csv`:

```csv theme={null}
sku,name,type,unit,storage,reorder_point,standard_cost,shelf_life_days,allergens
RM-TOMATO-PASTE,Tomato paste,raw_material,lb,Ambient,25,12.50,365,milk;soy
```

Example `lots.csv`:

```csv theme={null}
internal_lot,sku,quantity,supplier,supplier_lot,location,unit,cost,status,received_at,expiry
LOT-0001,RM-TOMATO-PASTE,120,Acme Ingredients,A-7781,Receiving dock,lb,12.50,available,2026-06-17,2027-03-31
```

Example `orders.csv`:

```csv theme={null}
order_number,customer,item_sku,quantity,unit,status,requested_ship_date,ship_to_line1,ship_to_city,ship_to_region,ship_to_postal_code,ship_to_country
SO-1001,Corner Market,FG-SAUCE-12OZ,24,case,draft,2026-06-24,100 Market St,Raleigh,NC,27601,US
```

## Validation report

The dry-run report lists row counts and validation errors before anything is queued. Error locations use `file row N`; for example, `items.csv row 2` points to the first data row in `items.csv`.

Fix all reported errors before queueing the import. If a queued import later fails, the job history keeps row-level validation details.

Related pages: [Implementation checklist](/implementation-checklist), [Settings and roles](/settings-and-roles), [Common errors](/common-errors), [Reports](/reports).
