u
This commit is contained in:
41
docs/api/routes/company/import.md
Normal file
41
docs/api/routes/company/import.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# `POST /company/import`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Import company catalog from zip archive (SSE)
|
||||
|
||||
Uploads a .zip archive containing company export data (categories, articles, pictures),
|
||||
preserves archive contents under `data/import/<companyId>/`, and executes full catalog
|
||||
import (categories hierarchy, articles upsert, variant linking, image processing).
|
||||
Streams progress events via Server-Sent Events (`text/event-stream`).
|
||||
|
||||
|
||||
## Body (`multipart/form-data`)
|
||||
|
||||
| Field | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `file` | no | file | ZIP archive (.zip) containing company data |
|
||||
|
||||
## Response `200`
|
||||
|
||||
Import progress stream (`text/event-stream`) or JSON result
|
||||
|
||||
```json
|
||||
{
|
||||
"ok": true,
|
||||
"message": "Import erfolgreich abgeschlossen.",
|
||||
"stats": {}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Bad request (missing file, not a zip, or no company selected) — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 500 | Server error — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
Reference in New Issue
Block a user