**API versions** · **V2 (Latest)** · [V1](/integrations/v1/docs?lang=en)

# SEPA mandates

OpenAPI 3.0.3 · API 2.0.0

```json
[
  {
    "url": "https://api.unisoft.world/integrations/v2",
    "description": "API"
  }
]
```

## Operations

## GET /sepa/mandates

List private-safe SEPA mandate statuses

`list_sepa_mandates`

Requires explicit sepa:read and abonnements:read; restricted campaign keys are refused. Current organisation, association, entitlement and linked subscription are re-admitted with scalar ownership. Reads use local persisted data and the actual mandate lifecycle owner only; no runtime/index initialisation, provider, daemon, notification or business mutation. Amounts are EUR MINOR units (5000 = EUR 50); unknown money, dates and statuses stay null/UNKNOWN. USABLE means the native ACTIVE/36-month-use rule, not bank acceptance or settlement. No IBAN, bank account, RUM, payer/donor identity, signature, document, settings, token, reusable credential or raw error is returned. Non-empty GET bodies and unknown arguments are refused. Shared authentication may record API key usage.

### Authentication

```json
[
  {
    "bearerAuth": []
  },
  {
    "apiKeyHeader": []
  }
]
```

### Required permissions

```json
{
  "accepted": "sepa:read",
  "additional": [
    "abonnements:read"
  ]
}
```

### Parameters

```json
{
  "name": "assoc",
  "in": "query",
  "required": true,
  "description": "Current association MAIN or UUID.",
  "schema": {
    "type": "string",
    "minLength": 1,
    "maxLength": 128
  }
}
```

```json
{
  "name": "limit",
  "in": "query",
  "schema": {
    "type": "integer",
    "minimum": 1,
    "maximum": 200
  }
}
```

```json
{
  "name": "after",
  "in": "query",
  "schema": {
    "type": "string",
    "minLength": 1,
    "maxLength": 128
  }
}
```

### Responses

#### HTTP 200

