Product Import Service
Overview
The Product Import service handles importing products from CSV files for a specific entity (supplier). It supports previewing the column mappings before committing the import.
All operations are tenant-aware.
Endpoints
POST
/api/v1/ProductImport/entity/{entityId}
Imports products from a CSV file for the specified entity.
Route parameters:
entityId(long, required) - supplier entity identifier
Request:
multipart/form-data— CSV file upload (IFormFile)
Behavior:
- Parses and validates CSV content
- Creates new products or updates existing ones based on SKU
- Associates products with the given entity as supplier
- Partial failures are logged — import completes even if some rows are invalid
Response:
200 OK—ProductImportResult(summary of created/updated/failed rows)
Authorization:
- Requires Bearer Token
- Permission:
FullManage
POST
/api/v1/ProductImport/entity/{entityId}/preview-mappings
Previews column mappings from a CSV file without performing the import.
Route parameters:
entityId(long, required) - supplier entity identifier
Request:
multipart/form-data— CSV file upload (IFormFile)
Behavior:
- Parses the CSV header row and sample data
- Returns column-to-field mapping suggestions
Response:
200 OK—List<ColumnMappingPreview>— suggested column mappings
Authorization:
- Requires Bearer Token
- Permission:
FullManage
Notes
- Use
preview-mappingsbeforeimportto validate the CSV structure - Import is entity-scoped — products are linked to the supplier entity
- All state-changing operations are audited
- Internal errors are logged but not exposed to clients