**Versions de l’API** · **V2 (Latest)** · [V1](/integrations/v1/docs?lang=fr)

# Bank reconciliation

OpenAPI 3.0.3 · API 2.0.0

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

## Opérations

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

Lire les liens enregistrés du relevé et leur version

`get_bank_reconciliation`

Exige explicitement banking:read, budgets:read et paiements:read, vérifiés séparément ; les clés limitées à des collectes sont refusées. Autorise le compte bancaire local actuel et sa ligne exacte dans l’organisation puis réadmet chaque objet lié dans la même association légale. Les IDs de banque, paiement, opération et transaction sont distincts. amountMajor est en unités MAJEURES, ne jamais diviser par 100. Pointage enregistré et lien manuel sont des observations comptables, pas une capture prestataire, une composition de virement ni une preuve de règlement d’un don précis. Aucun appel banque/prestataire, synchronisation, nouveau paiement, débit ou remboursement. Aucun secret réutilisable, référence de compte/virement prestataire ni snapshot brut n’est renvoyé. Un lien VIREMENT est masqué et porté par STRIPE_TREASURY ; un claim/allocation SEPA dépend de SEPA_XML. Arguments inconnus et corps GET non vides sont refusés. L’authentification partagée peut enregistrer l’usage de la clé. Chaque cible manuelle doit rester disponible dans l’organisation/association actuelle ; une référence périmée ou étrangère donne LINK_TARGET_UNAVAILABLE sans exposer la cible. Montant/devise/pointage historiques inconnus restent null. IDs/libellés/montants VIREMENT restent masqués. Cette lecture n’applique ni ne valide rien.

### Authentification

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

### Permissions requises

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

### Paramètres

```json
{
  "name": "bankId",
  "in": "path",
  "required": true,
  "description": "UUID local de compte bancaire renvoyé par list_banking_accounts.",
  "schema": {
    "type": "string",
    "format": "uuid"
  }
}
```

```json
{
  "name": "transactionId",
  "in": "path",
  "required": true,
  "description": "ID opaque de transaction de relevé renvoyé pour ce compte exact, 255 caractères maximum.",
  "schema": {
    "type": "string",
    "minLength": 1,
    "maxLength": 255
  }
}
```

### Réponses

#### HTTP 200