```json
{
  "description": "Qualified mandate metadata or proven native command receipt.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateList"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "Invalid identifier, command, revision, reason, pagination or unknown query/body fields.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 401

```json
{
  "description": "Missing or invalid authentication.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 403

```json
{
  "description": "Missing explicit scope, restricted campaign key, disabled organisation or unavailable API actor.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "Resource absent from the current organisation and association.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "Ambiguous ownership/history, changed schedule or mandate, locked collection, lifecycle fence, reused command or uncertain native proof. Preserve the original command ID; no automatic retry.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 500

```json
{
  "description": "Internal error without private bank data or raw diagnostics.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 503

```json
{
  "description": "Native SEPA indexes or encryption prerequisites are unavailable; this request performs no migration.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

### OpenAPI

```json
{
  "x-unisoft-mcp-output-schema": true,
  "x-unisoft-scope": "sepa:read",
  "x-unisoft-additional-scopes": [
    "abonnements:read"
  ],
  "x-unisoft-mcp": {
    "category": "read",
    "readOnly": true,
    "destructive": false,
    "idempotent": true,
    "warn": false
  }
}
```

## GET /sepa/mandates/{id}

Read one SEPA mandate status

`get_sepa_mandate`

Requires explicit sepa:read and abonnements:read; restricted campaign keys are refused. Current organisation, association, entitlement and linked subscription are re-admitted with scalar ownership. Reads use local persisted data and the actual mandate lifecycle owner only; no runtime/index initialisation, provider, daemon, notification or business mutation. Amounts are EUR MINOR units (5000 = EUR 50); unknown money, dates and statuses stay null/UNKNOWN. USABLE means the native ACTIVE/36-month-use rule, not bank acceptance or settlement. No IBAN, bank account, RUM, payer/donor identity, signature, document, settings, token, reusable credential or raw error is returned. Non-empty GET bodies and unknown arguments are refused. Shared authentication may record API key usage.

### Authentication

```json
[
  {
    "bearerAuth": []
  },
  {
    "apiKeyHeader": []
  }
]
```

### Required permissions

```json
{
  "accepted": "sepa:read",
  "additional": [
    "abonnements:read"
  ]
}
```

### Parameters

```json
{
  "name": "id",
  "in": "path",
  "required": true,
  "schema": {
    "type": "string",
    "minLength": 1,
    "maxLength": 128
  }
}
```

```json
{
  "name": "assoc",
  "in": "query",
  "required": true,
  "description": "Current association MAIN or UUID.",
  "schema": {
    "type": "string",
    "minLength": 1,
    "maxLength": 128
  }
}
```

### Responses

#### HTTP 200

```json
{
  "description": "Qualified mandate metadata or proven native command receipt.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateResponse"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "Invalid identifier, command, revision, reason, pagination or unknown query/body fields.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 401

```json
{
  "description": "Missing or invalid authentication.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 403

```json
{
  "description": "Missing explicit scope, restricted campaign key, disabled organisation or unavailable API actor.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "Resource absent from the current organisation and association.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "Ambiguous ownership/history, changed schedule or mandate, locked collection, lifecycle fence, reused command or uncertain native proof. Preserve the original command ID; no automatic retry.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 500

```json
{
  "description": "Internal error without private bank data or raw diagnostics.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 503

```json
{
  "description": "Native SEPA indexes or encryption prerequisites are unavailable; this request performs no migration.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

### OpenAPI

```json
{
  "x-unisoft-mcp-output-schema": true,
  "x-unisoft-scope": "sepa:read",
  "x-unisoft-additional-scopes": [
    "abonnements:read"
  ],
  "x-unisoft-mcp": {
    "category": "read",
    "readOnly": true,
    "destructive": false,
    "idempotent": true,
    "warn": false
  }
}
```

## GET /sepa/subscriptions/{id}/replacement-mandates

Find already signed native replacement mandates

`list_sepa_replacement_mandates`

Requires explicit sepa:read and abonnements:read; restricted campaign keys are refused. Current organisation, association, entitlement and linked subscription are re-admitted with scalar ownership. Reads use local persisted data and the actual mandate lifecycle owner only; no runtime/index initialisation, provider, daemon, notification or business mutation. Amounts are EUR MINOR units (5000 = EUR 50); unknown money, dates and statuses stay null/UNKNOWN. USABLE means the native ACTIVE/36-month-use rule, not bank acceptance or settlement. No IBAN, bank account, RUM, payer/donor identity, signature, document, settings, token, reusable credential or raw error is returned. Non-empty GET bodies and unknown arguments are refused. Shared authentication may record API key usage. Also requires paiements:read. Only already signed native mandates with matching amount, currency, duration, donor and label are candidates; the origin must be ACTIVE and have zero payments. Candidates are not a request to sign again. Secure renewal-request creation is UNAVAILABLE/SECURE_RENEWAL_OWNER_REQUIRED: the existing registration owner requires a real ADMIN source, while public checkout creates another active contract and may launch it. The integration never fabricates ADMIN or misrepresents a second checkout as renewal. Use the existing authorised signature/registration workflow before selecting a signed candidate.

### Authentication

```json
[
  {
    "bearerAuth": []
  },
  {
    "apiKeyHeader": []
  }
]
```

### Required permissions

```json
{
  "accepted": "sepa:read",
  "additional": [
    "abonnements:read",
    "paiements:read"
  ]
}
```

### Parameters

```json
{
  "name": "id",
  "in": "path",
  "required": true,
  "description": "Current SEPA_XML subscription UUID.",
  "schema": {
    "type": "string",
    "format": "uuid"
  }
}
```

### Responses

#### HTTP 200

```json
{
  "description": "Qualified mandate metadata or proven native command receipt.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateCandidates"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "Invalid identifier, command, revision, reason, pagination or unknown query/body fields.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 401

```json
{
  "description": "Missing or invalid authentication.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 403

```json
{
  "description": "Missing explicit scope, restricted campaign key, disabled organisation or unavailable API actor.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "Resource absent from the current organisation and association.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "Ambiguous ownership/history, changed schedule or mandate, locked collection, lifecycle fence, reused command or uncertain native proof. Preserve the original command ID; no automatic retry.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 500

```json
{
  "description": "Internal error without private bank data or raw diagnostics.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 503

```json
{
  "description": "Native SEPA indexes or encryption prerequisites are unavailable; this request performs no migration.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

### OpenAPI

```json
{
  "x-unisoft-mcp-output-schema": true,
  "x-unisoft-scope": "sepa:read",
  "x-unisoft-additional-scopes": [
    "abonnements:read",
    "paiements:read"
  ],
  "x-unisoft-mcp": {
    "category": "read",
    "readOnly": true,
    "destructive": false,
    "idempotent": true,
    "warn": false
  }
}
```

## POST /sepa/subscriptions/{id}/mandate-replacement

Apply one signed mandate replacement through the native owner

`replace_sepa_subscription_mandate`

Requires explicit sepa:read and abonnements:read; restricted campaign keys are refused. Current organisation, association, entitlement and linked subscription are re-admitted with scalar ownership. Reads use local persisted data and the actual mandate lifecycle owner only; no runtime/index initialisation, provider, daemon, notification or business mutation. Amounts are EUR MINOR units (5000 = EUR 50); unknown money, dates and statuses stay null/UNKNOWN. USABLE means the native ACTIVE/36-month-use rule, not bank acceptance or settlement. No IBAN, bank account, RUM, payer/donor identity, signature, document, settings, token, reusable credential or raw error is returned. Non-empty GET bodies and unknown arguments are refused. Shared authentication may record API key usage. Also requires paiements:read. Only already signed native mandates with matching amount, currency, duration, donor and label are candidates; the origin must be ACTIVE and have zero payments. Candidates are not a request to sign again. Secure renewal-request creation is UNAVAILABLE/SECURE_RENEWAL_OWNER_REQUIRED: the existing registration owner requires a real ADMIN source, while public checkout creates another active contract and may launch it. The integration never fabricates ADMIN or misrepresents a second checkout as renewal. Use the existing authorised signature/registration workflow before selecting a signed candidate. Also requires sepa:mandates:write and abonnements:write. Explicit commandId UUID, current expectedRevision and expectedMandateId are required. Canonical subscription repository locks are acquired on both admitted contracts; revision is rechecked under lock, and interrupted owner entry retains authority locks until reviewed. Delegates the real replaceMandate command, preserves history, supersedes the old mandate and marks the candidate origin REPLACED. Prepared/reserved/exported collections block replacement; it does not retry a debit or resume MANUAL/PAUSE. Actor APIKEY_<key id> stays visible; SYSTEM is only native audit classification, not a privilege grant. No ADMIN impersonation. Native unique indexes are inspected without migration. Shared lifecycle fences are durably acquired before owner entry and deleted only after acknowledged completion and terminal publication; uncertainty retains them without TTL or stealing. Claims require acknowledged:true and exact insertedId; all native/terminal writes force majority+j:true with positive driver acknowledgement. Identical replay reads matching native DONE proof, never executes again. Missing/failed/in-flight proof remains SEPA_COMMAND_UNCERTAIN; inspect the original command, never use a new ID automatically. No plaintext bank data enters the external journal.

### Authentication

```json
[
  {
    "bearerAuth": []
  },
  {
    "apiKeyHeader": []
  }
]
```

### Required permissions

```json
{
  "accepted": "sepa:mandates:write",
  "additional": [
    "sepa:read",
    "abonnements:read",
    "paiements:read",
    "abonnements:write"
  ]
}
```

### Parameters

```json
{
  "name": "id",
  "in": "path",
  "required": true,
  "description": "Current SEPA_XML subscription UUID.",
  "schema": {
    "type": "string",
    "format": "uuid"
  }
}
```

### Request body

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "commandId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedRevision": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "expectedMandateId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "newMandateId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        },
        "required": [
          "commandId",
          "expectedRevision",
          "expectedMandateId",
          "newMandateId",
          "reason"
        ],
        "additionalProperties": false
      }
    }
  }
}
```

### Responses

#### HTTP 200

```json
{
  "description": "Qualified mandate metadata or proven native command receipt.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateCommand"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "Invalid identifier, command, revision, reason, pagination or unknown query/body fields.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 401

```json
{
  "description": "Missing or invalid authentication.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 403

```json
{
  "description": "Missing explicit scope, restricted campaign key, disabled organisation or unavailable API actor.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "Resource absent from the current organisation and association.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "Ambiguous ownership/history, changed schedule or mandate, locked collection, lifecycle fence, reused command or uncertain native proof. Preserve the original command ID; no automatic retry.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 500

```json
{
  "description": "Internal error without private bank data or raw diagnostics.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 503

```json
{
  "description": "Native SEPA indexes or encryption prerequisites are unavailable; this request performs no migration.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

### OpenAPI

```json
{
  "x-unisoft-mcp-output-schema": true,
  "x-unisoft-scope": "sepa:mandates:write",
  "x-unisoft-additional-scopes": [
    "sepa:read",
    "abonnements:read",
    "paiements:read",
    "abonnements:write"
  ],
  "x-unisoft-mcp": {
    "category": "write",
    "readOnly": false,
    "destructive": true,
    "idempotent": true,
    "warn": true
  }
}
```

## GET /sepa/mandate-commands/{commandId}

Read a native mandate replacement receipt without retrying

`get_sepa_mandate_command`

Requires explicit sepa:read and abonnements:read; restricted campaign keys are refused. Current organisation, association, entitlement and linked subscription are re-admitted with scalar ownership. Reads use local persisted data and the actual mandate lifecycle owner only; no runtime/index initialisation, provider, daemon, notification or business mutation. Amounts are EUR MINOR units (5000 = EUR 50); unknown money, dates and statuses stay null/UNKNOWN. USABLE means the native ACTIVE/36-month-use rule, not bank acceptance or settlement. No IBAN, bank account, RUM, payer/donor identity, signature, document, settings, token, reusable credential or raw error is returned. Non-empty GET bodies and unknown arguments are refused. Shared authentication may record API key usage. Also requires paiements:read. Only already signed native mandates with matching amount, currency, duration, donor and label are candidates; the origin must be ACTIVE and have zero payments. Candidates are not a request to sign again. Secure renewal-request creation is UNAVAILABLE/SECURE_RENEWAL_OWNER_REQUIRED: the existing registration owner requires a real ADMIN source, while public checkout creates another active contract and may launch it. The integration never fabricates ADMIN or misrepresents a second checkout as renewal. Use the existing authorised signature/registration workflow before selecting a signed candidate. Also requires sepa:mandates:write and abonnements:write. Explicit commandId UUID, current expectedRevision and expectedMandateId are required. Canonical subscription repository locks are acquired on both admitted contracts; revision is rechecked under lock, and interrupted owner entry retains authority locks until reviewed. Delegates the real replaceMandate command, preserves history, supersedes the old mandate and marks the candidate origin REPLACED. Prepared/reserved/exported collections block replacement; it does not retry a debit or resume MANUAL/PAUSE. Actor APIKEY_<key id> stays visible; SYSTEM is only native audit classification, not a privilege grant. No ADMIN impersonation. Native unique indexes are inspected without migration. Shared lifecycle fences are durably acquired before owner entry and deleted only after acknowledged completion and terminal publication; uncertainty retains them without TTL or stealing. Claims require acknowledged:true and exact insertedId; all native/terminal writes force majority+j:true with positive driver acknowledgement. Identical replay reads matching native DONE proof, never executes again. Missing/failed/in-flight proof remains SEPA_COMMAND_UNCERTAIN; inspect the original command, never use a new ID automatically. No plaintext bank data enters the external journal. READ ONLY: current principal journal and native DONE receipt only; no lock acquire/release, replacement or registration is performed.

### Authentication

```json
[
  {
    "bearerAuth": []
  },
  {
    "apiKeyHeader": []
  }
]
```

### Required permissions

```json
{
  "accepted": "sepa:mandates:write",
  "additional": [
    "sepa:read",
    "abonnements:read",
    "paiements:read",
    "abonnements:write"
  ]
}
```

### Parameters

```json
{
  "name": "commandId",
  "in": "path",
  "required": true,
  "schema": {
    "type": "string",
    "format": "uuid"
  }
}
```

### Responses

#### HTTP 200

```json
{
  "description": "Qualified mandate metadata or proven native command receipt.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateCommand"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "Invalid identifier, command, revision, reason, pagination or unknown query/body fields.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 401

```json
{
  "description": "Missing or invalid authentication.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 403

```json
{
  "description": "Missing explicit scope, restricted campaign key, disabled organisation or unavailable API actor.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "Resource absent from the current organisation and association.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "Ambiguous ownership/history, changed schedule or mandate, locked collection, lifecycle fence, reused command or uncertain native proof. Preserve the original command ID; no automatic retry.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 500

```json
{
  "description": "Internal error without private bank data or raw diagnostics.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

#### HTTP 503

```json
{
  "description": "Native SEPA indexes or encryption prerequisites are unavailable; this request performs no migration.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaMandateError"
      }
    }
  }
}
```

### OpenAPI

```json
{
  "x-unisoft-mcp-output-schema": true,
  "x-unisoft-scope": "sepa:mandates:write",
  "x-unisoft-additional-scopes": [
    "sepa:read",
    "abonnements:read",
    "paiements:read",
    "abonnements:write"
  ],
  "x-unisoft-mcp": {
    "category": "read",
    "readOnly": true,
    "destructive": false,
    "idempotent": true,
    "warn": false
  }
}
```

## Schemas

```json
{
  "components": {
    "schemas": {
      "SepaMandateList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success",
          "data",
          "meta"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SepaMandate"
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "hasMore",
              "after"
            ],
            "properties": {
              "hasMore": {
                "type": "boolean"
              },
              "after": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "nullable": true
              }
            }
          }
        }
      },
      "SepaMandate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "assoc",
          "state",
          "usability",
          "subscriptionId",
          "amountMinor",
          "currency",
          "signedAt",
          "lastUsedAt",
          "revision"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "assoc": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "state": {
            "type": "string",
            "enum": [
              "DRAFT",
              "ACTIVE",
              "REVOKED",
              "EXPIRED",
              "SUPERSEDED",
              "UNUSABLE",
              "UNKNOWN"
            ]
          },
          "usability": {
            "type": "string",
            "enum": [
              "USABLE",
              "UNUSABLE",
              "UNKNOWN"
            ]
          },
          "subscriptionId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "amountMinor": {
            "type": "integer",
            "minimum": 1,
            "nullable": true
          },
          "currency": {
            "type": "string",
            "enum": [
              "eur",
              null
            ],
            "nullable": true
          },
          "signedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastUsedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "revision": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        }
      },
      "SepaMandateError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success",
          "error"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "error": {
            "type": "string"
          }
        }
      },
      "SepaMandateResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success",
          "data"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/SepaMandate"
          }
        }
      },
      "SepaMandateCandidates": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success",
          "data",
          "context",
          "secureRequest"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SepaMandate"
            }
          },
          "context": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "subscriptionId",
              "expectedMandateId",
              "revision"
            ],
            "properties": {
              "subscriptionId": {
                "type": "string",
                "format": "uuid"
              },
              "expectedMandateId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "revision": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            }
          },
          "secureRequest": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "availability",
              "reason"
            ],
            "properties": {
              "availability": {
                "type": "string",
                "enum": [
                  "UNAVAILABLE"
                ]
              },
              "reason": {
                "type": "string",
                "enum": [
                  "SECURE_RENEWAL_OWNER_REQUIRED"
                ]
              }
            }
          }
        }
      },
      "SepaMandateCommand": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success",
          "commandId",
          "outcome",
          "replayed",
          "data"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "commandId": {
            "type": "string",
            "format": "uuid"
          },
          "outcome": {
            "type": "string",
            "enum": [
              "APPLIED"
            ]
          },
          "replayed": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "subscriptionId",
              "mandateId",
              "state"
            ],
            "properties": {
              "subscriptionId": {
                "type": "string",
                "format": "uuid"
              },
              "mandateId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "state": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key",
        "description": "Format: `ke_live_xxx`"
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  }
}
```
