> 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/vr-pay-integration/anwendung/webhooks-und-zahlungsabgleich.md).

# Webhooks und Zahlungsabgleich

## 1. Funktionsweise

Das Webhook-System arbeitet **polling-basiert**:

1. VR Pay sendet Zahlungsbenachrichtigungen an den **Lizenzserver.**
2. Der Lizenzserver speichert die Webhooks.
3. Business Central ruft die Webhooks regelmäßig ab.
4. Die Transaktionen werden aktualisiert.

```
VR Pay → Lizenzserver → Business Central
         (Webhook)      (Polling alle 5 Min)
```

## 2. Automatischer Webhook-Abruf

#### 2.1 Einrichten

1. Öffnen Sie *"VRPay Setup" / "VR Pay Einrichtung".*
2. Klicken Sie auf *"Aktionen"* <i class="fa-right">:right:</i> "*Automatischen Webhook-Abruf einrichten".*
3. Ein Job Queue Entry wird erstellt (alle 5 Minuten).

<div align="left" data-with-frame="true"><figure><img src="/files/5UQIsbQrD5fNQIQ5zkna" alt="" width="563"><figcaption></figcaption></figure></div>

#### 2.2 Prüfen ob aktiv

1. Suchen Sie nach *"Aufgabenwarteschlangenposten".*
2. Suchen Sie nach *"VR Pay Webhook-Abruf".*
3. Status sollte *"Bereit"* oder *"In Bearbeitung"* sein.

<div align="left" data-with-frame="true"><figure><img src="/files/d81CAg0NZXyjiHW1C4CX" alt="" width="563"><figcaption></figcaption></figure></div>

#### 2.3 Manueller Abruf

Im "*VR Pay Setup" / "VR Pay Einrichtung"* klicken Sie auf *"Aktionen"* in der Aktionsleiste und anschließend auf *"Webhooks abrufen".* So können Sie nun auch den Abruf der Webhooks manuell vornehmen.

<div align="left" data-with-frame="true"><figure><img src="/files/O3qCM6nNzEfNsXQ0KaNH" alt="" width="563"><figcaption></figcaption></figure></div>

## 3. Webhook-Verarbeitung

Wenn ein Webhook empfangen wird:

1. **Transaktion suchen**: Anhand der Transaction ID
2. **Status aktualisieren**: Auf "Bezahlt" setzen
3. **Betrag speichern**: Aus dem Webhook extrahiert
4. **Webhook bestätigen**: ACK an Lizenzserver senden
5. **Zähler erhöhen**: Webhook-Nutzung +1

## 4. VR Pay Webhook-Struktur

VR Pay sendet Webhooks im folgenden Format:

```json
{
  "transaction": {
    "uuid": "f9b158ac",
    "amount": 23050,
    "status": "confirmed",
    "invoice": {
      "number": "103215",
      "currency": "EUR"
    }
  }
}
```

#### Extrahierte Felder

| Webhook-Feld                 | BC-Feld                   | Beschreibung                             |
| ---------------------------- | ------------------------- | ---------------------------------------- |
| `transaction.uuid`           | Transaction ID            | Eindeutige Transaktions-ID               |
| `transaction.invoice.number` | Reference ID / Source No. | Rechnungsnummer                          |
| `transaction.amount`         | Amount                    | Betrag in Cents (wird durch 100 geteilt) |
| `transaction.status`         | Status                    | "confirmed" → Bezahlt                    |

## 5. Transaktionsübersicht

**Wo finden Sie alle VR Pay Transaktionen?**

* In der Aktionsleiste vin Business Central unter *"VR Pay Transaktionen"*.

<div align="left" data-with-frame="true"><figure><img src="/files/5nvfviqJkZrHAy5OMqzA" alt="" width="563"><figcaption></figcaption></figure></div>

* Oder im VRPay Setup <i class="fa-right">:right:</i> *"Navigieren"* <i class="fa-right">:right:</i> *"Transaktionen"*

<div align="left" data-with-frame="true"><figure><img src="/files/eL5l4UlLc1dQLChM9cuz" alt="" width="563"><figcaption></figcaption></figure></div>

#### Transaktionsstatus

<table><thead><tr><th width="195.7584228515625">Status</th><th width="293.905517578125">Bedeutung</th></tr></thead><tbody><tr><td><strong>Ausstehend</strong></td><td>Warte auf Zahlung</td></tr><tr><td><strong>Reserviert</strong></td><td>Betrag reserviert</td></tr><tr><td><strong>Autorisiert</strong></td><td>Zahlung autorisiert</td></tr><tr><td><strong>Bezahlt</strong></td><td>Zahlung erfolgreich abgeschlossen</td></tr><tr><td><strong>Erstattet</strong></td><td>Vollständig zurückerstattet</td></tr><tr><td><strong>Teilweise erstattet</strong></td><td>Teilweise zurückerstattet</td></tr><tr><td><strong>Storniert</strong></td><td>Abgebrochen</td></tr><tr><td><strong>Fehlgeschlagen</strong></td><td>Fehler bei Zahlung</td></tr><tr><td><strong>Abgelaufen</strong></td><td>Zahlungslink abgelaufen</td></tr></tbody></table>

## 6. Zahlung verbuchen

Nachdem eine Zahlung als *"Bezahlt"* markiert wurde:

1. Öffnen Sie *"Verkauf"* <i class="fa-right">:right:</i> *"Gebuchte Verkaufsrechnung"*
2. Klicken Sie auf *"Zugehörig"* <i class="fa-right">:right:</i> *"VR Pay"* <i class="fa-right">:right:</i> *"Zahlung erfassen"*
3. Die Zahlung wird verbucht und mit der Rechnung ausgeglichen.

<div align="left" data-with-frame="true"><figure><img src="/files/v2W4VWycKQgb0lkxzrWk" alt="" width="563"><figcaption></figcaption></figure></div>


---

# 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/vr-pay-integration/anwendung/webhooks-und-zahlungsabgleich.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.
