# Give a SEPA direct debit mandate

> Invoices paid by direct debit from a bank account - registered by manitu's staff.

- Effect: Write - Changes the account. Agents ask first.
- Idempotent: no
- Stability: beta
- MCP tool: `manitu_account_payment_set` on https://mcp.manitu.de/mcp
- REST: `POST https://api.manitu.de/v1/account/payment/set`
- Needs: `account`
- Page: /reference/account/payment/set/

**Changes the account. Agents say what will happen and wait for an explicit yes before calling it.**

## MCP tool

`manitu_account_payment_set`

### Description for the model

Gives manitu a SEPA direct debit mandate for the manitu customer account this connection works in, so that its invoices are paid by direct debit from the bank account given. It is not changed at once: manitu's staff register the mandate, and the customer gets a mail when it is done - until then manitu_account_payment_get shows the old way of paying. Only when the customer asks for exactly this and is the holder of the bank account or may give the mandate for it; repeat holder and IBAN and ask for an explicit yes first. Do not repeat the full IBAN later in the conversation. Refused if this access may not change the account's base data.

### Arguments

- `payment_type` (string, required) - How invoices are to be paid - direct debit is the one that can be asked for. (one of `"sepa_directdebit"`)
- `sepa` (object, required)
  - `sepa.account_owner` (string, required) - The holder of the bank account, as the bank has it. (minLength `3`; maxLength `255`)
  - `sepa.iban` (string, required, write-only) - The IBAN, with or without blanks - never logged in full. (minLength `15`; maxLength `50`)
  - `sepa.bic` (string | null) - The BIC - may be left out for an IBAN of a country where it is optional (Germany and most of the EU); refused (required) where it is not. (maxLength `16`)

### Example

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "manitu_account_payment_set",
    "arguments": {
      "payment_type": "sepa_directdebit",
      "sepa": {
        "account_owner": "string",
        "iban": "stringxxxxxxxxx"
      }
    }
  }
}
```

## REST

`POST https://api.manitu.de/v1/account/payment/set`

### Authentication

One of `X-API-Key`, `Authorization: Bearer …` - never more than one in a request.

### Request body

JSON; unknown fields are refused.

- `payment_type` (string, required) - How invoices are to be paid - direct debit is the one that can be asked for. (one of `"sepa_directdebit"`)
- `sepa` (object, required)
  - `sepa.account_owner` (string, required) - The holder of the bank account, as the bank has it. (minLength `3`; maxLength `255`)
  - `sepa.iban` (string, required, write-only) - The IBAN, with or without blanks - never logged in full. (minLength `15`; maxLength `50`)
  - `sepa.bic` (string | null) - The BIC - may be left out for an IBAN of a country where it is optional (Germany and most of the EU); refused (required) where it is not. (maxLength `16`)

### Response

In `data`; the rest of the body as on every call.

- `handled` (string, required) - manual: manitu's staff register it - it takes a while. (one of `"manual"`)
- `payment_type` (string, required) - (one of `"sepa_directdebit"`)
- `iban_masked` (string | null, required) - The IBAN asked for, masked as manitu_account_payment_get shows it.

### Statuses

- `200` Success.
- `400` The request does not match the declared input schema.
- `401` No credential was presented, or it was not recognised.
- `403` The credential is not permitted to use this operation.
- `500` The server failed. Nothing about the request was wrong. Whether a change took effect is not known - check before trying it again.
- `503` The channel this operation forwards through is unavailable.

### Example

```sh
curl -X POST 'https://api.manitu.de/v1/account/payment/set' \
  -H 'X-API-Key: $API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"payment_type":"sepa_directdebit","sepa":{"account_owner":"string","iban":"stringxxxxxxxxx"}}'
```

## Example result

```json
{
  "handled": "manual",
  "payment_type": "sepa_directdebit",
  "iban_masked": "string"
}
```
