## Overview

The Part Inventory importer creates new inventory or updates existing inventory from a single CSV. The distinction is row-by-row:

- Rows **without** an `id` value **create** new inventory. `part_number` is required.
- Rows **with** an `id` value **update** the matching inventory record. `part_number` and `revision` are ignored on update.

Creates run through the same path used by the UI, so aBOM creation, serial autogeneration, and tracking-type validation all apply. Updates run through the matching update path, so cascade behavior such as location propagation and quantity validation is preserved.

## Columns

| Column                   | Required                        | Description                                                                                                                                                                                             |
|-------------------------|---------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id`                    | No                              | Inventory ID. Provide to update an existing record; omit (or leave blank for the row) to create new inventory. **Lookup column**: an empty cell is treated as “not provided,” not `0`.              |
| `part_number`          | Yes (for create)               | Part number for new inventory. Ignored on update.                                                                                                                                                      |
| `revision`              | No                              | Part revision. Combined with `part_number` to look up the part; if omitted, the latest revision is used.                                                                                                 |
| `serial_number`        | No                              | Serial number.                                                                                                                                                                                          |
| `lot_number`           | No                              | Lot number.                                                                                                                                                                                             |
| `quantity`             | No                              | Quantity. Must be non-negative. Empty cells become `0`.                                                                                                                                                 |
| `quantity_scrapped`    | No                              | Scrapped quantity. Must be non-negative. Empty cells become `0`.                                                                                                                                     |
| `location`             | No                              | Location name. Must match an existing location in ION.                                                                                                                                                 |
| `supplier`             | No                              | Supplier name. Must match an existing supplier in ION.                                                                                                                                                |
| `unit_of_measure`      | No                              | Unit of measure name. Must match an existing unit in ION.                                                                                                                                             |
| `intent_option`        | No                              | Intent option value. Must match a configured intent option.                                                                                                                                           |
| `autogenerate_serial`   | No                              | When `true` on a create row, ION generates a serial number. Cannot be set on update rows. Boolean field (see [accepted values](https://docs.firstresonance.io/administration/ion-importers#accepted-boolean-values)). |
| `autogenerate_lot`     | No                              | When `true` on a create row, ION generates a lot number. Cannot be set on update rows. Boolean field (see [accepted values](https://docs.firstresonance.io/administration/ion-importers#accepted-boolean-values)). |

Name-valued fields (`location`, `supplier`, `unit_of_measure`, `intent_option`) are resolved case-insensitively against existing records. An unrecognized name produces a row-level error.

`autogenerate_serial` and `autogenerate_lot` only apply on create rows. Setting either to `true` on a row that includes an `id` is rejected. Remove the `id` or the flag to fix the row.

## Custom attributes

Any column not listed above is treated as a custom attribute on the part inventory. Custom attribute columns must match a configured attribute key for your organization; unknown columns cause a validation error.
