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

# Bank reconciliation

OpenAPI 3.0.3 · API 2.0.0

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

## פעולות

## GET /banking/accounts/{bankId}/transactions/{transactionId}/reconciliation

Read stored statement links and their current version

`get_bank_reconciliation`

Requires explicit banking:read plus budgets:read and paiements:read, all enforced separately; campaign-restricted keys are refused. Authorises the current local bank account and exact statement row in the organisation, then re-admits each related object in the same legal association. Bank, payment, operation and transaction IDs are distinct. amountMajor is in MAJOR currency units, never divide by 100. Stored pointage or a manual link is an accounting observation, not provider capture, payout composition or proof of settlement of a particular donation. No bank/provider request, sync, new payment, debit or refund occurs. No reusable credential, provider account/payout reference or raw snapshot is returned. A VIREMENT link is masked and managed by STRIPE_TREASURY; SEPA claim/allocation is managed by SEPA_XML. Unknown arguments and non-empty GET bodies are rejected. Shared authentication may record key usage. Every manual related target must remain available in the current organisation/association; a stale or foreign reference returns LINK_TARGET_UNAVAILABLE without exposing that target. Unknown historical amount/currency/pointage remains null. Managed VIREMENT IDs/labels/amounts remain masked. This read does not apply or validate anything.

### אימות

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

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

```json
{
  "accepted": "banking:read",
  "additional": [
    "budgets:read",
    "paiements:read"
  ]
}
```

### פרמטרים

```json
{
  "name": "bankId",
  "in": "path",
  "required": true,
  "description": "Local bank-account UUID returned by list_banking_accounts.",
  "schema": {
    "type": "string",
    "format": "uuid"
  }
}
```

```json
{
  "name": "transactionId",
  "in": "path",
  "required": true,
  "description": "Opaque statement transaction ID returned for this exact bank, maximum 255 characters.",
  "schema": {
    "type": "string",
    "minLength": 1,
    "maxLength": 255
  }
}
```

### תגובות

#### HTTP 200

