Import up to 300 lots atomically
Map the user's columns to client_row_id, material, lot_number, unit, location_id, quantity, source, expires_on, content_per_unit, content_unit. The source column is the supplier. JSON rows may also carry supplier, maker and catalog_number; a maker or catalog number is recorded when the row creates the material or the material records none, and a row that states a different one than the material records, or than an earlier row, is refused (compared ignoring case). Show the proposed mapping and rows to the person, obtain explicit confirmation, then make this single import call. CSV uses that header and RFC 4180 quoting, with an optional final new_unit column (true, false or empty). JSON rows accept new_unit: true; --new-unit names each client_row_id to add deliberately. List known units with labbench lots units. Measures remain refused. Pass your own --idempotency-key (a UUID you keep) so an import whose answer is lost can be retried: rerun it with the same key and data and the API returns the first import with replayed true and stocks nothing again. Without the flag each run sends a new key. The same key with different data is refused with idempotency_key_reused.
labbench lots import [flags]
labbench lots import --data <data> --format <format>
| Flag | Type | Default | Description |
|---|---|---|---|
--data (required) | string | bounded JSON or CSV data; each row may carry new_unit: true (optional final CSV column) | |
--format (required) | string | input format: json or csv | |
--idempotency-key | string | import key; resend the same key and data to retry safely (default: a new one) | |
--new-unit | stringArray | [] | client_row_id to deliberately add its counted unit; repeat per row |
Every command also accepts the global flags.