diff --git a/README.md b/README.md index 8824c61..cc3fd8f 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Ein webbasiertes Enterprise-Dashboard, das verschiedene Unternehmenssysteme inte ## Inhaltsverzeichnis -- [Ueberblick](#ueberblick) +- [Überblick](#überblick) - [Tech-Stack](#tech-stack) - [Projektstruktur](#projektstruktur) - [Voraussetzungen](#voraussetzungen) @@ -29,7 +29,7 @@ Ein webbasiertes Enterprise-Dashboard, das verschiedene Unternehmenssysteme inte --- -## Ueberblick +## Überblick tOS ist ein modulares Enterprise Operating System mit folgenden Kernbereichen: @@ -51,7 +51,6 @@ tOS ist ein modulares Enterprise Operating System mit folgenden Kernbereichen: | **Auth** | Keycloak 24, NextAuth 4 | | **Infrastruktur** | Docker Compose, pnpm 9, Turborepo | | **Sprachen** | TypeScript 5.6, i18n via next-intl (DE/EN) | -| **Testing** | Vitest (Frontend), Jest (Backend) | --- @@ -63,14 +62,14 @@ tOS/ │ ├── web/ # Next.js 14 Frontend (Port 3000) │ │ ├── src/ │ │ │ ├── app/[locale]/ # App Router mit i18n -│ │ │ │ ├── (auth)/ # Geschuetzte Routen -│ │ │ │ └── login/ # Oeffentliche Login-Seite +│ │ │ │ ├── (auth)/ # Geschützte Routen +│ │ │ │ └── login/ # Öffentliche Login-Seite │ │ │ ├── components/ # React-Komponenten (ui, layout, dashboard, hr, lean) │ │ │ ├── hooks/ # Custom Hooks (hr, lean, integrations) │ │ │ ├── lib/ # Utilities, API-Client, Auth-Config │ │ │ ├── stores/ # Zustand State Management │ │ │ └── types/ # TypeScript-Typen -│ │ └── messages/ # i18n Uebersetzungen (de.json, en.json) +│ │ └── messages/ # i18n Übersetzungen (de.json, en.json) │ │ │ └── api/ # NestJS 10 Backend (Port 3001) │ ├── src/ @@ -81,6 +80,7 @@ tOS/ │ │ │ ├── integrations/ # 7 API-Connectoren + Sync │ │ │ ├── dashboard/ # Widget-Daten & Statistiken │ │ │ ├── departments/# Abteilungsverwaltung +│ │ │ ├── user-preferences/ # Benutzereinstellungen │ │ │ └── audit/ # Audit-Logging │ │ └── common/ # Filter, Interceptors, Pipes │ └── prisma/ # Schema, Migrations, Seed @@ -88,6 +88,9 @@ tOS/ ├── packages/ │ └── shared/ # Gemeinsame Typen & Utilities │ +├── docs/ +│ └── integrations/ # API-Dokumentationen (z.B. PlentyONE Swagger) +│ ├── docker/ │ ├── docker-compose.yml # PostgreSQL, Redis, Keycloak │ ├── keycloak/ # Realm-Export & Config @@ -127,9 +130,6 @@ pnpm install ### 3. Environment-Variablen einrichten ```bash -# Root -cp .env.example .env - # Docker cp docker/.env.example docker/.env @@ -140,7 +140,7 @@ cp apps/api/.env.example apps/api/.env cp apps/web/.env.example apps/web/.env ``` -Die `.env.example`-Dateien enthalten alle benoetigten Variablen mit Entwicklungs-Standardwerten. +Die `.env.example`-Dateien enthalten alle benötigten Variablen mit Entwicklungs-Standardwerten. ### 4. Docker-Services starten @@ -152,7 +152,7 @@ Startet PostgreSQL (5432), Redis (6379) und Keycloak (8080). ### 5. Anwendungs-Datenbank erstellen -Keycloak verwendet die Datenbank `tos_db`. Die Anwendung benoetigt eine separate Datenbank `tos_app`: +Keycloak verwendet die Datenbank `tos_db`. Die Anwendung benötigt eine separate Datenbank `tos_app`: ```bash docker exec -it tos-postgres psql -U tos_user -d tos_db -c "CREATE DATABASE tos_app;" @@ -164,7 +164,7 @@ docker exec -it tos-postgres psql -U tos_user -d tos_db -c "CREATE DATABASE tos_ pnpm db:push ``` -### 7. Datenbank mit Stammdaten befuellen +### 7. Datenbank mit Stammdaten befüllen ```bash pnpm db:seed @@ -172,7 +172,15 @@ pnpm db:seed Erstellt Rollen (admin, hr-manager, team-lead, employee), Abteilungen und einen Entwickler-Admin-Benutzer. -### 8. Entwicklungsserver starten +### 8. Shared Package bauen + +```bash +pnpm --filter @tos/shared build +``` + +Das Shared Package muss vor dem ersten Start gebaut werden, da API und Web die kompilierten Typen benötigen. + +### 9. Entwicklungsserver starten ```bash pnpm dev @@ -197,7 +205,7 @@ pnpm dev | `pnpm dev:web` | Nur Frontend starten | | `pnpm dev:api` | Nur Backend starten | | `pnpm build` | Alle Apps bauen | -| `pnpm typecheck` | TypeScript-Pruefung | +| `pnpm typecheck` | TypeScript-Prüfung | | `pnpm lint` | Code-Linting | | `pnpm format` | Code-Formatierung | @@ -207,9 +215,9 @@ pnpm dev |--------|-------------| | `pnpm db:generate` | Prisma Client generieren | | `pnpm db:push` | Schema in die Datenbank pushen | -| `pnpm db:migrate` | Migrationen ausfuehren | +| `pnpm db:migrate` | Migrationen ausführen | | `pnpm db:seed` | Stammdaten einspielen | -| `pnpm db:studio` | Prisma Studio oeffnen | +| `pnpm db:studio` | Prisma Studio öffnen | ### Docker @@ -217,16 +225,9 @@ pnpm dev |--------|-------------| | `pnpm docker:up` | Container starten | | `pnpm docker:down` | Container stoppen | +| `pnpm docker:ps` | Container-Status anzeigen | | `pnpm docker:logs` | Container-Logs anzeigen | -| `pnpm docker:reset` | Container + Volumes zuruecksetzen | - -### Tests - -| Script | Beschreibung | -|--------|-------------| -| `pnpm test` | Alle Tests ausfuehren | -| `pnpm test:watch` | Tests im Watch-Modus | -| `pnpm test:e2e` | End-to-End-Tests | +| `pnpm docker:reset` | Container + Volumes zurücksetzen | --- @@ -235,15 +236,15 @@ pnpm dev ### Authentifizierung ``` -Browser -> Next.js (NextAuth) -> Keycloak (OAuth2/OIDC) - | - v -Browser -> Next.js -> NestJS API (JWT Guard) -> Keycloak (Token-Validierung) +Browser → Next.js (NextAuth) → Keycloak (OAuth2/OIDC) + │ + ▼ +Browser → Next.js → NestJS API (JWT Guard) → Keycloak (Token-Validierung) ``` -- **Frontend:** NextAuth mit Keycloak-Provider (JWT-Strategie) +- **Frontend:** NextAuth mit Keycloak-Provider, automatische Weiterleitung zum Keycloak-Login - **Backend:** Passport-JWT mit globalem Guard (`@Public()` zum Deaktivieren) -- **Guard-Kette:** JWT -> Rollen -> Permissions +- **Guard-Kette:** JWT → Rollen → Permissions ### Rollen-System @@ -251,19 +252,19 @@ Browser -> Next.js -> NestJS API (JWT Guard) -> Keycloak (Token-Validierung) |-------|-------------| | `admin` | Vollzugriff auf alle Bereiche | | `hr-manager` | HR-Verwaltung + LEAN-Zugriff | -| `manager` | Abteilungsuebergreifende Sicht | +| `manager` | Abteilungsübergreifende Sicht | | `department_head` | Abteilungsleitung | | `team-lead` | Teamleitung mit direkten Reports | | `employee` | Standard-Mitarbeiterzugriff | ### Permissions -Feingranulare Berechtigungen pro Modul (z.B. `EMPLOYEES_VIEW`, `ABSENCES_APPROVE`, `INTEGRATIONS_MANAGE`). Jede Rolle hat ein vorkonfiguriertes Permission-Set, das ueber die Datenbank angepasst werden kann. +Feingranulare Berechtigungen pro Modul (z.B. `EMPLOYEES_VIEW`, `ABSENCES_APPROVE`, `INTEGRATIONS_MANAGE`). Jede Rolle hat ein vorkonfiguriertes Permission-Set, das über die Datenbank angepasst werden kann. ### Frontend-Architektur -- **App Router** mit `[locale]` Segment fuer i18n -- **Server/Client Split:** `page.tsx` (Server) -> `*-content.tsx` (Client) +- **App Router** mit `[locale]` Segment für i18n +- **Server/Client Split:** `page.tsx` (Server) → `*-content.tsx` (Client) - **State Management:** Zustand (UI-State), TanStack Query (Server-State) - **Component Library:** shadcn/ui auf Radix UI Basis @@ -273,16 +274,16 @@ Feingranulare Berechtigungen pro Modul (z.B. `EMPLOYEES_VIEW`, `ABSENCES_APPROVE ### Dashboard -Anpassbares Widget-Grid mit Drag & Drop (dnd-kit). Verfuegbare Widgets: +Anpassbares Widget-Grid mit Drag & Drop (dnd-kit). Verfügbare Widgets: | Widget | Beschreibung | |--------|-------------| -| Welcome | Begruessung mit Benutzerinfo | +| Welcome | Begrüßung mit Benutzerinfo | | Clock | Digitale Uhr | | Stats | KPI-Statistiken | -| Quick Actions | Schnellzugriff auf haeufige Aktionen | -| Calendar | Kalenderuebersicht | -| Activity | Aktivitaetsfeed | +| Quick Actions | Schnellzugriff auf häufige Aktionen | +| Calendar | Kalenderübersicht | +| Activity | Aktivitätsfeed | | Orders | PlentyONE Bestellungen | | Chat | Zulip Nachrichten | | Tasks | Todoist Aufgaben | @@ -294,13 +295,13 @@ Anpassbares Widget-Grid mit Drag & Drop (dnd-kit). Verfuegbare Widgets: ### HR-Modul - **Mitarbeiterverwaltung** - CRUD, Detailansicht, Neuanlage -- **Zeiterfassung** - Stempeluhr, Uebersichten pro Mitarbeiter -- **Abwesenheiten** - Antraege, Genehmigungen, Kalenderansicht +- **Zeiterfassung** - Stempeluhr, Übersichten pro Mitarbeiter +- **Abwesenheiten** - Anträge, Genehmigungen, Kalenderansicht - **Organigramm** - Visuelle Unternehmensstruktur ### LEAN-Modul -- **3S-Planung** - Seiri (Sortieren), Seiton (Systematisieren), Seiso (Saeubern) +- **3S-Planung** - Seiri (Sortieren), Seiton (Systematisieren), Seiso (Säubern) - **Morning Meeting** - SQCDM-Board (Safety, Quality, Cost, Delivery, Morale) - **Skill Matrix** - Kompetenzerfassung und -bewertung pro Abteilung @@ -311,7 +312,7 @@ Anpassbares Widget-Grid mit Drag & Drop (dnd-kit). Verfuegbare Widgets: | System | Typ | Funktionen | |--------|-----|-----------| | **PlentyONE** | ERP | Bestellungen, Artikel, Kontakte | -| **Zulip** | Chat | Nachrichten, Streams, Praesenz | +| **Zulip** | Chat | Nachrichten, Streams, Präsenz | | **Todoist** | Tasks | Aufgaben, Projekte | | **FreeScout** | Helpdesk | Tickets, Konversationen | | **Nextcloud** | Cloud | Dateien, Ordner, Freigaben | @@ -328,13 +329,13 @@ Anpassbares Widget-Grid mit Drag & Drop (dnd-kit). Verfuegbare Widgets: ## API-Dokumentation -Die interaktive API-Dokumentation ist via Swagger UI verfuegbar: +Die interaktive API-Dokumentation ist via Swagger UI verfügbar: ``` http://localhost:3001/api/docs ``` -Authentifizierung erfolgt ueber Bearer JWT-Token. Die API ist in folgende Bereiche unterteilt: +Authentifizierung erfolgt über Bearer JWT-Token. Die API ist in folgende Bereiche unterteilt: - `auth` - Authentifizierung - `users` - Benutzerverwaltung @@ -357,7 +358,7 @@ Authentifizierung erfolgt ueber Bearer JWT-Token. Die API ist in folgende Bereic Beide laufen auf derselben PostgreSQL-Instanz. -### Schema-Uebersicht +### Schema-Übersicht | Bereich | Modelle | |---------|---------| @@ -373,7 +374,7 @@ Beide laufen auf derselben PostgreSQL-Instanz. pnpm db:studio ``` -Oeffnet eine Web-UI zur direkten Datenbank-Inspektion unter http://localhost:5555. +Öffnet eine Web-UI zur direkten Datenbank-Inspektion unter http://localhost:5555. --- @@ -387,9 +388,11 @@ Der Realm `tOS` wird beim Start automatisch aus `docker/keycloak/realm-export.js | Client | Typ | Verwendung | |--------|-----|-----------| -| `tos-frontend` | Confidential | NextAuth (Frontend-Authentifizierung) | +| `tos-nextauth` | Confidential | NextAuth (Frontend-Authentifizierung) | | `tos-backend` | Confidential | NestJS (Service-Account, Token-Validierung) | +> **Hinweis:** Der Client `tos-nextauth` muss einmalig manuell in der Keycloak Admin-Konsole angelegt werden. Der Realm-Export enthält nur `tos-frontend` und `tos-backend`. Siehe `apps/web/.env` für die benötigten Client-Einstellungen. + ### Rollen & Gruppen **Realm-Rollen:** admin, hr-manager, manager, department_head, team-lead, employee @@ -424,13 +427,13 @@ Passwort: admin |----------|-------------| | `DATABASE_URL` | PostgreSQL Connection String (tos_app) | | `PORT` | API-Port (3001) | -| `JWT_SECRET` | JWT-Signaturschluessel | +| `JWT_SECRET` | JWT-Signaturschlüssel | | `KEYCLOAK_URL` | Keycloak-URL | | `KEYCLOAK_REALM` | Realm-Name (tOS) | | `KEYCLOAK_CLIENT_ID` | Backend-Client-ID | | `KEYCLOAK_CLIENT_SECRET` | Backend-Client-Secret | | `REDIS_HOST` / `REDIS_PORT` | Redis-Verbindung | -| `ENCRYPTION_KEY` | AES-256-Schluessel (32 Bytes) | +| `ENCRYPTION_KEY` | AES-256-Schlüssel (32 Bytes) | | `SWAGGER_ENABLED` | Swagger UI aktivieren | | `ENABLE_SYNC_JOBS` | Integrations-Sync aktivieren | @@ -441,12 +444,12 @@ Passwort: admin | `NEXT_PUBLIC_API_URL` | Backend-API-URL | | `NEXT_PUBLIC_APP_URL` | Frontend-URL | | `NEXTAUTH_URL` | NextAuth-Callback-URL | -| `NEXTAUTH_SECRET` | NextAuth-Signaturschluessel | +| `NEXTAUTH_SECRET` | NextAuth-Signaturschlüssel | | `KEYCLOAK_CLIENT_ID` | Frontend-Client-ID | | `KEYCLOAK_CLIENT_SECRET` | Frontend-Client-Secret | | `KEYCLOAK_ISSUER` | Keycloak Issuer-URL | -Vollstaendige Beispiele befinden sich in den jeweiligen `.env.example`-Dateien. +Vollständige Beispiele befinden sich in den jeweiligen `.env.example`-Dateien. --- diff --git a/docs/integrations/plentymarkets-api.json b/docs/integrations/plentymarkets-api.json new file mode 100644 index 0000000..03a9701 --- /dev/null +++ b/docs/integrations/plentymarkets-api.json @@ -0,0 +1 @@ +{"swagger":"2.0","info":{"version":"1.0.0","title":"plentyONE REST-API","x-logo":{"url":"https:\/\/cdn01.plentymarkets.com\/avw8j9fg70hi\/frontend\/Logos_PlentyONE\/PlentyONE_Logo_White_RGB.png","backgroundColor":"#FFFFFF"},"description":"The plentyONE REST API expands the functionality of the plentyONE CMS and allows access to resources, i.e. data records, via unique URI paths","contact":{"name":"plentyONE","url":"https:\/\/help.plentyone.com"}},"schemes":["https"],"consumes":["application\/json"],"host":"example.com","basePath":"\/","tags":[{"name":"Account","description":"Routes for Account","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/account"}},{"name":"Accounting","description":"Routes for Accounting","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/accounting"}},{"name":"AddressDesign","description":"Routes for AddressDesign","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/address_design"}},{"name":"AuditLog","description":"Routes for AuditLog","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/audit_log"}},{"name":"Authentication","description":"Routes for Authentication","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/authentication"}},{"name":"Authorization","description":"Routes for Authorization","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/authorization"}},{"name":"BI","description":"Routes for BI","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/b_i"}},{"name":"Basket","description":"Routes for Basket","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/basket"}},{"name":"Batch","description":"Routes for Batch","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/batch"}},{"name":"Blog","description":"Routes for Blog","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/blog"}},{"name":"Board","description":"Routes for Board","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/board"}},{"name":"Boards","description":"Routes for Boards","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/boards"}},{"name":"Catalog","description":"Routes for Catalog","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/catalog"}},{"name":"Category","description":"Routes for Category","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/category"}},{"name":"Cloud","description":"Routes for Cloud","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/cloud"}},{"name":"Comment","description":"Routes for Comment","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/comment"}},{"name":"Configuration","description":"Routes for Configuration","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/configuration"}},{"name":"Document","description":"Routes for Document","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/document"}},{"name":"ElasticSync","description":"Routes for ElasticSync","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/elastic_sync"}},{"name":"Export","description":"Routes for Export","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/export"}},{"name":"ExportSettings","description":"Routes for ExportSettings","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/export_settings"}},{"name":"Feedback","description":"Routes for Feedback","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/feedback"}},{"name":"Fulfillment","description":"Routes for Fulfillment","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/fulfillment"}},{"name":"Item","description":"Routes for Item","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/item"}},{"name":"LegalInformation","description":"Routes for LegalInformation","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/legal_information"}},{"name":"Listing","description":"Routes for Listing","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/listing"}},{"name":"Log","description":"Routes for Log","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/log"}},{"name":"MailTemplates","description":"Routes for MailTemplates","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/mail_templates"}},{"name":"Market","description":"Routes for Market","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/market"}},{"name":"Messenger","description":"Routes for Messenger","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/messenger"}},{"name":"Newsletter","description":"Routes for Newsletter","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/newsletter"}},{"name":"Order","description":"Routes for Order","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/order"}},{"name":"OrderSummary","description":"Routes for OrderSummary","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/order_summary"}},{"name":"Payment","description":"Routes for Payment","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/payment"}},{"name":"Pim","description":"Routes for Pim","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/pim"}},{"name":"PluginMultilingualism","description":"Routes for PluginMultilingualism","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/plugin_multilingualism"}},{"name":"PluginSet","description":"Routes for PluginSet","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/plugin_set"}},{"name":"Plugins","description":"Routes for Plugins","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/plugins"}},{"name":"Property","description":"Routes for Property","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/property"}},{"name":"Returns","description":"Routes for Returns","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/returns"}},{"name":"ShopBuilder","description":"Routes for ShopBuilder","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/shop_builder"}},{"name":"Stock","description":"Routes for Stock","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/stock"}},{"name":"StockManagement","description":"Routes for StockManagement","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/stock_management"}},{"name":"Sync","description":"Routes for Sync","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/sync"}},{"name":"Tag","description":"Routes for Tag","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/tag"}},{"name":"Ticket","description":"Routes for Ticket","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/ticket"}},{"name":"TicketMessage","description":"Routes for TicketMessage","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/ticket_message"}},{"name":"Todo","description":"Routes for Todo","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/todo"}},{"name":"User","description":"Routes for User","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/user"}},{"name":"Warehouse","description":"Routes for Warehouse","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/warehouse"}},{"name":"Webstore","description":"Routes for Webstore","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/webstore"}},{"name":"Wizard","description":"Routes for Wizard","externalDocs":{"description":"For the old documentation click here","url":"https:\/\/developers.plentymarkets.com\/rest-doc\/wizard"}},{"name":"plentyMarketplace","description":"Routes for plentyMarketplace"}],"paths":{"\/export\/{exportKey}":{"get":{"summary":"Export an elastic export.","description":"Export an elastic export. The export ID must be specified.","tags":["Export"],"responses":{"200":{"description":"OK","schema":{"$ref":"#\/definitions\/mixed"}},"401":{"description":"The resource owner or authorization server denied the request. - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter."}},"parameters":[{"name":"exportKey","type":"integer","required":true,"description":"","format":"integer","in":"path"}]}},"\/export\/{exportKey}\/{token}":{"get":{"summary":"Export an elastic export.","description":"Export an elastic export. The export ID must be specified.","tags":["Export"],"responses":{"200":{"description":"OK","schema":{"$ref":"#\/definitions\/mixed"}},"401":{"description":"The resource owner or authorization server denied the request. - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter."}},"parameters":[{"name":"exportKey","type":"integer","required":true,"description":"","format":"integer","in":"path"},{"name":"token","type":"integer","required":true,"description":"","format":"integer","in":"path"}]}},"\/rest\/account\/login":{"post":{"summary":"Login frontend user","description":"Logs in to the online store with frontend user credentials. The login call returns a JSON object that contains information, such as the access token and the refresh token.","tags":["Account"],"responses":{"200":{"description":"OK","schema":{"$ref":"#\/definitions\/TokenData"}}},"parameters":[{"in":"body","name":"\/rest\/account\/login","schema":{"type":"object","properties":{"password":{"type":"string","description":"Password of the front end user"},"email":{"type":"string","description":"Email address of the front end user"},"id":{"type":"integer","description":"ID of the front end user"}}}}]}},"\/rest\/account\/login\/refresh":{"post":{"summary":"Refresh access token","description":"Refreshes the access token using the refresh token. The refresh token is part of the login call response.","tags":["Account"],"responses":{"200":{"description":"OK"}}}},"\/rest\/account\/logout":{"post":{"summary":"Logout frontend user","description":"Logs out the frontend user from the online store. The access token expires.","tags":["Account"],"responses":{"200":{"description":"OK"}}}},"\/rest\/accounting\/locations":{"post":{"summary":"Create an accounting location","description":"Creates an accounting location for a client. The plenty ID of the client must be specified.","tags":["Accounting"],"security":[{"oAuth2":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#\/definitions\/AccountingLocation"},"examples":{"application\/json":{"name":"Lebanon","clientId":2216259,"countryId":317,"plentyId":16052}}},"401":{"description":"The resource owner or authorization server denied the request. - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter."}},"parameters":[{"in":"body","name":"\/rest\/accounting\/locations","schema":{"type":"object","properties":{"countryId":{"type":"integer","description":"The ID of the country of the accounting location"},"name":{"type":"string","description":"The name of the accounting location"},"plentyId":{"type":"integer","description":"The plenty ID of the client that the accounting location belongs to"}}}}]}},"\/rest\/accounting\/locations\/existing_accounts":{"get":{"summary":"Get all unique posting accounts","description":"Get all unique posting accounts from the PostingAccountRepositoryContract.","tags":["Accounting"],"security":[{"oAuth2":[]}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#\/definitions\/PostingAccounts"}}},"401":{"description":"The resource owner or authorization server denied the request. - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter."}}}},"\/rest\/accounting\/locations\/posting_accounts":{"get":{"summary":"Get all posting accounts","description":"Get all posting accounts from the PostingAccountRepositoryContract.","tags":["Accounting"],"security":[{"oAuth2":[]}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#\/definitions\/PostingAccounts"}}},"401":{"description":"The resource owner or authorization server denied the request. - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter."}}},"post":{"summary":"Save posting accounts","description":"Save all posting accounts.","tags":["Accounting"],"security":[{"oAuth2":[]}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#\/definitions\/PostingAccounts"}}},"401":{"description":"The resource owner or authorization server denied the request. - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter."}}}},"\/rest\/accounting\/locations\/posting_accounts\/{id}":{"delete":{"summary":"Delete a posting account","description":"Delete a posting account specified by the id.","tags":["Accounting"],"security":[{"oAuth2":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"The resource owner or authorization server denied the request. - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter."}},"parameters":[{"name":"id","type":"integer","required":true,"description":"The ID of the posting account","format":"integer","in":"path"}]},"get":{"summary":"Get posting account","description":"Gets posting account by the unique id","tags":["Accounting"],"security":[{"oAuth2":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#\/definitions\/PostingAccounts"}},"401":{"description":"The resource owner or authorization server denied the request. - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter."}},"parameters":[{"name":"id","type":"integer","required":true,"description":"","format":"integer","in":"path"}]}},"\/rest\/accounting\/locations\/revenue_account_configurations":{"get":{"summary":"List revenue account configurations","description":"Lists revenue account configurations of a system. The revenue accounts are returned as paginated result. By default 50 revenue accounts are on one page.","tags":["Accounting"],"security":[{"oAuth2":[]}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"page":{"type":"integer","description":"Current page of the response"},"totalsCount":{"type":"integer","description":"The total number of entries in the response"},"isLastPage":{"type":"boolean","description":"Flag that indicates if the page shown is the last page of the response"},"lastPageNumber":{"type":"integer","description":"The last page number"},"firstOnPage":{"type":"integer","description":"The index of the first item of the current page result"},"lastOnPage":{"type":"integer","description":"The index of the last item of the current page result"},"itemsPerPage":{"type":"integer","description":"The requested amount of items per result page"},"entries":{"type":"array","description":"List of RevenueAccountLocationConfiguration","items":{"$ref":"#\/definitions\/RevenueAccountLocationConfiguration"}}}},"examples":{"application\/json":{"page":1,"totalsCount":2,"isLastPage":true,"entries":[{"id":1863019,"locationId":1,"accountEu":"8592","accountExport":"6481"},{"id":39803603,"locationId":1,"accountEu":"5546","accountExport":"9285"}],"lastPageNumber":1,"firstOnPage":1,"lastOnPage":2,"itemsPerPage":25}}},"401":{"description":"The resource owner or authorization server denied the request. - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter."}},"parameters":[{"name":"page","type":"integer","required":false,"description":"The page to get. The default page that will be returned is page 1.","format":"integer","in":"query"},{"name":"itemsPerPage","type":"integer","required":false,"description":"The number of revenue accounts to be displayed per page. The default number of orders per page is 50.","format":"integer","in":"query"}]}},"\/rest\/accounting\/locations\/{locationId}":{"delete":{"summary":"Delete an accounting location","description":"Deletes an accounting location. The ID of the accounting location must be specified. Standard accounting locations can not be deleted.","tags":["Accounting"],"security":[{"oAuth2":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"The resource owner or authorization server denied the request. - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter."}},"parameters":[{"name":"locationId","type":"integer","required":true,"description":"The ID of the accounting location","format":"integer","in":"path"}]},"get":{"summary":"Get an accounting location","description":"Gets an accounting location. The ID of the accounting location must be specified.","tags":["Accounting"],"security":[{"oAuth2":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#\/definitions\/AccountingLocation"},"examples":{"application\/json":{"name":"Canada","clientId":1936003,"countryId":312,"plentyId":19696}}},"401":{"description":"The resource owner or authorization server denied the request. - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter."}},"parameters":[{"name":"locationId","type":"integer","required":true,"description":"The ID of the accounting location","format":"integer","in":"path"}]},"put":{"summary":"Update an accounting location","description":"Updates an accounting location. The ID of the accounting location must be specified.","tags":["Accounting"],"security":[{"oAuth2":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#\/definitions\/AccountingLocation"},"examples":{"application\/json":{"name":"Finland","clientId":1381311,"countryId":318,"plentyId":19086}}},"401":{"description":"The resource owner or authorization server denied the request. - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter."}},"parameters":[{"name":"locationId","type":"integer","required":true,"description":"The ID of the accounting location","format":"integer","in":"path"},{"in":"body","name":"\/rest\/accounting\/locations\/{locationId}","schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the accounting location optional"}}}}]}},"\/rest\/accounting\/locations\/{locationId}\/countries\/{countryId}\/revenue_accounts":{"get":{"summary":"Get the revenue account configuration of a country","description":"Get the revenue account configuration of a country. The ID of the accounting location that the country is associated with as well as the ID of the country must be specified.","tags":["Accounting"],"security":[{"oAuth2":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#\/definitions\/RevenueAccountCountryConfiguration"},"examples":{"application\/json":{"countryId":241,"revenueAccountLocationId":363,"revenueAccounts":[{"id":0,"account":95537},{"id":1,"account":17788},{"id":2,"account":93500},{"id":3,"account":50931},{"id":4,"account":31364},{"id":5,"account":16719}]}}},"401":{"description":"The resource owner or authorization server denied the request. - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter."}},"parameters":[{"name":"locationId","type":"integer","required":true,"description":"The ID of the accounting location.","format":"integer","in":"path"},{"name":"countryId","type":"integer","required":true,"description":"The ID of the country.","format":"integer","in":"path"}]}},"\/rest\/accounting\/locations\/{locationId}\/debtor_account_configurations":{"get":{"summary":"Get debtor account configuration of an accounting location","description":"Gets the debtor account configuration of an accounting location. The ID of the accounting location has to be specified. The debtor account configuration can contain one standard debtor account only or e.g. several accounts for each country of delivery.","tags":["Accounting"],"security":[{"oAuth2":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#\/definitions\/DebtorAccountConfiguration"},"examples":{"application\/json":{"id":47372,"locationId":1,"mode":"country_payment","sequence":"FNV","standard":"2632","save":false}}},"401":{"description":"The resource owner or authorization server denied the request. - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter."}},"parameters":[{"name":"locationId","type":"integer","required":true,"description":"The ID of the accounting location.","format":"integer","in":"path"}]},"put":{"summary":"Update debtor account configuration of an accounting location","description":"Updates the debtor account configuration of an accounting location. The ID of the accounting location has to be specified.","tags":["Accounting"],"security":[{"oAuth2":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#\/definitions\/DebtorAccountConfiguration"},"examples":{"application\/json":{"id":52062849,"locationId":1,"mode":"payment","sequence":"NVF","standard":"6889","save":false}}},"401":{"description":"The resource owner or authorization server denied the request. - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter."}},"parameters":[{"name":"locationId","type":"integer","required":true,"description":"The ID of the accounting location.","format":"integer","in":"path"},{"in":"body","name":"\/rest\/accounting\/locations\/{locationId}\/debtor_account_configurations","schema":{"type":"object","properties":{"mode":{"type":"string","description":"The mode describes the criteria based on which pending amounts are assigned to a debtor account. The following modes are available:\n\ncharacter = The debtor accounts are selected based on the first character of customer information. The information and the order of the information that will be used are defined with the sequence. There are 3 different sequences available.\npayment = The debtor accounts are selected based on the payment method.\ncountry = The debtor accounts are selected based on the country of delivery.\ncountry_payment = The debtor accounts are selected based on two criteria. The first criteria is the country and if the country is same as the country of the accounting location then the payment method is used to select the deptor account.\n allowed values are character, payment, country, country_payment"},"sequence":{"type":"string","description":"The sequence defines the order in which customer information will be used for the debtor account assignment if the character made has been chosen. The following sequences are available:\n\nFNV = stands for the sequence: company, lastname, firstname\nNVF = stands for the sequence: lastname, firstname, company\nNFV = stands for the sequence: lastname, company, firstname\n allowed values are FNV, NVF, NFV"},"standard":{"type":"string","description":"The standard debtor account that will be used if no matching debtor account can be found."},"save":{"type":"boolean","description":"Flag that indicates if the debtor account shall be saved within the contact data."},"accounts":{"type":"array","items":{}}}}}]}},"\/rest\/accounting\/locations\/{locationId}\/debtor_accounts\/{mode}":{"get":{"summary":"Lists the debtor accounts by mode.","description":"Lists the debtor accounts of an accounting location by mode. The ID of the accounting location and the mode have to be specified.","tags":["Accounting"],"security":[{"oAuth2":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#\/definitions\/Collection"}},"401":{"description":"The resource owner or authorization server denied the request. - The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter."}},"parameters":[{"name":"locationId","type":"integer","required":true,"description":"The ID of the accounting location.","format":"integer","in":"path"},{"name":"mode","type":"string","required":true,"description":"The mode defines how pending amounts are assigned to debtor accounts. The following modes are available:\n