**גרסאות API** · **V2 (Latest)** · [V1](/integrations/v1/docs?lang=he)

# SEPA batches

OpenAPI 3.0.3 · API 2.0.0

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

## פעולות

## GET /sepa/collections

List stored SEPA collection and rejection states

`list_sepa_collections`

Requires explicit sepa:read, abonnements:read and paiements:read independently; campaign-restricted keys are refused. Current scalar organisation/association, entitlement and related subscriptions, payments and mandates are re-admitted. Local observations use EUR MINOR units (5000 = EUR 50), never money conversion or fabricated zero; unknown counters/dates remain null. Ordinary JSON omits XML, IBAN, bank/account details, payer/donor identity, RUM, remittance/reference text, snapshots, credentials and raw errors. GET uses stored rows only: never the native mutating getBatch recovery, generator, provider, daemon, submission, cache or index initialiser. Unknown arguments/non-empty GET bodies are refused. Shared authentication may record key usage.

### אימות

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

### הרשאות נדרשות

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

### פרמטרים

```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
  }
}
```

```json
{
  "name": "subscriptionId",
  "in": "query",
  "schema": {
    "type": "string",
    "format": "uuid"
  }
}
```

### תגובות

#### HTTP 200

```json
{
  "description": "Qualified stored observations, native preview or command proof.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaCollectionList"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "Invalid identifiers, selection, revision/hash, pagination or unexpected query/body.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 401

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

#### HTTP 403

```json
{
  "description": "Missing independent financial/export scope, restricted campaign key or disabled organisation.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "Resource or explicit export proof absent for this principal and current tenant.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "Changed preview, XML, payment, mandate, notice, configuration or ownership; batch/collection lock; native prerequisite; lifecycle fence; reused command or uncertain proof. Never retry automatically.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 500

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

#### HTTP 503

```json
{
  "description": "Existing native indexes or encryption key are unavailable; no automatic migration.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

### 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/batches/preview

Preview explicit collection eligibility without reserving a batch

`preview_sepa_batch`

Requires explicit sepa:read, abonnements:read and paiements:read independently; campaign-restricted keys are refused. Current scalar organisation/association, entitlement and related subscriptions, payments and mandates are re-admitted. Local observations use EUR MINOR units (5000 = EUR 50), never money conversion or fabricated zero; unknown counters/dates remain null. Ordinary JSON omits XML, IBAN, bank/account details, payer/donor identity, RUM, remittance/reference text, snapshots, credentials and raw errors. GET uses stored rows only: never the native mutating getBatch recovery, generator, provider, daemon, submission, cache or index initialiser. Unknown arguments/non-empty GET bodies are refused. Shared authentication may record key usage. Explicit read-only POST delegates the actual previewBatch policy. Its previewHash is required for generation; excluded rows/issues are safe codes, not payer details. This preview never reserves collections or creates XML.

### אימות

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

### הרשאות נדרשות

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

### גוף הבקשה

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "assoc": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "collectionIds": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1000,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        },
        "required": [
          "assoc",
          "collectionIds"
        ],
        "additionalProperties": false
      }
    }
  }
}
```

### תגובות

#### HTTP 200

```json
{
  "description": "Qualified stored observations, native preview or command proof.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchPreview"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "Invalid identifiers, selection, revision/hash, pagination or unexpected query/body.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 401

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

#### HTTP 403

```json
{
  "description": "Missing independent financial/export scope, restricted campaign key or disabled organisation.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "Resource or explicit export proof absent for this principal and current tenant.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "Changed preview, XML, payment, mandate, notice, configuration or ownership; batch/collection lock; native prerequisite; lifecycle fence; reused command or uncertain proof. Never retry automatically.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 500

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

#### HTTP 503

```json
{
  "description": "Existing native indexes or encryption key are unavailable; no automatic migration.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

### 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/batches

Generate one native SEPA XML batch explicitly

`generate_sepa_batch`

Requires explicit sepa:read, abonnements:read and paiements:read independently; campaign-restricted keys are refused. Current scalar organisation/association, entitlement and related subscriptions, payments and mandates are re-admitted. Local observations use EUR MINOR units (5000 = EUR 50), never money conversion or fabricated zero; unknown counters/dates remain null. Ordinary JSON omits XML, IBAN, bank/account details, payer/donor identity, RUM, remittance/reference text, snapshots, credentials and raw errors. GET uses stored rows only: never the native mutating getBatch recovery, generator, provider, daemon, submission, cache or index initialiser. Unknown arguments/non-empty GET bodies are refused. Shared authentication may record key usage. Commands additionally require sepa:batches:write, abonnements:write and paiements:write. A caller commandId UUID is namespaced by organisation/principal and forwarded as a stable native command key. Actual native commandBus/generator and their guards remain authoritative; APIKEY_<key id> is the actor, SYSTEM only audit classification, never fabricated ADMIN. Existing unique indexes are inspected without migration. Shared lifecycle fences are durably claimed before entry and removed only after acknowledged native completion and terminal publication; uncertainty retains them without TTL or stealing. Claims require acknowledged:true plus exact insertedId; native and terminal writes force majority+j:true and positive driver acknowledgement. Identical command replay reads native DONE proof without owner re-entry; failed/in-flight/missing proof is SEPA_COMMAND_UNCERTAIN. Preserve the original ID and read get_sepa_batch_command; no automatic retry or debit. POST delegates generateBatch with exact collectionIds and native previewHash. Native eligibility, dates, notices, mandate/document/account/configuration revisions, limits and collection CAS are preserved. It stores encrypted snapshot/XML, marks selected lines EXPORTED and returns only metadata. It does not download, upload to a bank, settle, reconcile, prepare a new occurrence or notify a payer.

### אימות

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

### הרשאות נדרשות

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

### גוף הבקשה

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "assoc": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "collectionIds": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1000,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          "previewHash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "commandId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "assoc",
          "collectionIds",
          "previewHash",
          "commandId"
        ],
        "additionalProperties": false
      }
    }
  }
}
```

### תגובות

#### HTTP 200

```json
{
  "description": "Qualified stored observations, native preview or command proof.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchCommand"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "Invalid identifiers, selection, revision/hash, pagination or unexpected query/body.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 401

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

#### HTTP 403

```json
{
  "description": "Missing independent financial/export scope, restricted campaign key or disabled organisation.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "Resource or explicit export proof absent for this principal and current tenant.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "Changed preview, XML, payment, mandate, notice, configuration or ownership; batch/collection lock; native prerequisite; lifecycle fence; reused command or uncertain proof. Never retry automatically.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 500

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

#### HTTP 503

```json
{
  "description": "Existing native indexes or encryption key are unavailable; no automatic migration.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

### OpenAPI

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

## GET /sepa/batches/{id}

Read stored native batch metadata without recovery

`get_sepa_batch`

Requires explicit sepa:read, abonnements:read and paiements:read independently; campaign-restricted keys are refused. Current scalar organisation/association, entitlement and related subscriptions, payments and mandates are re-admitted. Local observations use EUR MINOR units (5000 = EUR 50), never money conversion or fabricated zero; unknown counters/dates remain null. Ordinary JSON omits XML, IBAN, bank/account details, payer/donor identity, RUM, remittance/reference text, snapshots, credentials and raw errors. GET uses stored rows only: never the native mutating getBatch recovery, generator, provider, daemon, submission, cache or index initialiser. Unknown arguments/non-empty GET bodies are refused. Shared authentication may record key usage.

### אימות

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

### הרשאות נדרשות

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

### פרמטרים

```json
{
  "name": "id",
  "in": "path",
  "required": true,
  "description": "Opaque native batch ID from generation; not a payment or mandate ID.",
  "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
  }
}
```

### תגובות

#### HTTP 200

```json
{
  "description": "Qualified stored observations, native preview or command proof.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchResponse"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "Invalid identifiers, selection, revision/hash, pagination or unexpected query/body.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 401

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

#### HTTP 403

```json
{
  "description": "Missing independent financial/export scope, restricted campaign key or disabled organisation.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "Resource or explicit export proof absent for this principal and current tenant.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "Changed preview, XML, payment, mandate, notice, configuration or ownership; batch/collection lock; native prerequisite; lifecycle fence; reused command or uncertain proof. Never retry automatically.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 500

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

#### HTTP 503

```json
{
  "description": "Existing native indexes or encryption key are unavailable; no automatic migration.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

### 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
  }
}
```

## GET /sepa/batches/{id}/returns

Read recorded SEPA returns and rejection codes

`list_sepa_batch_returns`

Requires explicit sepa:read, abonnements:read and paiements:read independently; campaign-restricted keys are refused. Current scalar organisation/association, entitlement and related subscriptions, payments and mandates are re-admitted. Local observations use EUR MINOR units (5000 = EUR 50), never money conversion or fabricated zero; unknown counters/dates remain null. Ordinary JSON omits XML, IBAN, bank/account details, payer/donor identity, RUM, remittance/reference text, snapshots, credentials and raw errors. GET uses stored rows only: never the native mutating getBatch recovery, generator, provider, daemon, submission, cache or index initialiser. Unknown arguments/non-empty GET bodies are refused. Shared authentication may record key usage. Recorded returns only (at most 200). Reference/message/assignment and financial mutation plans are omitted. This read neither imports bank files nor records a return, resolves an ambiguity, retries a payment or confirms settlement.

### אימות

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

### הרשאות נדרשות

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

### פרמטרים

```json
{
  "name": "id",
  "in": "path",
  "required": true,
  "description": "Opaque native batch ID from generation; not a payment or mandate ID.",
  "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
  }
}
```

### תגובות

#### HTTP 200

```json
{
  "description": "Qualified stored observations, native preview or command proof.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchReturns"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "Invalid identifiers, selection, revision/hash, pagination or unexpected query/body.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 401

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

#### HTTP 403

```json
{
  "description": "Missing independent financial/export scope, restricted campaign key or disabled organisation.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "Resource or explicit export proof absent for this principal and current tenant.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "Changed preview, XML, payment, mandate, notice, configuration or ownership; batch/collection lock; native prerequisite; lifecycle fence; reused command or uncertain proof. Never retry automatically.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 500

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

#### HTTP 503

```json
{
  "description": "Existing native indexes or encryption key are unavailable; no automatic migration.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

### 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/batches/{id}/export

Record an explicit native XML export and submission bookkeeping

`export_sepa_batch`

Requires explicit sepa:read, abonnements:read and paiements:read independently; campaign-restricted keys are refused. Current scalar organisation/association, entitlement and related subscriptions, payments and mandates are re-admitted. Local observations use EUR MINOR units (5000 = EUR 50), never money conversion or fabricated zero; unknown counters/dates remain null. Ordinary JSON omits XML, IBAN, bank/account details, payer/donor identity, RUM, remittance/reference text, snapshots, credentials and raw errors. GET uses stored rows only: never the native mutating getBatch recovery, generator, provider, daemon, submission, cache or index initialiser. Unknown arguments/non-empty GET bodies are refused. Shared authentication may record key usage. Commands additionally require sepa:batches:write, abonnements:write and paiements:write. A caller commandId UUID is namespaced by organisation/principal and forwarded as a stable native command key. Actual native commandBus/generator and their guards remain authoritative; APIKEY_<key id> is the actor, SYSTEM only audit classification, never fabricated ADMIN. Existing unique indexes are inspected without migration. Shared lifecycle fences are durably claimed before entry and removed only after acknowledged native completion and terminal publication; uncertainty retains them without TTL or stealing. Claims require acknowledged:true plus exact insertedId; native and terminal writes force majority+j:true and positive driver acknowledgement. Identical command replay reads native DONE proof without owner re-entry; failed/in-flight/missing proof is SEPA_COMMAND_UNCERTAIN. Preserve the original ID and read get_sepa_batch_command; no automatic retry or debit. Explicit export additionally requires sepa:export. POST export invokes the true native downloadBatch: verifies/decrypts existing XML and records native download/submission bookkeeping, moves eligible EXPORTED lines to SUBMITTED and SEPA_PENDING payments to PRELEVEMENT-SUBMITED, and updates mandate lastUsedAt. This is NOT a bank upload, acceptance or settlement. Plaintext XML is discarded before command journaling; JSON contains only digest and safe receipt. Then GET file requires the same principal, export commandId and exact sha256. It decrypts that existing stored artifact only, validates SHA256 and returns application/xml attachment without generating, submitting, counting another download or storing plaintext. XML contains payer/creditor PII and IBANs: request/export only when explicitly needed, never log or echo it. Use download_exported_sepa_batch through MCP to retrieve the already exported private XML file.

### אימות

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

### הרשאות נדרשות

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

### פרמטרים

```json
{
  "name": "id",
  "in": "path",
  "required": true,
  "description": "Opaque native batch ID from generation; not a payment or mandate ID.",
  "schema": {
    "type": "string",
    "minLength": 1,
    "maxLength": 128
  }
}
```

### גוף הבקשה

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

### תגובות

#### HTTP 200

```json
{
  "description": "Qualified stored observations, native preview or command proof.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchCommand"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "Invalid identifiers, selection, revision/hash, pagination or unexpected query/body.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 401

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

#### HTTP 403

```json
{
  "description": "Missing independent financial/export scope, restricted campaign key or disabled organisation.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "Resource or explicit export proof absent for this principal and current tenant.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "Changed preview, XML, payment, mandate, notice, configuration or ownership; batch/collection lock; native prerequisite; lifecycle fence; reused command or uncertain proof. Never retry automatically.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 500

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

#### HTTP 503

```json
{
  "description": "Existing native indexes or encryption key are unavailable; no automatic migration.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

### OpenAPI

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

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

Read a native SEPA batch command receipt without replaying

`get_sepa_batch_command`

Requires explicit sepa:read, abonnements:read and paiements:read independently; campaign-restricted keys are refused. Current scalar organisation/association, entitlement and related subscriptions, payments and mandates are re-admitted. Local observations use EUR MINOR units (5000 = EUR 50), never money conversion or fabricated zero; unknown counters/dates remain null. Ordinary JSON omits XML, IBAN, bank/account details, payer/donor identity, RUM, remittance/reference text, snapshots, credentials and raw errors. GET uses stored rows only: never the native mutating getBatch recovery, generator, provider, daemon, submission, cache or index initialiser. Unknown arguments/non-empty GET bodies are refused. Shared authentication may record key usage. Commands additionally require sepa:batches:write, abonnements:write and paiements:write. A caller commandId UUID is namespaced by organisation/principal and forwarded as a stable native command key. Actual native commandBus/generator and their guards remain authoritative; APIKEY_<key id> is the actor, SYSTEM only audit classification, never fabricated ADMIN. Existing unique indexes are inspected without migration. Shared lifecycle fences are durably claimed before entry and removed only after acknowledged native completion and terminal publication; uncertainty retains them without TTL or stealing. Claims require acknowledged:true plus exact insertedId; native and terminal writes force majority+j:true and positive driver acknowledgement. Identical command replay reads native DONE proof without owner re-entry; failed/in-flight/missing proof is SEPA_COMMAND_UNCERTAIN. Preserve the original ID and read get_sepa_batch_command; no automatic retry or debit. READ ONLY: generation DONE evidence and current owned batch only, with the original generation scopes; no export permission is needed. The original receipt does not replace current batch status.

### אימות

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

### הרשאות נדרשות

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

### פרמטרים

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

### תגובות

#### HTTP 200

```json
{
  "description": "Qualified stored observations, native preview or command proof.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchCommand"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "Invalid identifiers, selection, revision/hash, pagination or unexpected query/body.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 401

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

#### HTTP 403

```json
{
  "description": "Missing independent financial/export scope, restricted campaign key or disabled organisation.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "Resource or explicit export proof absent for this principal and current tenant.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "Changed preview, XML, payment, mandate, notice, configuration or ownership; batch/collection lock; native prerequisite; lifecycle fence; reused command or uncertain proof. Never retry automatically.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 500

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

#### HTTP 503

```json
{
  "description": "Existing native indexes or encryption key are unavailable; no automatic migration.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

### OpenAPI

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

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

Read a native SEPA export receipt without exporting again

`get_sepa_export_command`

Requires explicit sepa:read, abonnements:read and paiements:read independently; campaign-restricted keys are refused. Current scalar organisation/association, entitlement and related subscriptions, payments and mandates are re-admitted. Local observations use EUR MINOR units (5000 = EUR 50), never money conversion or fabricated zero; unknown counters/dates remain null. Ordinary JSON omits XML, IBAN, bank/account details, payer/donor identity, RUM, remittance/reference text, snapshots, credentials and raw errors. GET uses stored rows only: never the native mutating getBatch recovery, generator, provider, daemon, submission, cache or index initialiser. Unknown arguments/non-empty GET bodies are refused. Shared authentication may record key usage. Commands additionally require sepa:batches:write, abonnements:write and paiements:write. A caller commandId UUID is namespaced by organisation/principal and forwarded as a stable native command key. Actual native commandBus/generator and their guards remain authoritative; APIKEY_<key id> is the actor, SYSTEM only audit classification, never fabricated ADMIN. Existing unique indexes are inspected without migration. Shared lifecycle fences are durably claimed before entry and removed only after acknowledged native completion and terminal publication; uncertainty retains them without TTL or stealing. Claims require acknowledged:true plus exact insertedId; native and terminal writes force majority+j:true and positive driver acknowledgement. Identical command replay reads native DONE proof without owner re-entry; failed/in-flight/missing proof is SEPA_COMMAND_UNCERTAIN. Preserve the original ID and read get_sepa_batch_command; no automatic retry or debit. Explicit export additionally requires sepa:export. POST export invokes the true native downloadBatch: verifies/decrypts existing XML and records native download/submission bookkeeping, moves eligible EXPORTED lines to SUBMITTED and SEPA_PENDING payments to PRELEVEMENT-SUBMITED, and updates mandate lastUsedAt. This is NOT a bank upload, acceptance or settlement. Plaintext XML is discarded before command journaling; JSON contains only digest and safe receipt. Then GET file requires the same principal, export commandId and exact sha256. It decrypts that existing stored artifact only, validates SHA256 and returns application/xml attachment without generating, submitting, counting another download or storing plaintext. XML contains payer/creditor PII and IBANs: request/export only when explicitly needed, never log or echo it. Use download_exported_sepa_batch through MCP to retrieve the already exported private XML file. READ ONLY: export DONE evidence and current owned batch only, with the original export scopes. The original receipt does not replace current batch status.

### אימות

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

### הרשאות נדרשות

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

### פרמטרים

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

### תגובות

#### HTTP 200

```json
{
  "description": "Qualified stored observations, native preview or command proof.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchCommand"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "Invalid identifiers, selection, revision/hash, pagination or unexpected query/body.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 401

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

#### HTTP 403

```json
{
  "description": "Missing independent financial/export scope, restricted campaign key or disabled organisation.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "Resource or explicit export proof absent for this principal and current tenant.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "Changed preview, XML, payment, mandate, notice, configuration or ownership; batch/collection lock; native prerequisite; lifecycle fence; reused command or uncertain proof. Never retry automatically.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 500

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

#### HTTP 503

```json
{
  "description": "Existing native indexes or encryption key are unavailable; no automatic migration.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

### OpenAPI

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

## GET /sepa/batches/{id}/file

Download explicitly exported existing SEPA XML

`download_exported_sepa_batch`

Requires explicit sepa:read, abonnements:read and paiements:read independently; campaign-restricted keys are refused. Current scalar organisation/association, entitlement and related subscriptions, payments and mandates are re-admitted. Local observations use EUR MINOR units (5000 = EUR 50), never money conversion or fabricated zero; unknown counters/dates remain null. Ordinary JSON omits XML, IBAN, bank/account details, payer/donor identity, RUM, remittance/reference text, snapshots, credentials and raw errors. GET uses stored rows only: never the native mutating getBatch recovery, generator, provider, daemon, submission, cache or index initialiser. Unknown arguments/non-empty GET bodies are refused. Shared authentication may record key usage. Commands additionally require sepa:batches:write, abonnements:write and paiements:write. A caller commandId UUID is namespaced by organisation/principal and forwarded as a stable native command key. Actual native commandBus/generator and their guards remain authoritative; APIKEY_<key id> is the actor, SYSTEM only audit classification, never fabricated ADMIN. Existing unique indexes are inspected without migration. Shared lifecycle fences are durably claimed before entry and removed only after acknowledged native completion and terminal publication; uncertainty retains them without TTL or stealing. Claims require acknowledged:true plus exact insertedId; native and terminal writes force majority+j:true and positive driver acknowledgement. Identical command replay reads native DONE proof without owner re-entry; failed/in-flight/missing proof is SEPA_COMMAND_UNCERTAIN. Preserve the original ID and read get_sepa_batch_command; no automatic retry or debit. Explicit export additionally requires sepa:export. POST export invokes the true native downloadBatch: verifies/decrypts existing XML and records native download/submission bookkeeping, moves eligible EXPORTED lines to SUBMITTED and SEPA_PENDING payments to PRELEVEMENT-SUBMITED, and updates mandate lastUsedAt. This is NOT a bank upload, acceptance or settlement. Plaintext XML is discarded before command journaling; JSON contains only digest and safe receipt. Then GET file requires the same principal, export commandId and exact sha256. It decrypts that existing stored artifact only, validates SHA256 and returns application/xml attachment without generating, submitting, counting another download or storing plaintext. XML contains payer/creditor PII and IBANs: request/export only when explicitly needed, never log or echo it. Use download_exported_sepa_batch through MCP to retrieve the already exported private XML file.

MCP returns the actual private file as an embedded resource with MIME type and base64 blob, plus filename, byteLength and the SHA-256 of the decoded bytes. Use the host file capability to save or attach those bytes under the returned filename and verify size and SHA-256. The unisoft URI identifies this response only; it is not a public URL or a reusable download handle. Do not paste the blob into chat text, publicly upload a financial document or invent a sharing URL. The current authenticated REST owner rechecks organisation, permissions and every required source or export proof on each call. REST keeps its binary response. A file proves only that these bytes were retrieved, not payment settlement, document legal validity or delivery to a recipient.

### אימות

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

### הרשאות נדרשות

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

### פרמטרים

```json
{
  "name": "id",
  "in": "path",
  "required": true,
  "description": "Opaque native batch ID from generation; not a payment or mandate ID.",
  "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
  }
}
```

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

```json
{
  "name": "sha256",
  "in": "query",
  "required": true,
  "schema": {
    "type": "string",
    "pattern": "^[a-f0-9]{64}$"
  }
}
```

### תגובות

#### HTTP 200

```json
{
  "description": "Existing private XML attachment; contains bank/payer PII.",
  "headers": {
    "X-Content-SHA256": {
      "schema": {
        "type": "string",
        "pattern": "^[a-f0-9]{64}$"
      }
    },
    "Content-Disposition": {
      "schema": {
        "type": "string"
      }
    }
  },
  "content": {
    "application/xml": {
      "schema": {
        "type": "string",
        "format": "binary"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "Invalid identifiers, selection, revision/hash, pagination or unexpected query/body.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 401

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

#### HTTP 403

```json
{
  "description": "Missing independent financial/export scope, restricted campaign key or disabled organisation.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "Resource or explicit export proof absent for this principal and current tenant.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "Changed preview, XML, payment, mandate, notice, configuration or ownership; batch/collection lock; native prerequisite; lifecycle fence; reused command or uncertain proof. Never retry automatically.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

#### HTTP 500

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

#### HTTP 503

```json
{
  "description": "Existing native indexes or encryption key are unavailable; no automatic migration.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SepaBatchError"
      }
    }
  }
}
```

### OpenAPI

```json
{
  "x-unisoft-scope": "sepa:export",
  "x-unisoft-additional-scopes": [
    "sepa:batches:write",
    "sepa:read",
    "abonnements:read",
    "paiements:read",
    "abonnements:write",
    "paiements:write"
  ],
  "x-unisoft-mcp": {
    "category": "read",
    "readOnly": true,
    "destructive": false,
    "idempotent": true,
    "warn": false
  },
  "x-unisoft-mcp-file": {
    "mimeType": "application/xml",
    "maxBytes": 26214400
  }
}
```

## סכמות

```json
{
  "components": {
    "schemas": {
      "SepaCollectionList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success",
          "data",
          "meta"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "subscriptionId",
                "paymentId",
                "state",
                "amountMinor",
                "currency",
                "ordinal",
                "attempt",
                "contractualDate",
                "scheduledDate",
                "requestedDate",
                "batchId"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "subscriptionId": {
                  "type": "string",
                  "format": "uuid"
                },
                "paymentId": {
                  "type": "string",
                  "format": "uuid"
                },
                "state": {
                  "type": "string"
                },
                "amountMinor": {
                  "type": "integer",
                  "minimum": 1
                },
                "currency": {
                  "type": "string",
                  "enum": [
                    "eur"
                  ]
                },
                "ordinal": {
                  "type": "integer",
                  "minimum": 0,
                  "nullable": true
                },
                "attempt": {
                  "type": "integer",
                  "minimum": 0,
                  "nullable": true
                },
                "contractualDate": {
                  "type": "string",
                  "format": "date",
                  "nullable": true
                },
                "scheduledDate": {
                  "type": "string",
                  "format": "date",
                  "nullable": true
                },
                "requestedDate": {
                  "type": "string",
                  "format": "date",
                  "nullable": true
                },
                "batchId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128,
                  "nullable": true
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "hasMore",
              "after"
            ],
            "properties": {
              "hasMore": {
                "type": "boolean"
              },
              "after": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "nullable": true
              }
            }
          }
        }
      },
      "SepaBatchError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success",
          "error"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "error": {
            "type": "string"
          }
        }
      },
      "SepaBatchPreview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success",
          "data"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "previewHash",
              "eligibleIds",
              "amountMinor",
              "currency",
              "transactionCount",
              "maximum",
              "overLimit",
              "rows"
            ],
            "properties": {
              "previewHash": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "eligibleIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                }
              },
              "amountMinor": {
                "type": "integer",
                "minimum": 0,
                "nullable": true
              },
              "currency": {
                "type": "string",
                "enum": [
                  "eur"
                ]
              },
              "transactionCount": {
                "type": "integer",
                "minimum": 0,
                "nullable": true
              },
              "maximum": {
                "type": "integer",
                "minimum": 0,
                "nullable": true
              },
              "overLimit": {
                "type": "boolean",
                "nullable": true
              },
              "rows": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "selectable",
                    "issues"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    "selectable": {
                      "type": "boolean"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "SepaBatchCommand": {
        "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": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "batchId",
                  "sha256",
                  "amountMinor",
                  "transactionCount",
                  "currency",
                  "state"
                ],
                "properties": {
                  "batchId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "sha256": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  "amountMinor": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "transactionCount": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "currency": {
                    "type": "string",
                    "enum": [
                      "eur"
                    ]
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "GENERATED"
                    ]
                  }
                }
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "batchId",
                  "sha256",
                  "exportRecorded",
                  "bankTransmission",
                  "settlement"
                ],
                "properties": {
                  "batchId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "sha256": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  "exportRecorded": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  },
                  "bankTransmission": {
                    "type": "string",
                    "enum": [
                      "NOT_REPORTED"
                    ]
                  },
                  "settlement": {
                    "type": "string",
                    "enum": [
                      "NOT_REPORTED"
                    ]
                  }
                }
              }
            ]
          }
        }
      },
      "SepaBatchResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success",
          "data"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "assoc",
              "state",
              "sha256",
              "amountMinor",
              "currency",
              "transactionCount",
              "receivedMinor",
              "settledCount",
              "createdAt",
              "downloadedAt",
              "submittedAt",
              "downloadCount",
              "transmittedDate",
              "revision"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "assoc": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "state": {
                "type": "string"
              },
              "sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$",
                "nullable": true
              },
              "amountMinor": {
                "type": "integer",
                "minimum": 0,
                "nullable": true
              },
              "currency": {
                "type": "string",
                "enum": [
                  "eur"
                ]
              },
              "transactionCount": {
                "type": "integer",
                "minimum": 0,
                "nullable": true
              },
              "receivedMinor": {
                "type": "integer",
                "minimum": 0,
                "nullable": true
              },
              "settledCount": {
                "type": "integer",
                "minimum": 0,
                "nullable": true
              },
              "createdAt": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "downloadedAt": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "submittedAt": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "downloadCount": {
                "type": "integer",
                "minimum": 0,
                "nullable": true
              },
              "transmittedDate": {
                "type": "string",
                "format": "date",
                "nullable": true
              },
              "revision": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            }
          }
        }
      },
      "SepaBatchReturns": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success",
          "data"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "type",
                "collectionIds",
                "reasonCode",
                "amountMinor",
                "currency",
                "occurredAt",
                "processingState"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "type": {
                  "type": "string"
                },
                "collectionIds": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  }
                },
                "reasonCode": {
                  "type": "string",
                  "nullable": true
                },
                "amountMinor": {
                  "type": "integer",
                  "minimum": 0,
                  "nullable": true
                },
                "currency": {
                  "type": "string",
                  "enum": [
                    "eur"
                  ]
                },
                "occurredAt": {
                  "type": "string",
                  "format": "date-time",
                  "nullable": true
                },
                "processingState": {
                  "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"
      }
    }
  }
}
```
