# /resellers/import/validate - Validate CSV for reseller import **POST /resellers/import/validate** Upload and validate a CSV file for bulk reseller import. Returns a row-by-row report with a verdict per row (`valid` / `error` / `warning`), separating blocking `errors[]` from non-blocking `warnings[]`. Validated data is stored in a temporary session (30 min TTL) keyed by `import_id`, which must be passed to `/resellers/import/confirm` to actually create or update the resellers. **CSV format** - Columns (in any order): `company_name`, `description`, `vat_number`, `address`, `city`, `main_contact`, `email`, `phone`, `language`, `notes`. - Required: `company_name`, `vat_number`. All other columns are optional. - `phone`, when present, must include the leading `+CC` country prefix (e.g. `+39 02 1234567`). Bare local numbers are rejected with `invalid_format`. - `language` accepts `it` or `en` (defaults to `it` when empty). - The first data row is row `2`. - Standard CSV (RFC 4180) — fields containing commas, quotes or newlines must be double-quoted (`"note, with comma"`). Spreadsheet tools auto-quote on save. **Row outcomes** | status | What it means | Confirm action | |--------|---------------|----------------| | `valid` | All checks passed | CREATE | | `error` | At least one blocking error in `errors[]` (`required`, `invalid_format`, `too_long`, `duplicate_in_csv`, `archived`, …) | always skipped | | `warning` | A reseller with the same `vat` already exists in the database (in `warnings[]`) | UPDATE if `override: true`, else skipped | Reseller imports cannot produce `ambiguous` rows — that status only applies to user imports. **Limits** — max 10 MB, max 1000 rows. Larger files return `400`. ## Servers - Backend API server (port 8080): https://api.your-domain.com/api (Backend API server (port 8080)) - Collect API server (port 8081): https://collect.your-domain.com/api (Collect API server (port 8081)) ## Authentication methods - Bearer auth ## Parameters ### Body: multipart/form-data (object) - **file** (string(binary)) ## Responses ### 200 Validation report #### Body: application/json (object) - **code** (integer) - **message** (string) - **data** (object) Row-by-row validation report produced by `/import/validate`. The full set of CSV rows is always returned in `rows` (good and bad alike) so the frontend can render a preview and let the user decide whether to enable `override` for warnings or pick `resolutions` for ambiguous rows. The accompanying counters are pre-computed for UX summaries. ### 400 Bad request - validation error #### Body: application/json (object) - **code** (integer) HTTP error code - **message** (string) Error message - **data** (object) ### 401 Unauthorized - invalid or missing token #### Body: application/json (object) - **code** (integer) - **message** (string) - **data** (object | null) ### 403 Forbidden - insufficient permissions #### Body: application/json (object) - **code** (integer) - **message** (string) - **data** (object | null) [Powered by Bump.sh](https://bump.sh)