> For the complete documentation index, see [llms.txt](https://docs.solutioo.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.solutioo.de/shopware/pdf-dokumente/shopware-plugin.md).

# Shopware Plugin Installation

Das **Solutioo Invoice Documents** Plugin erweitert Shopware um die Fähigkeit, PDF-Dokumente aus Business Central zu empfangen und im Kundenportal anzuzeigen.

## 1. Installation

### 1.1 Via Composer (empfohlen)

```bash
composer require solutioo/invoice-documents
bin/console plugin:refresh
bin/console plugin:install --activate SolutiooInvoiceDocuments
bin/console cache:clear
```

### 1.2 Manuelle Installation

1. Laden Sie das Plugin herunter.
2. Entpacken Sie es nach `custom/plugins/SolutiooInvoiceDocuments`
3. Führen Sie folgende Befehle aus:

```bash
bin/console plugin:refresh
bin/console plugin:install --activate SolutiooInvoiceDocuments
bin/console cache:clear
bin/console theme:compile
```

## 2. Plugin-Funktionen

### 2.1 API-Endpunkte

Das Plugin stellt folgende API-Endpunkte bereit:

<table><thead><tr><th width="383.0965576171875">Endpunkt</th><th width="105.9146728515625">Methode</th><th width="257.5626220703125">Beschreibung</th></tr></thead><tbody><tr><td><code>/api/solutioo-invoice-document/import</code></td><td>POST</td><td>Importiert ein neues Dokument</td></tr><tr><td><code>/api/solutioo-invoice-document/by-reference/{ref}</code></td><td>GET</td><td>Prüft ob Dokument existiert</td></tr><tr><td><code>/api/solutioo-invoice-document/update/{id}</code></td><td>PATCH</td><td>Aktualisiert ein Dokument</td></tr><tr><td><code>/api/solutioo-invoice-document/delete/{id}</code></td><td>DELETE</td><td>Löscht ein Dokument</td></tr><tr><td><code>/api/solutioo-invoice-document/bulk</code></td><td>POST</td><td>Massenimport von Dokumenten</td></tr></tbody></table>

### 2.2  Kundenportal

Nach der Installation erscheint im Kundenbereich ein neuer Menüpunkt *"Dokumente"*:

## 3. Kundenzuordnung

Das Plugin unterstützt verschiedene Methoden zur Kundenzuordnung:

### Priorität der Zuordnung

<table data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Kunden-ID</strong></td><td>Direkte Shopware-Kunden-ID (höchste Priorität)</td></tr><tr><td><strong>E-Mail-Adresse</strong></td><td>Suche nach Kunden-E-Mail</td></tr><tr><td><strong>Kundennummer</strong></td><td>Suche nach Kundennummer</td></tr></tbody></table>

{% hint style="info" %}
Die E-Mail-Zuordnung ist besonders nützlich, wenn die Kundennummern zwischen den Systemen nicht übereinstimmen.
{% endhint %}

## 4. API-Authentifizierung

Die API verwendet die Standard-Shopware Admin-API-Authentifizierung:

{% columns %}
{% column %}

### Integration (empfohlen)

1. Erstellen Sie eine **Integration** in Shopware unter **Einstellungen** <i class="fa-right">:right:</i> **System** <i class="fa-right">:right:</i> **Integrationen**
2. Notieren Sie **Access Key ID** und **Secret Access Key**
3. Tragen Sie diese in Business Central ein
   {% endcolumn %}

{% column %}

### Benutzerauthentifizierung

Alternativ kann ein Admin-Benutzer verwendet werden:

1. Erstellen Sie einen Admin-Benutzer in Shopware
2. Nutzen Sie Benutzername und Passwort in Business Central
   {% endcolumn %}
   {% endcolumns %}

## 5. Dokumenttypen

Das Plugin unterstützt folgende Dokumenttypen:

<table><thead><tr><th width="139.1199951171875">API-Wert</th><th width="203.2235107421875">Deutsche Bezeichnung</th><th width="202.5538330078125">Englische Bezeichnung</th></tr></thead><tbody><tr><td><code>invoice</code></td><td>Rechnung</td><td>Invoice</td></tr><tr><td><code>credit_note</code></td><td>Gutschrift</td><td>Credit Note</td></tr><tr><td><code>delivery_note</code></td><td>Lieferschein</td><td>Delivery Note</td></tr><tr><td><code>cancellation</code></td><td>Storno</td><td>Cancellation</td></tr><tr><td><code>other</code></td><td>Sonstiges</td><td>Other</td></tr></tbody></table>

## 6. Datenbankstruktur

Das Plugin erstellt eine neue Tabelle `solutioo_invoice_document`:

<table><thead><tr><th width="184.8917236328125">Feld</th><th width="127.28955078125">Typ</th><th width="265.6485595703125">Beschreibung</th></tr></thead><tbody><tr><td><code>id</code></td><td>binary(16)</td><td>Primärschlüssel (UUID)</td></tr><tr><td><code>customer_id</code></td><td>binary(16)</td><td>Zugehöriger Kunde</td></tr><tr><td><code>invoice_number</code></td><td>varchar(255)</td><td>Dokumentennummer</td></tr><tr><td><code>invoice_date</code></td><td>date</td><td>Dokumentdatum</td></tr><tr><td><code>document_type</code></td><td>varchar(50)</td><td>Dokumenttyp</td></tr><tr><td><code>external_reference</code></td><td>varchar(255)</td><td>Externe Referenz (BC-Nummer)</td></tr><tr><td><code>media_id</code></td><td>binary(16)</td><td>Verknüpfte Mediendatei</td></tr><tr><td><code>original_filename</code></td><td>varchar(255)</td><td>Originaler Dateiname</td></tr></tbody></table>

## 7.  Updates

```bash
# Plugin aktualisieren
composer update solutioo/invoice-documents
bin/console plugin:update SolutiooInvoiceDocuments
bin/console cache:clear
bin/console theme:compile
```

{% hint style="warning" %}
Erstellen Sie vor Updates immer ein Backup Ihrer Datenbank!
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.solutioo.de/shopware/pdf-dokumente/shopware-plugin.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
