# Payment and delivery

> konto keeps the SEPA direct debit mandate and how bills reach the holder: the customer grants a mandate and chooses e-mail in the portal, a clerk records a paper mandate, every change is logged.

One account, one mandate. konto issues and keeps the SEPA direct debit mandate itself, with
the text the customer agreed to, and ends it when the customer changes their IBAN or pays by
transfer. Every bill takes the mandate current when it is sealed, and says on it when and
from which account it will be debited. The account's holder chooses the same way between
bills by e-mail and by post.

## Who may change it

| Caller | May |
|---|---|
| the account's holder, [signed in](sign-in.md) | read, grant or end the mandate, choose e-mail or post |
| a clerk | the same, and record a paper mandate with its signing date; sees the whole IBAN and every change |
| a delegate, a `portal` token | nothing here: `role_forbidden` |

A customer's change needs a sign-in within the last 15 minutes; an older session gets
`403 reauth_required`. The [Kundenportal](portal.md) then asks for the passkey and
saves; a customer signed in with the
[operator's login](sign-in.md#sign-in-with-your-customer-login) signs in there again
before the form opens. Someone at an unattended or stolen
session cannot point the debits at another account without the customer's fingerprint,
face, PIN or login.

## Read the settings

`GET /v1/accounts/{account}/settings`:

```json
{
  "account": "VK-1000123",
  "holder": "Erika Mustermann",
  "payment": { "method": "direct_debit", "mandate": "VK-1000123-01", "iban": "DE89 … 3000",
               "account_holder": "Erika Mustermann", "signed": "2027-03-01", "signed_de": "01.03.2027",
               "channel": "online" },
  "delivery": { "channel": "email", "address": "erika@example.de", "consent": "2027-03-01", "consent_de": "01.03.2027" },
  "creditor": { "name": "Stadtwerke Musterstadt GmbH", "creditor_id": "DE98ZZZ09999999999" },
  "direct_debit_offered": true,
  "next_mandate": "VK-1000123-02",
  "mandate_text": "SEPA-Lastschriftmandat\nZahlungsempfänger: …"
}
```

A customer sees the IBAN masked; a clerk sees it whole and also `changes`, newest first,
each with time, actor, kind (`holder`, `payment`, `delivery`) and what was set.

## Grant a mandate

```json
PUT /v1/accounts/VK-1000123/payment
{ "method": "direct_debit", "iban": "DE89 3704 0044 0532 0130 00", "account_holder": "Erika Mustermann", "agree": true }
```

- The IBAN is normalised (spaces, case) and must be a valid IBAN of a SEPA country.
- A customer must agree (`"agree": true`) to `mandate_text`, which names the creditor, its
  Gläubiger-ID and the reference the mandate will get. That exact text is stored with the
  mandate.
- A clerk records a paper mandate instead with `"signed": "2026-11-02"`, the day it was
  signed; it cannot lie in the future.
- konto issues the reference `{account}-{nn}`, counting the account's mandates, and ends
  the current one. The same IBAN and name again change nothing.
- Without a Gläubiger-ID in `KONTO_CREDITORS`, direct debit is not offered:
  `direct_debit_unavailable`.

`{ "method": "transfer" }` ends the mandate; the next bill asks for a transfer with the
seller's IBAN and a GiroCode. An ended mandate is kept, with who ended it and when.

The mandate text is the credit industry's standard SEPA-Basislastschrift wording. The
eight-week refund it mentions is the payer's right [BGB § 675x Abs. 2, 4].

## What a mandate given online means

A payment binds the payer only when they authorised it [BGB § 675j Abs. 1 Satz 1]. A
mandate given in the portal carries no handwritten signature: konto records that the
holder, signed in within 15 minutes with a passkey and user verification or with the
operator's login, agreed to the stored text on that day. A debtor can still dispute a
debit as unauthorised within 13 months [BGB § 676b Abs. 2 Satz 1]; the creditor carries that risk, as with every online mandate.
The change log and the stored text are what you show in such a dispute.

## Choose e-mail or post

```json
PUT /v1/accounts/VK-1000123/delivery
{ "channel": "email", "address": "erika@example.de", "consent": true }
```

Sending an invoice electronically needs the recipient's consent
[UStG § 14 Abs. 1 Satz 5]; konto records today as the consent date. `{ "channel": "post" }`
goes back to paper. The address is not verified by a message: a bill that cannot be
delivered is reported `failed` by the courier and sent again by post
([Deliver bills](delivery.md)).

## The bill

A bill is assembled with the mandate current at sealing. Its payment block then reads
„Wir ziehen den Betrag frühestens am 17.02.2027 per SEPA-Lastschrift von Ihrem Konto mit der
IBAN-Endung 3000 ein (Mandat VK-1000123-01, Gläubiger-ID …)“, which is the
pre-notification a SEPA debit needs. The XRechnung carries payment means 59 with mandate
reference, creditor identifier and debited account. A sealed bill keeps its mandate,
whatever changes later.

konto does not write SEPA collection files (pain.008): your payment system collects on the
bill's due date with the mandate the bill names.
