> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paytsoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Triggers

> Several actions within Payt can trigger multiple webhook events.

Note that all events for which the conditions apply will be sent. And since the events are sent asynchronously it is, for example, possible to receive `invoice_closed` before `invoice_created` for the same invoice. Webhooks may be delivered more than once, so make sure their processing is idempotent. Every webhook event has a unique ID that can be used to track whether the event has already been received.

## Importing an invoice

* When the invoice is imported for the first time
  * `invoice_created`
* When the open amount is changed
  * `invoice_payment_created`
* When the open amount is changed to zero
  * `invoice_paid`
  * When the invoice was already sent to the debtor
    * `invoice_closed`
  * When the invoice is part of a debt collection case and the principal amount and costs of the debt collection case have been fully paid
    * `case_paid`
  * When the invoice is part of a debt collection case and the principal amount has been fully paid, but not yet all of the additional costs
    * `case_invoice_amount_paid`
* When the open amount is changed from zero
  * `invoice_reopened`
* When the open administration costs are changed
  * `invoice_payment_created`
* When the open interest costs are changed
  * `invoice_payment_created`
* When the open debt-collection costs are changed
  * `invoice_payment_created`
* When the sum of the open amounts of the debtor exceeds the credit-limit
  * `credit_limit_exceeded`

## Creating a debt collection case

* `case_created`
* For each invoice in the debt collection case that has open administration costs, these costs are credited
  * `invoice_payment_created`
* For each invoice in the debt collection case interest costs are added, if applicable
  * `invoice_payment_created`
* For the oldest invoice in the debt collection case debt collection costs are added
  * `invoice_payment_created`

## Registering a payment/remission of the costs on the debt collection case

Payments are always final and cannot be changed or deleted. When a payment is reverted by a user, a new payment is created that is the inverse of the original.

* For each invoice in the debt collection case that has open debt-collection costs
  * `invoice_payment_created`
* For each invoice in the debt collection case that has open interest costs
  * `invoice_payment_created`

## Registering a payment/remission for the administration costs on an invoice

Payments are always final and cannot be changed or deleted. When a payment is reverted by a user, a new payment is created that is the inverse of the original.

* `invoice_payment_created`

## Performing a step for an invoice

* `invoice_step_performed`
* When the invoice is marked for debt collection
  * `invoice_to_debt_collection`
* When administration costs are added to the invoice
  * `invoice_payment_created`

## Sending a bundled reminder

* `bundled_reminder_sent`
* When administration costs are added to the bundled reminder
  * administration costs are added to the oldest invoice that triggered the bundled reminder
    * `invoice_payment_created`
  * administration costs are removed from all other invoices included in the bundled reminder
    * `invoice_payment_created`