```json
{
  "description": "Observation locale qualifiée de rapprochement ou résultat de commande explicite.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationResponse"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "INVALID_TARGET, INVALID_AMOUNT, INVALID_REQUEST ou INVALID_RECONCILIATION_COMMAND ; paramètres inconnus ou corps GET non vide.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 401

```json
{
  "description": "Authentification absente ou invalide.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 403

```json
{
  "description": "INSUFFICIENT_SCOPE, organisation désactivée ou CAMPAIGN_RESTRICTED_KEY.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "NOT_FOUND ou LINK_NOT_FOUND dans le contexte actuel organisation/compte.",
  "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 ou INVALID_COMMAND_HISTORY. Ne pas rejouer une action financière ni contourner le parcours propriétaire.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 500

```json
{
  "description": "INTERNAL_ERROR sans diagnostic privé. Conserver l’UUID de commande après toute écriture incertaine.",
  "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

Proposer des écritures pour examen bancaire explicite

`suggest_bank_reconciliation`

Exige explicitement banking:read, budgets:read et paiements:read, vérifiés séparément ; les clés limitées à des collectes sont refusées. Autorise le compte bancaire local actuel et sa ligne exacte dans l’organisation puis réadmet chaque objet lié dans la même association légale. Les IDs de banque, paiement, opération et transaction sont distincts. amountMajor est en unités MAJEURES, ne jamais diviser par 100. Pointage enregistré et lien manuel sont des observations comptables, pas une capture prestataire, une composition de virement ni une preuve de règlement d’un don précis. Aucun appel banque/prestataire, synchronisation, nouveau paiement, débit ou remboursement. Aucun secret réutilisable, référence de compte/virement prestataire ni snapshot brut n’est renvoyé. Un lien VIREMENT est masqué et porté par STRIPE_TREASURY ; un claim/allocation SEPA dépend de SEPA_XML. Arguments inconnus et corps GET non vides sont refusés. L’authentification partagée peut enregistrer l’usage de la clé. Lit les candidats puis utilise le rankCandidates déterministe natif : fenêtre de 12 jours, score minimal 45, au plus cinq résultats motivés. Les crédits recherchent recettes et paiements complétés ; les débits recherchent dépenses. Transferts analytiques, autres devises/associations, écritures déjà liées et paiements Stripe sont exclus. Une suggestion de paiement utilise les unités /100 vérifiées uniquement pour eur/usd/gbp/ils/cad/aud/chf et exige des frais explicitement nuls, sans conversion effective ni finalAmount contradictoire ; frais/net inconnus ne deviennent jamais zéro. L’absence de date de valeur/comptabilisation ou montant valide donne un préalable manquant, jamais aujourd’hui ou zéro. Au plus 400 candidats par type et 5000 lignes de relevé sont inspectés ; truncated/omitted qualifient la couverture partielle. Une suggestion et un score n’appliquent aucun lien et ne prouvent aucune réception. Aucun rafraîchissement, changement de pointage ni écriture automatique.

### Authentification

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

### Permissions requises

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

### Paramètres

```json
{
  "name": "bankId",
  "in": "path",
  "required": true,
  "description": "UUID local de compte bancaire renvoyé par list_banking_accounts.",
  "schema": {
    "type": "string",
    "format": "uuid"
  }
}
```

```json
{
  "name": "transactionId",
  "in": "path",
  "required": true,
  "description": "ID opaque de transaction de relevé renvoyé pour ce compte exact, 255 caractères maximum.",
  "schema": {
    "type": "string",
    "minLength": 1,
    "maxLength": 255
  }
}
```

### Réponses

#### HTTP 200

```json
{
  "description": "Observation locale qualifiée de rapprochement ou résultat de commande explicite.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationSuggestionResponse"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "INVALID_TARGET, INVALID_AMOUNT, INVALID_REQUEST ou INVALID_RECONCILIATION_COMMAND ; paramètres inconnus ou corps GET non vide.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 401

```json
{
  "description": "Authentification absente ou invalide.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 403

```json
{
  "description": "INSUFFICIENT_SCOPE, organisation désactivée ou CAMPAIGN_RESTRICTED_KEY.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "NOT_FOUND ou LINK_NOT_FOUND dans le contexte actuel organisation/compte.",
  "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 ou INVALID_COMMAND_HISTORY. Ne pas rejouer une action financière ni contourner le parcours propriétaire.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 500

```json
{
  "description": "INTERNAL_ERROR sans diagnostic privé. Conserver l’UUID de commande après toute écriture incertaine.",
  "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

Lier, retirer un lien ou pointer après examen explicite

`command_bank_reconciliation`

Exige explicitement banking:read, budgets:read et paiements:read, vérifiés séparément ; les clés limitées à des collectes sont refusées. Autorise le compte bancaire local actuel et sa ligne exacte dans l’organisation puis réadmet chaque objet lié dans la même association légale. Les IDs de banque, paiement, opération et transaction sont distincts. amountMajor est en unités MAJEURES, ne jamais diviser par 100. Pointage enregistré et lien manuel sont des observations comptables, pas une capture prestataire, une composition de virement ni une preuve de règlement d’un don précis. Aucun appel banque/prestataire, synchronisation, nouveau paiement, débit ou remboursement. Aucun secret réutilisable, référence de compte/virement prestataire ni snapshot brut n’est renvoyé. Un lien VIREMENT est masqué et porté par STRIPE_TREASURY ; un claim/allocation SEPA dépend de SEPA_XML. Arguments inconnus et corps GET non vides sont refusés. L’authentification partagée peut enregistrer l’usage de la clé. Exige aussi banking:reconcile et budgets:write, attribués et vérifiés explicitement ; budgets:write est nécessaire car retirer une opération automatique réalise sa suppression logique native. LINK exige type OPERATION/PAIEMENT, id et amountMajor positif à deux décimales maximum ; description est facultative, 500 caractères maximum. UNLINK exige uniquement type/id. VALIDATE/UNVALIDATE n’acceptent aucun de ces champs et ne changent que le pointage. LINK écrit les champs natifs id/type/montant/description ; le montant est l’affectation explicite de l’utilisateur, pas un net ou règlement déduit. Aucune formule bancaire nouvelle ne le plafonne ou l’équilibre automatiquement. Les paiements complétés non-Stripe peuvent être annotés manuellement ; les paiements Stripe et liens VIREMENT exigent le propriétaire Treasury. Les transferts entre budgets ne sont pas bancaires. Les claims/allocations SEPA et tout VIREMENT bloquent ces écritures génériques. expectedVersion est la version actuelle ; le CAS compare montant/devise/dates/liens/pointage/gardes SEPA et historique de commande, y compris les modifications internes. Un journal durable et un marqueur du relevé empêchent la répétition d’effet pour le même organisation/principal/commandId. Réutiliser commandId uniquement pour l’action identique ; COMMAND_UNCERTAIN n’autorise ni nouvel ID ni réessai d’écriture automatique. Lire get_bank_reconciliation_command. UNLINK conserve le comportement natif : l’opération auto liée est supprimée logiquement après le CAS du relevé ; une auto-opération partagée est refusée. Ce sont deux documents, pas une transaction atomique : APPLIED avec cleanup DELETED prouve les deux écritures ; PARTIAL avec cleanup REVIEW signifie lien retiré et suppression non résolue. Ne pas relier, recréer, supprimer ni rejouer automatiquement pour compenser. Le reçu décrit l’action appliquée de cette commande, pas l’état actuel. Les claims exigent acknowledged:true et insertedId exact ; les effets, CAS et finalisations forcent majority+j:true et un acquittement positif du pilote. Un acquittement perdu, absent ou false donne COMMAND_UNCERTAIN ; seule une lecture ultérieure peut résoudre le marqueur durable, sans répéter un effet.

### Authentification

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

### Permissions requises

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

### Paramètres

```json
{
  "name": "bankId",
  "in": "path",
  "required": true,
  "description": "UUID local de compte bancaire renvoyé par list_banking_accounts.",
  "schema": {
    "type": "string",
    "format": "uuid"
  }
}
```

```json
{
  "name": "transactionId",
  "in": "path",
  "required": true,
  "description": "ID opaque de transaction de relevé renvoyé pour ce compte exact, 255 caractères maximum.",
  "schema": {
    "type": "string",
    "minLength": 1,
    "maxLength": 255
  }
}
```

### Corps de la requête

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

### Réponses

#### HTTP 200

```json
{
  "description": "Observation locale qualifiée de rapprochement ou résultat de commande explicite.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationCommandResponse"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "INVALID_TARGET, INVALID_AMOUNT, INVALID_REQUEST ou INVALID_RECONCILIATION_COMMAND ; paramètres inconnus ou corps GET non vide.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 401

```json
{
  "description": "Authentification absente ou invalide.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 403

```json
{
  "description": "INSUFFICIENT_SCOPE, organisation désactivée ou CAMPAIGN_RESTRICTED_KEY.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "NOT_FOUND ou LINK_NOT_FOUND dans le contexte actuel organisation/compte.",
  "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 ou INVALID_COMMAND_HISTORY. Ne pas rejouer une action financière ni contourner le parcours propriétaire.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 500

```json
{
  "description": "INTERNAL_ERROR sans diagnostic privé. Conserver l’UUID de commande après toute écriture incertaine.",
  "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}

Résoudre une commande de rapprochement sans rejeu

`get_bank_reconciliation_command`

Exige explicitement banking:read, budgets:read et paiements:read, vérifiés séparément ; les clés limitées à des collectes sont refusées. Autorise le compte bancaire local actuel et sa ligne exacte dans l’organisation puis réadmet chaque objet lié dans la même association légale. Les IDs de banque, paiement, opération et transaction sont distincts. amountMajor est en unités MAJEURES, ne jamais diviser par 100. Pointage enregistré et lien manuel sont des observations comptables, pas une capture prestataire, une composition de virement ni une preuve de règlement d’un don précis. Aucun appel banque/prestataire, synchronisation, nouveau paiement, débit ou remboursement. Aucun secret réutilisable, référence de compte/virement prestataire ni snapshot brut n’est renvoyé. Un lien VIREMENT est masqué et porté par STRIPE_TREASURY ; un claim/allocation SEPA dépend de SEPA_XML. Arguments inconnus et corps GET non vides sont refusés. L’authentification partagée peut enregistrer l’usage de la clé. Exige aussi banking:reconcile et budgets:write pour parité avec la commande initiale, vérifiés explicitement. Cette opération est en LECTURE SEULE, sans query/body. Elle vérifie uniquement le journal du principal initial et le marqueur appliqué du relevé, ainsi que le marqueur de suppression de l’auto-opération si nécessaire. REJECTED est un refus CAS connu ; l’absence de preuve reste COMMAND_UNCERTAIN. Elle n’exécute jamais la commande une seconde fois et ne termine aucune suppression.

### Authentification

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

### Permissions requises

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

### Paramètres

```json
{
  "name": "commandId",
  "in": "path",
  "required": true,
  "description": "UUID de commande initial propre au principal API actuel.",
  "schema": {
    "type": "string",
    "format": "uuid"
  }
}
```

### Réponses

#### HTTP 200

```json
{
  "description": "Observation locale qualifiée de rapprochement ou résultat de commande explicite.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationCommandResponse"
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "INVALID_TARGET, INVALID_AMOUNT, INVALID_REQUEST ou INVALID_RECONCILIATION_COMMAND ; paramètres inconnus ou corps GET non vide.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 401

```json
{
  "description": "Authentification absente ou invalide.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 403

```json
{
  "description": "INSUFFICIENT_SCOPE, organisation désactivée ou CAMPAIGN_RESTRICTED_KEY.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 404

```json
{
  "description": "NOT_FOUND ou LINK_NOT_FOUND dans le contexte actuel organisation/compte.",
  "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 ou INVALID_COMMAND_HISTORY. Ne pas rejouer une action financière ni contourner le parcours propriétaire.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/BankReconciliationError"
      }
    }
  }
}
```

#### HTTP 500

```json
{
  "description": "INTERNAL_ERROR sans diagnostic privé. Conserver l’UUID de commande après toute écriture incertaine.",
  "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
  }
}
```

## Schémas

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