> 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/shopware6_en_us/pdf-documents/shopware-plugin.md).

# Shopware Plugin Installation

Installation and configuration of the Shopware plugin for the PDF document module.

The **Solutioo Invoice Documents** plugin extends Shopware with the ability to receive PDF documents from Business Central and display them in the customer portal.

## 1. Installation

### 1.1 Via Composer (recommended)

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

### 1.2 Manual installation

1. Download the plugin.
2. Extract it to `custom/plugins/SolutiooInvoiceDocuments`
3. Run the following commands:

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

## 2. Plugin functions

### 2.1 API endpoints

The plugin provides the following API endpoints:

<table><thead><tr><th width="383.0965576171875">Endpoint</th><th width="105.9146728515625">Method</th><th width="257.5626220703125">Description</th></tr></thead><tbody><tr><td><code>/api/solutioo-invoice-document/import</code></td><td>POST</td><td>Imports a new document</td></tr><tr><td><code>/api/solutioo-invoice-document/by-reference/{ref}</code></td><td>GET</td><td>Checks whether a document exists</td></tr><tr><td><code>/api/solutioo-invoice-document/update/{id}</code></td><td>PATCH</td><td>Updates a document</td></tr><tr><td><code>/api/solutioo-invoice-document/delete/{id}</code></td><td>DELETE</td><td>Deletes a document</td></tr><tr><td><code>/api/solutioo-invoice-document/bulk</code></td><td>POST</td><td>Bulk import of documents</td></tr></tbody></table>

### 2.2 Customer portal

After the installation, a new menu item *"Documents"* appears in the customer area:

## 3. Customer mapping

The plugin supports several methods for mapping customers:

### Mapping priority

<table data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Customer ID</strong></td><td>Direct Shopware customer ID (highest priority)</td></tr><tr><td><strong>Email address</strong></td><td>Search by customer email</td></tr><tr><td><strong>Customer number</strong></td><td>Search by customer number</td></tr></tbody></table>

{% hint style="info" %}
Mapping by email is particularly useful when the customer numbers do not match between the systems.
{% endhint %}

## 4. API authentication

The API uses the standard Shopware Admin API authentication:

{% columns %}
{% column %}

### Integration (recommended)

1. Create an **integration** in Shopware under **Settings** <i class="fa-right">:right:</i> **System** <i class="fa-right">:right:</i> **Integrations**
2. Make a note of the **Access Key ID** and **Secret Access Key**
3. Enter these in Business Central
   {% endcolumn %}

{% column %}

### User authentication

Alternatively, an admin user can be used:

1. Create an admin user in Shopware
2. Use the user name and password in Business Central
   {% endcolumn %}
   {% endcolumns %}

## 5. Document types

The plugin supports the following document types:

<table><thead><tr><th width="139.1199951171875">API value</th><th width="203.2235107421875">German label</th><th width="202.5538330078125">English label</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. Database structure

The plugin creates a new table `solutioo_invoice_document`:

<table><thead><tr><th width="184.8917236328125">Field</th><th width="127.28955078125">Type</th><th width="265.6485595703125">Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>binary(16)</td><td>Primary key (UUID)</td></tr><tr><td><code>customer_id</code></td><td>binary(16)</td><td>Associated customer</td></tr><tr><td><code>invoice_number</code></td><td>varchar(255)</td><td>Document number</td></tr><tr><td><code>invoice_date</code></td><td>date</td><td>Document date</td></tr><tr><td><code>document_type</code></td><td>varchar(50)</td><td>Document type</td></tr><tr><td><code>external_reference</code></td><td>varchar(255)</td><td>External reference (BC number)</td></tr><tr><td><code>media_id</code></td><td>binary(16)</td><td>Linked media file</td></tr><tr><td><code>original_filename</code></td><td>varchar(255)</td><td>Original file name</td></tr></tbody></table>

## 7. Updates

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

{% hint style="warning" %}
Always create a backup of your database before updates!
{% 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