```json
{
  "description": "Qualified local reconciliation observation or explicit command outcome.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationResponse"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "INVALID_TARGET, INVALID_AMOUNT, INVALID_REQUEST or INVALID_RECONCILIATION_COMMAND; unknown query parameters or non-empty GET body.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 401

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

#### HTTP 403

```json
{
  "description": "INSUFFICIENT_SCOPE, disabled organisation or CAMPAIGN_RESTRICTED_KEY.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "NOT_FOUND or LINK_NOT_FOUND within the current organisation/account context.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "SEPA_BANK_SETTLEMENT_LOCKED, TREASURY_BANK_USE_PAYOUT, STALE_RECONCILIATION, ALREADY_LINKED, LINK_TARGET_UNAVAILABLE, INVALID_RECONCILIATION_HISTORY, AMBIGUOUS_TRANSACTION, RECONCILIATION_DATE_UNKNOWN, RECONCILIATION_AMOUNT_UNKNOWN, RECONCILIATION_CURRENCY_MISMATCH, RECONCILIATION_SOURCE_LIMIT, BUDGET_TRANSFER_NOT_BANK_MOVEMENT, INVALID_PAYMENT_MATCH, PAYMENT_NOT_COMPLETED, AUTO_OPERATION_STILL_LINKED, COMMAND_ID_REUSED, COMMAND_UNCERTAIN, COMMAND_HISTORY_LIMIT or INVALID_COMMAND_HISTORY. Do not retry a financial action or bypass the owning workflow.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 500

```json
{
  "description": "INTERNAL_ERROR with no private diagnostic. Preserve the command UUID after any uncertain write.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

### OpenAPI

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

## GET /banking/accounts/{bankId}/transactions/{transactionId}/suggestions

Suggest accounting records for explicit bank review

`suggest_bank_reconciliation`

Requires explicit banking:read plus budgets:read and paiements:read, all enforced separately; campaign-restricted keys are refused. Authorises the current local bank account and exact statement row in the organisation, then re-admits each related object in the same legal association. Bank, payment, operation and transaction IDs are distinct. amountMajor is in MAJOR currency units, never divide by 100. Stored pointage or a manual link is an accounting observation, not provider capture, payout composition or proof of settlement of a particular donation. No bank/provider request, sync, new payment, debit or refund occurs. No reusable credential, provider account/payout reference or raw snapshot is returned. A VIREMENT link is masked and managed by STRIPE_TREASURY; SEPA claim/allocation is managed by SEPA_XML. Unknown arguments and non-empty GET bodies are rejected. Shared authentication may record key usage. Reads candidates then uses the native deterministic rankCandidates: 12-day window, minimum score 45, at most five results with reasons. Positive statement amounts search income and completed payments; debits search expenses. Internal budget transfers, different currencies/associations, already linked records and Stripe payments are excluded. A payment suggestion uses audited /100 units only for eur/usd/gbp/ils/cad/aud/chf and requires explicit zero recorded fees and no effective conversion or conflicting finalAmount; unknown fees/net never become zero. Missing valid value/booking date or amount returns a prerequisite error, never today's date or zero. At most 400 candidates per kind and 5000 statement rows are inspected; truncated/omitted report partial coverage. A suggestion and score never apply a match or prove reception. No refresh, pointage update or automatic write occurs.

### אימות

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

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

```json
{
  "accepted": "banking:read",
  "additional": [
    "budgets:read",
    "paiements:read"
  ]
}
```

### פרמטרים

```json
{
  "name": "bankId",
  "in": "path",
  "required": true,
  "description": "Local bank-account UUID returned by list_banking_accounts.",
  "schema": {
    "type": "string",
    "format": "uuid"
  }
}
```

```json
{
  "name": "transactionId",
  "in": "path",
  "required": true,
  "description": "Opaque statement transaction ID returned for this exact bank, maximum 255 characters.",
  "schema": {
    "type": "string",
    "minLength": 1,
    "maxLength": 255
  }
}
```

### תגובות

#### HTTP 200

```json
{
  "description": "Qualified local reconciliation observation or explicit command outcome.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationSuggestionResponse"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "INVALID_TARGET, INVALID_AMOUNT, INVALID_REQUEST or INVALID_RECONCILIATION_COMMAND; unknown query parameters or non-empty GET body.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 401

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

#### HTTP 403

```json
{
  "description": "INSUFFICIENT_SCOPE, disabled organisation or CAMPAIGN_RESTRICTED_KEY.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "NOT_FOUND or LINK_NOT_FOUND within the current organisation/account context.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "SEPA_BANK_SETTLEMENT_LOCKED, TREASURY_BANK_USE_PAYOUT, STALE_RECONCILIATION, ALREADY_LINKED, LINK_TARGET_UNAVAILABLE, INVALID_RECONCILIATION_HISTORY, AMBIGUOUS_TRANSACTION, RECONCILIATION_DATE_UNKNOWN, RECONCILIATION_AMOUNT_UNKNOWN, RECONCILIATION_CURRENCY_MISMATCH, RECONCILIATION_SOURCE_LIMIT, BUDGET_TRANSFER_NOT_BANK_MOVEMENT, INVALID_PAYMENT_MATCH, PAYMENT_NOT_COMPLETED, AUTO_OPERATION_STILL_LINKED, COMMAND_ID_REUSED, COMMAND_UNCERTAIN, COMMAND_HISTORY_LIMIT or INVALID_COMMAND_HISTORY. Do not retry a financial action or bypass the owning workflow.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 500

```json
{
  "description": "INTERNAL_ERROR with no private diagnostic. Preserve the command UUID after any uncertain write.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

### OpenAPI

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

## POST /banking/accounts/{bankId}/transactions/{transactionId}/reconciliation/commands

Link, unlink or point a statement row after explicit review

`command_bank_reconciliation`

Requires explicit banking:read plus budgets:read and paiements:read, all enforced separately; campaign-restricted keys are refused. Authorises the current local bank account and exact statement row in the organisation, then re-admits each related object in the same legal association. Bank, payment, operation and transaction IDs are distinct. amountMajor is in MAJOR currency units, never divide by 100. Stored pointage or a manual link is an accounting observation, not provider capture, payout composition or proof of settlement of a particular donation. No bank/provider request, sync, new payment, debit or refund occurs. No reusable credential, provider account/payout reference or raw snapshot is returned. A VIREMENT link is masked and managed by STRIPE_TREASURY; SEPA claim/allocation is managed by SEPA_XML. Unknown arguments and non-empty GET bodies are rejected. Shared authentication may record key usage. Additionally requires banking:reconcile and budgets:write, explicitly granted and verified; budgets:write is needed because removing an automatic operation link performs its native logical deletion. action LINK requires type OPERATION/PAIEMENT, id and positive amountMajor with at most two decimals; description is optional, maximum 500 characters. UNLINK requires only type/id. VALIDATE/UNVALIDATE accept none of those target fields and set only the statement pointage flag. LINK uses the native annotation fields id/type/montant/description; the amount is the user's explicit allocation, not an inferred net or settlement amount. It is not automatically capped or balanced by a new banking formula. Completed non-Stripe payments can be manually annotated; Stripe payments and VIREMENT links require the Treasury owner. Accounting transfers between budgets are not bank movements. SEPA claims/allocations and any VIREMENT block these generic writes. expectedVersion must be the current reconciliation version; CAS compares the stored amount/currency/dates/links/pointage/SEPA guards and command history, including internal changes. A durable journal and marker on the statement prevent repeated effects for the same organisation/principal/commandId. Reuse commandId only for the identical action; COMMAND_UNCERTAIN never permits a new ID or automatic write retry. Read get_bank_reconciliation_command instead. UNLINK preserves native behaviour: a linked auto operation is logically deleted after the statement CAS; a shared auto operation is refused. These are two documents, not an atomic transaction: APPLIED with cleanup DELETED proves both writes; PARTIAL with cleanup REVIEW means the link was removed but cleanup is unresolved. Do not relink, recreate, delete or replay automatically to compensate. Claims require acknowledged:true and the exact insertedId, and all effect/CAS/terminal writes force majority+j:true with positive driver acknowledgement. A lost, absent or false acknowledgement returns COMMAND_UNCERTAIN; only a later read may resolve the durable marker without repeating an effect. A receipt reports that command's applied action, not the statement's current state.

### אימות

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

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

```json
{
  "accepted": "banking:reconcile",
  "additional": [
    "banking:read",
    "budgets:read",
    "paiements:read",
    "budgets:write"
  ]
}
```

### פרמטרים

```json
{
  "name": "bankId",
  "in": "path",
  "required": true,
  "description": "Local bank-account UUID returned by list_banking_accounts.",
  "schema": {
    "type": "string",
    "format": "uuid"
  }
}
```

```json
{
  "name": "transactionId",
  "in": "path",
  "required": true,
  "description": "Opaque statement transaction ID returned for this exact bank, maximum 255 characters.",
  "schema": {
    "type": "string",
    "minLength": 1,
    "maxLength": 255
  }
}
```

### גוף הבקשה

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "commandId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedVersion": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "action": {
            "type": "string",
            "enum": [
              "LINK",
              "UNLINK",
              "VALIDATE",
              "UNVALIDATE"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "OPERATION",
              "PAIEMENT"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "amountMajor": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d*)(?:\\.\\d{1,2})?$"
          },
          "description": {
            "type": "string",
            "maxLength": 500
          }
        },
        "required": [
          "commandId",
          "expectedVersion",
          "action"
        ],
        "additionalProperties": false
      }
    }
  }
}
```

### תגובות

#### HTTP 200

```json
{
  "description": "Qualified local reconciliation observation or explicit command outcome.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationCommandResponse"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "INVALID_TARGET, INVALID_AMOUNT, INVALID_REQUEST or INVALID_RECONCILIATION_COMMAND; unknown query parameters or non-empty GET body.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 401

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

#### HTTP 403

```json
{
  "description": "INSUFFICIENT_SCOPE, disabled organisation or CAMPAIGN_RESTRICTED_KEY.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "NOT_FOUND or LINK_NOT_FOUND within the current organisation/account context.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "SEPA_BANK_SETTLEMENT_LOCKED, TREASURY_BANK_USE_PAYOUT, STALE_RECONCILIATION, ALREADY_LINKED, LINK_TARGET_UNAVAILABLE, INVALID_RECONCILIATION_HISTORY, AMBIGUOUS_TRANSACTION, RECONCILIATION_DATE_UNKNOWN, RECONCILIATION_AMOUNT_UNKNOWN, RECONCILIATION_CURRENCY_MISMATCH, RECONCILIATION_SOURCE_LIMIT, BUDGET_TRANSFER_NOT_BANK_MOVEMENT, INVALID_PAYMENT_MATCH, PAYMENT_NOT_COMPLETED, AUTO_OPERATION_STILL_LINKED, COMMAND_ID_REUSED, COMMAND_UNCERTAIN, COMMAND_HISTORY_LIMIT or INVALID_COMMAND_HISTORY. Do not retry a financial action or bypass the owning workflow.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 500

```json
{
  "description": "INTERNAL_ERROR with no private diagnostic. Preserve the command UUID after any uncertain write.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

### OpenAPI

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

## GET /banking/reconciliation-commands/{commandId}

Resolve a bank reconciliation command without replay

`get_bank_reconciliation_command`

Requires explicit banking:read plus budgets:read and paiements:read, all enforced separately; campaign-restricted keys are refused. Authorises the current local bank account and exact statement row in the organisation, then re-admits each related object in the same legal association. Bank, payment, operation and transaction IDs are distinct. amountMajor is in MAJOR currency units, never divide by 100. Stored pointage or a manual link is an accounting observation, not provider capture, payout composition or proof of settlement of a particular donation. No bank/provider request, sync, new payment, debit or refund occurs. No reusable credential, provider account/payout reference or raw snapshot is returned. A VIREMENT link is masked and managed by STRIPE_TREASURY; SEPA claim/allocation is managed by SEPA_XML. Unknown arguments and non-empty GET bodies are rejected. Shared authentication may record key usage. Additionally requires banking:reconcile and budgets:write for parity with the original command, all verified explicitly. This operation is READ ONLY and accepts no query/body. It checks only the original current-principal journal and applied statement marker, plus an auto-operation deletion marker when required. REJECTED is a known CAS refusal; missing proof remains COMMAND_UNCERTAIN. It never executes the command again or finishes cleanup.

### אימות

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

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

```json
{
  "accepted": "banking:reconcile",
  "additional": [
    "banking:read",
    "budgets:read",
    "paiements:read",
    "budgets:write"
  ]
}
```

### פרמטרים

```json
{
  "name": "commandId",
  "in": "path",
  "required": true,
  "description": "Original command UUID scoped to the current API principal.",
  "schema": {
    "type": "string",
    "format": "uuid"
  }
}
```

### תגובות

#### HTTP 200

```json
{
  "description": "Qualified local reconciliation observation or explicit command outcome.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationCommandResponse"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "INVALID_TARGET, INVALID_AMOUNT, INVALID_REQUEST or INVALID_RECONCILIATION_COMMAND; unknown query parameters or non-empty GET body.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 401

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

#### HTTP 403

```json
{
  "description": "INSUFFICIENT_SCOPE, disabled organisation or CAMPAIGN_RESTRICTED_KEY.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "NOT_FOUND or LINK_NOT_FOUND within the current organisation/account context.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 409

```json
{
  "description": "SEPA_BANK_SETTLEMENT_LOCKED, TREASURY_BANK_USE_PAYOUT, STALE_RECONCILIATION, ALREADY_LINKED, LINK_TARGET_UNAVAILABLE, INVALID_RECONCILIATION_HISTORY, AMBIGUOUS_TRANSACTION, RECONCILIATION_DATE_UNKNOWN, RECONCILIATION_AMOUNT_UNKNOWN, RECONCILIATION_CURRENCY_MISMATCH, RECONCILIATION_SOURCE_LIMIT, BUDGET_TRANSFER_NOT_BANK_MOVEMENT, INVALID_PAYMENT_MATCH, PAYMENT_NOT_COMPLETED, AUTO_OPERATION_STILL_LINKED, COMMAND_ID_REUSED, COMMAND_UNCERTAIN, COMMAND_HISTORY_LIMIT or INVALID_COMMAND_HISTORY. Do not retry a financial action or bypass the owning workflow.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 500

```json
{
  "description": "INTERNAL_ERROR with no private diagnostic. Preserve the command UUID after any uncertain write.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

### OpenAPI

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

## סכמות

```json
{
  "components": {
    "schemas": {
      "BankReconciliationResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success",
          "data"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/BankReconciliation"
          }
        }
      },
      "BankReconciliation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "bankId",
          "transactionId",
          "assoc",
          "amountMajor",
          "currency",
          "pointed",
          "version",
          "links",
          "managedBy"
        ],
        "properties": {
          "bankId": {
            "type": "string",
            "format": "uuid"
          },
          "transactionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "assoc": {
            "type": "string"
          },
          "amountMajor": {
            "type": "string",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "pointed": {
            "type": "boolean",
            "nullable": true
          },
          "version": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "links": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "type",
                "id",
                "amountMajor",
                "label",
                "managed"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "OPERATION",
                    "PAIEMENT",
                    "VIREMENT"
                  ]
                },
                "id": {
                  "type": "string",
                  "nullable": true
                },
                "amountMajor": {
                  "type": "string",
                  "nullable": true
                },
                "label": {
                  "type": "string",
                  "nullable": true
                },
                "managed": {
                  "type": "boolean"
                }
              }
            }
          },
          "managedBy": {
            "type": "string",
            "nullable": true,
            "enum": [
              "SEPA_XML",
              "STRIPE_TREASURY",
              null
            ]
          }
        }
      },
      "BankReconciliationError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success",
          "error"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "error": {
            "type": "string"
          }
        }
      },
      "BankReconciliationSuggestionResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success",
          "data",
          "context",
          "coverage"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "type",
                "label",
                "amountMajor",
                "currency",
                "date",
                "score",
                "reasons"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "OPERATION",
                    "PAIEMENT"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "amountMajor": {
                  "type": "string"
                },
                "currency": {
                  "type": "string"
                },
                "date": {
                  "type": "string",
                  "format": "date-time"
                },
                "score": {
                  "type": "number"
                },
                "reasons": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "SAME_AMOUNT",
                      "CLOSE_AMOUNT",
                      "SAME_DAY",
                      "NEAR_DATE",
                      "LABEL_MATCH"
                    ]
                  }
                }
              }
            }
          },
          "context": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "bankId",
              "transactionId",
              "version"
            ],
            "properties": {
              "bankId": {
                "type": "string",
                "format": "uuid"
              },
              "transactionId": {
                "type": "string"
              },
              "version": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            }
          },
          "coverage": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "complete",
              "truncated",
              "omitted",
              "automatic"
            ],
            "properties": {
              "complete": {
                "type": "boolean",
                "enum": [
                  false
                ]
              },
              "truncated": {
                "type": "boolean"
              },
              "omitted": {
                "type": "integer",
                "minimum": 0
              },
              "automatic": {
                "type": "boolean",
                "enum": [
                  false
                ]
              }
            }
          }
        }
      },
      "BankReconciliationCommandResponse": {
        "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",
              "PARTIAL",
              "REJECTED"
            ]
          },
          "replayed": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "bankId",
              "transactionId",
              "action",
              "cleanup"
            ],
            "properties": {
              "bankId": {
                "type": "string",
                "format": "uuid"
              },
              "transactionId": {
                "type": "string"
              },
              "action": {
                "type": "string",
                "enum": [
                  "LINK",
                  "UNLINK",
                  "VALIDATE",
                  "UNVALIDATE"
                ]
              },
              "cleanup": {
                "type": "string",
                "enum": [
                  "NOT_REQUIRED",
                  "DELETED",
                  "REVIEW"
                ]
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key",
        "description": "Format: `ke_live_xxx`"
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  }
}
```
