{
  "openapi": "3.1.0",
  "info": {
    "title": "ledger-net",
    "version": "1.0.0",
    "description": "Implemented ledger operations. Transaction timestamps support microsecond precision; non-zero excess fractional precision is rejected. Account history and visible journal lookup bind pages to a fixed matching journal prefix. Account directory is a live keyset listing."
  },
  "servers": [
    {
      "url": "/api/v1"
    }
  ],
  "security": [
    {
      "LedgerPrincipal": []
    },
    {
      "EntraUser": ["api://a668d2ba-4c9c-4657-b014-f6ccaaf0bc47/ledger.test"]
    }
  ],
  "paths": {
    "/access/me": { "get": { "operationId": "getCurrentAccess", "description": "Returns the current verified principal and server-side grant version with its scoped grants. Does not return bearer tokens or credentials.", "responses": { "200": { "description": "Current ledger authority", "content": { "application/json": { "schema": { "type": "object", "required": ["subjectId", "legalEntityId", "kind", "grantVersion", "grants"], "properties": { "subjectId": { "$ref": "#/components/schemas/Identifier" }, "legalEntityId": { "$ref": "#/components/schemas/Identifier" }, "kind": { "type": "string", "enum": ["CUSTOMER", "WORKLOAD", "OPERATOR"] }, "customerId": { "$ref": "#/components/schemas/Identifier" }, "grantVersion": { "type": "integer", "format": "int64", "minimum": 1 }, "grants": { "type": "array", "items": { "type": "object", "required": ["operation", "scopeKind", "scopeId"], "properties": { "operation": { "type": "string" }, "scopeKind": { "type": "string", "enum": ["ENTITY", "CUSTOMER", "ACCOUNT"] }, "scopeId": { "$ref": "#/components/schemas/Identifier" } } } } } } } } }, "401": { "description": "Authentication required" } } } },
    "/test-users": { "get": { "operationId": "listTestUsersAndRoles", "description": "Current Entra OPERATOR with entity operator.admin. Lists the three fixed roles, current members and append-only access changes.", "responses": { "200": { "description": "TEST access administration view", "content": { "application/json": { "schema": { "type": "object" } } } }, "403": { "$ref": "#/components/responses/Forbidden" } } } },
    "/test-users/assignments": { "post": { "operationId": "assignTestUserRole", "description": "Current administrator assigns OPERATOR or APPROVER, or revokes another Entra subject in the same tenant. ADMINISTRATOR and self-assignment are excluded. Current version and idempotency key are required.", "parameters": [{ "name": "Idempotency-Key", "in": "header", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["targetSubject", "expectedVersion", "role", "reasonCode"], "properties": { "targetSubject": { "$ref": "#/components/schemas/Identifier" }, "expectedVersion": { "type": "integer", "format": "int64", "minimum": 0 }, "role": { "type": "string", "enum": ["OPERATOR", "APPROVER", "REVOKED"] }, "reasonCode": { "$ref": "#/components/schemas/Identifier" } } } } } }, "responses": { "201": { "description": "Durable access transition" }, "403": { "$ref": "#/components/responses/Forbidden" }, "409": { "$ref": "#/components/responses/Conflict" } } } },
    "/gui-sensitive-actions": { "post": { "operationId": "createGuiSensitiveAction", "description": "Current OPERATOR with account.close or operator.correct and account.correct. Freezes a typed close or interest correction under a deterministic action and approval identity.", "parameters": [{ "name": "Idempotency-Key", "in": "header", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["kind", "reasonCode"], "properties": { "kind": { "type": "string", "enum": ["CLOSE_ACCOUNT", "CORRECT_INTEREST"] }, "accountId": { "$ref": "#/components/schemas/Identifier" }, "expectedVersion": { "type": "integer", "format": "int64" }, "effectiveDate": { "type": "string", "format": "date" }, "terminalFenceVersion": { "type": "integer", "format": "int64" }, "recognitionId": { "$ref": "#/components/schemas/Identifier" }, "replacementNumerator": { "type": "string" }, "replacementDenominator": { "type": "string" }, "replacementSourceReference": { "$ref": "#/components/schemas/Identifier" }, "reasonCode": { "$ref": "#/components/schemas/Identifier" } } } } } }, "responses": { "201": { "description": "Frozen pending action" }, "403": { "$ref": "#/components/responses/Forbidden" }, "409": { "$ref": "#/components/responses/Conflict" } } }, "get": { "operationId": "listGuiSensitiveActions", "description": "At most fifty own or approver-visible actions under current account.read scope.", "responses": { "200": { "description": "Visible actions", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object" } } } } } } } },
    "/gui-sensitive-actions/{id}": { "get": { "operationId": "getGuiSensitiveAction", "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "responses": { "200": { "description": "Frozen input, status and attempts" }, "404": { "$ref": "#/components/responses/NotFound" } } } },
    "/gui-sensitive-actions/{id}/approve": { "post": { "operationId": "approveGuiSensitiveAction", "description": "A distinct current OPERATOR with entity operator.approve and account.read confirms the frozen digest. Approval queues separate worker execution and exact retry returns the same evidence.", "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }, { "name": "Idempotency-Key", "in": "header", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "responses": { "200": { "description": "Independent approval reference" }, "403": { "$ref": "#/components/responses/Forbidden" }, "409": { "$ref": "#/components/responses/Conflict" } } } },
    "/accounts/{accountId}/interest-timeline": { "get": { "operationId": "listAccountInterestTimeline", "description": "Current account.read for the whole account. Immutable daily calculations, monthly recognition, capitalization, correction and terminal settlement remain distinct; exact numerator, residual, øre, journal and source IDs are returned in a fifty-item scope-bound keyset page.", "parameters": [{ "name": "accountId", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }, { "name": "pageToken", "in": "query", "schema": { "type": "string", "maxLength": 2048 } }], "responses": { "200": { "description": "Account interest evidence", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiInterestPage" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "403": { "$ref": "#/components/responses/Forbidden" } } } },
    "/operations/overview": { "get": { "operationId": "getOperationsOverview", "description": "Verified TEST operator with current entity operator.read. Database counts and latest source timestamps, observed at response time; zero means no registered facts, not process health.", "responses": { "200": { "description": "Entity operations coverage and worklist counts", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiOperationsOverview" } } } }, "403": { "$ref": "#/components/responses/Forbidden" } } } },
    "/operations/periods": { "get": { "operationId": "listOperationsPeriods", "description": "Verified TEST operator with current entity operator.read. Accounting days and product closes remain separate source states in a fifty-item scope-bound keyset page.", "parameters": [{ "name": "pageToken", "in": "query", "schema": { "type": "string", "maxLength": 2048 } }], "responses": { "200": { "description": "Period facts", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiPeriodPage" } } } }, "403": { "$ref": "#/components/responses/Forbidden" } } } },
    "/operations/product-closes/{runId}": { "get": { "operationId": "getOperationsProductClose", "description": "Verified TEST operator with current entity operator.read. Existing source-valid progress and bounded frozen account members plus all frozen daily close IDs and journal watermarks.", "parameters": [{ "name": "runId", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "responses": { "200": { "description": "Product close source detail", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiProductCloseDetail" } } } }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" } } } },
    "/operations/reconciliation": { "get": { "operationId": "listOperationsReconciliation", "description": "Verified TEST operator with current entity operator.read. Saved control name, watermark, status, checked count and open findings are separate fields.", "parameters": [{ "name": "pageToken", "in": "query", "schema": { "type": "string", "maxLength": 2048 } }], "responses": { "200": { "description": "Reconciliation runs", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiReconciliationPage" } } } }, "403": { "$ref": "#/components/responses/Forbidden" } } } },
    "/operations/exceptions": { "get": { "operationId": "listOperationsExceptions", "description": "Verified TEST operator with current entity operator.read. Open stored findings only; no repair command.", "parameters": [{ "name": "pageToken", "in": "query", "schema": { "type": "string", "maxLength": 2048 } }], "responses": { "200": { "description": "Open reconciliation findings", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiExceptionPage" } } } }, "403": { "$ref": "#/components/responses/Forbidden" } } } },
    "/operations/gl": { "get": { "operationId": "listOperationsGlExports", "description": "Verified TEST operator with current entity operator.read. Sealed GL export totals and independent latest transport, validation and posting receipt outcomes.", "parameters": [{ "name": "pageToken", "in": "query", "schema": { "type": "string", "maxLength": 2048 } }], "responses": { "200": { "description": "GL export evidence", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiGlPage" } } } }, "403": { "$ref": "#/components/responses/Forbidden" } } } },
    "/operations/gl/{exportId}": { "get": { "operationId": "getOperationsGlExport", "description": "Verified TEST operator with current entity operator.read. Source-validated export page and its matching dispatch, if any, with all attempts and separate receipts.", "parameters": [{ "name": "exportId", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }, { "name": "pageToken", "in": "query", "schema": { "type": "string", "maxLength": 2048 } }], "responses": { "200": { "description": "GL export, source and receiver evidence", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiGlDetail" } } } }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" } } } },
    "/gui-operator-actions": {
      "post": { "operationId": "createGuiOperatorAction", "description": "Current OPERATOR, entity file.export or payment.settle and all sender account.debit grants. Freezes a batch or accepted-member settlement under the initiator and current grant version; a separate workload executes it.", "parameters": [{ "name": "Idempotency-Key", "in": "header", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateGuiOperatorActionRequest" } } } }, "responses": { "201": { "description": "Queued or existing durable action", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiOperatorActionView" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "403": { "$ref": "#/components/responses/Forbidden" }, "409": { "$ref": "#/components/responses/Conflict" } } },
      "get": { "operationId": "listOwnGuiOperatorActions", "description": "At most twenty own actions visible under current kind-specific and sender account.debit grants.", "responses": { "200": { "description": "Recent actions", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/GuiOperatorActionView" } } } } } } }
    },
    "/gui-operator-actions/by-client-key/{key}": { "get": { "operationId": "findOwnGuiOperatorAction", "parameters": [{ "name": "key", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "responses": { "200": { "description": "Durable result and attempts", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiOperatorActionView" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } },
    "/gui-operator-actions/{id}": { "get": { "operationId": "getOwnGuiOperatorAction", "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "responses": { "200": { "description": "Durable result and attempts", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiOperatorActionView" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } },
    "/gui-batches/{batchId}": { "get": { "operationId": "getGuiBatchSource", "description": "file.simulate and all sender account.debit grants are required for the full immutable batch source.", "parameters": [{ "name": "batchId", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "responses": { "200": { "description": "Frozen batch source", "content": { "application/json": { "schema": { "type": "object" } } } }, "403": { "$ref": "#/components/responses/Forbidden" } } } },
    "/report-sources": { "get": { "operationId": "listVisibleReportSources", "description": "file.read and account.read scopes are applied before the fifty-item keyset page. Only sealed issued statements and stored reports appear.", "parameters": [{ "name": "accountId", "in": "query", "schema": { "$ref": "#/components/schemas/Identifier" } }, { "name": "pageToken", "in": "query", "schema": { "type": "string", "maxLength": 1024 } }], "responses": { "200": { "description": "Visible immutable report sources", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiReportSourcePage" } } } }, "403": { "$ref": "#/components/responses/Forbidden" } } } },
    "/file-exports/batches/{batchId}": { "post": { "operationId": "publishFrozenPainBatch", "description": "file.export, file.read and all sender account.debit grants. Publishes existing pain.001 bytes; repeat verifies identical bytes and digest, without sending or settling.", "parameters": [{ "name": "batchId", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "responses": { "200": { "description": "Immutable file record", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileArtifact" } } } }, "409": { "$ref": "#/components/responses/Conflict" } } } },
    "/file-exports/statements/{statementId}": { "post": { "operationId": "publishIssuedCamt053", "description": "file.export, file.read and account.read; uses every frozen page of an already issued statement, including PROVISIONAL or FINAL status.", "parameters": [{ "name": "statementId", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "responses": { "200": { "description": "Immutable camt.053 file", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileArtifact" } } } }, "409": { "$ref": "#/components/responses/Conflict" } } } },
    "/file-exports/reports/{reportId}": { "post": { "operationId": "publishStoredCamtReport", "description": "file.export, file.read and account.read; INTRADAY yields camt.052 and NOTIFICATION yields camt.054 from a sealed source.", "parameters": [{ "name": "reportId", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "responses": { "200": { "description": "Immutable report file", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileArtifact" } } } }, "409": { "$ref": "#/components/responses/Conflict" } } } },
    "/file-simulations/batches/{batchId}/status": { "post": { "operationId": "publishSyntheticBatchStatus", "description": "file.simulate, file.read and all sender account.debit grants. Explicit bounded decisions create a separate immutable synthetic pain.002 outbox file; no import or settlement occurs.", "parameters": [{ "name": "batchId", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimulateBatchStatusRequest" } } } }, "responses": { "200": { "description": "Synthetic status file", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileArtifact" } } } }, "409": { "$ref": "#/components/responses/Conflict" } } } },
    "/file-imports/from-simulation/{fileId}": { "post": { "operationId": "uploadSyntheticStatusForImport", "description": "file.upload, file.simulate, file.read and all sender account.debit grants. Copies verified generated bytes to a separate immutable import job; confirmation is still required.", "parameters": [{ "name": "fileId", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }, { "name": "batchId", "in": "query", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }, { "name": "Idempotency-Key", "in": "header", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "responses": { "201": { "description": "Previewable import job", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileImportJob" } } } }, "409": { "$ref": "#/components/responses/Conflict" } } } },
    "/file-exports/settlements/{actionId}": { "post": { "operationId": "publishAppliedSyntheticSettlement", "description": "Only after an own completed settlement action and accepted import; file.export, payment.settle, file.read and sender account.debit are rechecked.", "parameters": [{ "name": "actionId", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "responses": { "200": { "description": "Immutable settlement JSON file", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileArtifact" } } } }, "409": { "$ref": "#/components/responses/Conflict" } } } },
    "/file-imports": {
      "get": {
        "operationId": "listOwnFileImports",
        "description": "Current entity file.upload grant lists the initiator's recent immutable uploads and durable outcomes.",
        "responses": { "200": { "description": "Recent uploads", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/FileImportJob" } } } } }, "401": { "description": "Authentication required" }, "403": { "$ref": "#/components/responses/Forbidden" } }
      },
      "post": {
        "operationId": "uploadBatchStatus",
        "description": "Current entity file.upload grant. Stores one to 262144 immutable pain.002 XML bytes without economic effect; an Idempotency-Key binds exact retry. X-Original-Filename is display data only.",
        "parameters": [
          { "name": "batchId", "in": "query", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } },
          { "name": "Idempotency-Key", "in": "header", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } },
          { "name": "X-Original-Filename", "in": "header", "required": true, "description": "Percent-encoded UTF-8 display filename; no filesystem path is accepted.", "schema": { "type": "string", "maxLength": 3072 } }
        ],
        "requestBody": { "required": true, "content": { "application/xml": { "schema": { "type": "string", "format": "binary", "minLength": 1, "maxLength": 262144 } } } },
        "responses": { "201": { "description": "Quarantined and validated upload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileImportJob" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "description": "Authentication required" }, "403": { "$ref": "#/components/responses/Forbidden" }, "409": { "$ref": "#/components/responses/Conflict" }, "413": { "description": "Report too large" }, "415": { "description": "Unsupported media type" } }
      }
    },
    "/file-imports/by-upload-key/{key}": {
      "get": { "operationId": "findOwnFileUpload", "description": "Resolve an uncertain upload result using the same initiator and idempotency key.", "parameters": [{ "name": "key", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "responses": { "200": { "description": "Stored upload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileImportJob" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }
    },
    "/file-imports/{id}": {
      "get": { "operationId": "getFileImport", "description": "Current entity file.upload grant reads validation, member preview, durable result and attempt history.", "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "responses": { "200": { "description": "Import job", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileImportJob" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }
    },
    "/file-imports/{id}/confirm": {
      "post": { "operationId": "confirmFileImport", "description": "Current entity file.import grant and original initiator, bound to the exact SHA-256 and grant version. Queues a durable operator job; repeat returns the same job.", "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["sha256"], "properties": { "sha256": { "type": "string", "pattern": "^[0-9A-Fa-f]{64}$" } } } } } }, "responses": { "200": { "description": "Queued or existing import job", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileImportJob" } } } }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" } } }
    },
    "/files": {
      "get": {
        "operationId": "listMailboxFiles",
        "description": "Entity-scoped file.read lists the immutable hosted mailbox index after verifying bounded files against their digests. Mailbox presence does not mean validated, imported or settled.",
        "parameters": [
          { "name": "direction", "in": "query", "schema": { "type": "string", "enum": ["IN", "OUT"] } },
          { "name": "profile", "in": "query", "schema": { "type": "string", "maxLength": 64 } },
          { "name": "referencePrefix", "in": "query", "schema": { "type": "string", "maxLength": 128 } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } },
          { "name": "pageToken", "in": "query", "schema": { "type": "string", "maxLength": 2048 } }
        ],
        "responses": {
          "200": { "description": "Registered mailbox files", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileArtifactPage" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "description": "Authentication required" },
          "403": { "$ref": "#/components/responses/Forbidden" }, "409": { "$ref": "#/components/responses/Conflict" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/files/{id}": {
      "get": {
        "operationId": "getMailboxFile",
        "description": "Entity-scoped file.read returns indexed metadata, bounded structured preview and verified source link. Missing or changed bytes are a conflict.",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }],
        "responses": {
          "200": { "description": "Mailbox file detail", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileArtifactDetail" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "description": "Authentication required" },
          "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" },
          "409": { "$ref": "#/components/responses/Conflict" }, "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/files/{id}/raw": {
      "get": {
        "operationId": "downloadMailboxFile",
        "description": "Requires both current entity-scoped file.read and file.download. Returns verified bytes as an attachment; no path is accepted from the client.",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }],
        "responses": {
          "200": { "description": "Verified raw XML or simulator JSON", "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "description": "Authentication required" },
          "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" },
          "409": { "$ref": "#/components/responses/Conflict" }, "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/accounts/{accountId}/loans/{loanId}/drawdown": {
      "post": {
        "operationId": "postWorkloadLoanDrawdown",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "A signed WORKLOAD with current loan.drawdown on the bound deposit posts the frozen NOK drawdown through the native loan service. Identical retries return the original receipt. Reuse of the operation key or economic source with different input conflicts.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "loanId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkloadLoanDrawdownRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Durable drawdown receipt",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkloadLoanDrawdownReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          }
        }
      },
      "get": {
        "operationId": "findWorkloadLoanDrawdown",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Exact read-only lookup using account, loan, provider and source event. Current loan.read is required. Missing and out-of-scope evidence return 404. After an uncertain response preserve the original workload identity, key and input and verify the exact replay receipt against this lookup.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "loanId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "providerId",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "eventId",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Original drawdown command and journal evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkloadLoanDrawdownReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/accounts/{accountId}/loans/{loanId}/drawdown/settlement": {
      "post": {
        "operationId": "postWorkloadLoanSettlementDrawdown",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Signed WORKLOAD with current ACCOUNT-scoped loan.drawdown.settlement. Debits loan principal and credits the registered NOK settlement payable in one journal, opens one position, and leaves the original deposit untouched. Exact retries return the original booking.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "loanId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "X-Correlation-ID",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkloadLoanSettlementDrawdownRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Original purchase loan booking and open position reference",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkloadLoanSettlementDrawdownReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          }
        }
      },
      "get": {
        "operationId": "findWorkloadLoanSettlementDrawdown",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Signed loan.read scoped to the original deposit or entity. Returns the exact booking and current settlement position by provider and event. Missing and out-of-scope evidence return 404.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "loanId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "providerId",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "eventId",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Original booking and exact open position",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkloadLoanSettlementDrawdownEvidence"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/accounts/{accountId}/loans/{loanId}/settlement-positions/{positionId}/settlements": {
      "post": {
        "operationId": "postPurchaseLoanSettlement",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Configured signed WORKLOAD with current ACCOUNT-scoped loan.settle, distinct from the original opening actor. Records one confirmed full NOK closure against the original payable and configured cash control.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "loanId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "positionId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "X-Correlation-ID",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseLoanSettlementRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Original opening, confirmed settlement journal and terminal position",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseLoanSettlementEvidence"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          }
        }
      }
    },
    "/accounts/{accountId}/loans/{loanId}/settlement-positions/{positionId}/settlements/{receiptId}": {
      "get": {
        "operationId": "findPurchaseLoanSettlement",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Signed loan.read scoped to the original deposit or entity. Finds the exact original settlement proof by position, profile and receipt.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "loanId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "positionId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "receiptId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Original opening, confirmed settlement journal and terminal position",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseLoanSettlementEvidence"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/accounts/{accountId}/loans/{loanId}/drawdown/journal": {
      "get": {
        "operationId": "findWorkloadLoanDrawdownJournal",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Finds the original loan drawdown journal projection using the bound account, loan, provider and event. Requires a signed WORKLOAD with current loan.read covering the original deposit. Returns the frozen economic facts, exact journal legs and original drawdown reference. Missing and out-of-scope evidence return 404.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "loanId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "providerId",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "eventId",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Original scoped loan posting and journal facts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoanPostingJournalEvidence"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/accounts/{accountId}/loans/{loanId}/repayment": {
      "post": {
        "operationId": "postWorkloadLoanRepayment",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "A signed WORKLOAD with current loan.repay on the bound deposit posts one NOK repayment through the native loan service. The sum of explicit principal and interest must equal the total. Retry with the same key and frozen input returns the durable receipt. Changed input under the same key or economic source conflicts.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "loanId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkloadLoanRepaymentRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Durable repayment receipt",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkloadLoanRepaymentReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      },
      "get": {
        "operationId": "findWorkloadLoanRepayment",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Exact read-only repayment lookup using account, loan, provider and source event. Requires current loan.read. Missing and out-of-scope evidence return 404. Returns the original command and journal and, if present, a separate linked correction journal.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "loanId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "providerId",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "eventId",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Original repayment posting and any linked correction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkloadLoanRepaymentEvidence"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/accounts/{accountId}/loans/{loanId}/repayment/journal": {
      "get": {
        "operationId": "findWorkloadLoanRepaymentJournal",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Finds the original loan repayment journal projection using the bound account, loan, provider and event. Requires a signed WORKLOAD with current loan.read covering the original deposit. Returns the frozen economic facts, exact journal legs and original drawdown reference. Missing and out-of-scope evidence return 404.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "loanId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "providerId",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "eventId",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Original scoped loan posting and journal facts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoanPostingJournalEvidence"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/accounts/{accountId}/payment-instructions": {
      "post": {
        "operationId": "receiveWorkloadPaymentInstruction",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "A signed workload with account.debit on the sender and account.credit on the receiver records one frozen NOK instruction. Receipt has no balance effect. Retry with the same workload, Idempotency-Key and input.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "responses": {
          "201": {
            "description": "Durable receive receipt",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkloadPaymentInstructionReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A verified WORKLOAD principal is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiveWorkloadPaymentInstructionRequest"
              }
            }
          }
        }
      }
    },
    "/accounts/{accountId}/payment-instructions/{instructionReference}": {
      "get": {
        "operationId": "findWorkloadPaymentInstruction",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Exact read by sender account and instruction reference. Requires account.read on both accounts. Missing and inaccessible instructions have the same response.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "instructionReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Original receive and terminal evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkloadPaymentInstructionEvidence"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A verified WORKLOAD principal is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/payment-instructions/{instructionReference}/execution": {
      "post": {
        "operationId": "executeWorkloadPaymentInstruction",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "A signed workload with account.debit on the sender and account.credit on the receiver executes the frozen instruction. The receipt reports the durable terminal disposition. Send no request body.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "instructionReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "responses": {
          "200": {
            "description": "Durable terminal command receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkloadPaymentInstructionReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A verified WORKLOAD principal is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/payment-instructions/{instructionReference}/cancellation": {
      "post": {
        "operationId": "cancelWorkloadPaymentInstruction",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "A signed workload with account.debit on the sender cancels an open instruction. A completed or rejected instruction cannot be canceled. Send no request body.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "instructionReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "responses": {
          "200": {
            "description": "Durable terminal command receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkloadPaymentInstructionReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A verified WORKLOAD principal is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/outbound-payment-instructions": {
      "post": {
        "operationId": "receiveWorkloadOutboundPayment",
        "security": [{ "LedgerPrincipal": [] }],
        "description": "A verified WORKLOAD with account.debit on the sender records a frozen NOK instruction. Receipt has no balance effect. Keep the same Idempotency-Key and input on retry. The key is scoped to the workload, operation and legal entity. The instruction reference is unique within the legal entity.",
        "parameters": [
          { "$ref": "#/components/parameters/AccountID" },
          { "$ref": "#/components/parameters/IdempotencyKey" },
          { "$ref": "#/components/parameters/CorrelationID" }
        ],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReceiveWorkloadOutboundPaymentRequest" } } }
        },
        "responses": {
          "201": {
            "description": "Existing or newly received instruction receipt",
            "headers": { "Location": { "$ref": "#/components/headers/Location" } },
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OutboundPaymentReceipt" } } }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "description": "A valid bearer token is required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "403": { "description": "A verified WORKLOAD principal is required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "404": { "$ref": "#/components/responses/NotFound" },
          "409": { "$ref": "#/components/responses/Conflict" },
          "415": { "$ref": "#/components/responses/UnsupportedMediaType" },
          "500": { "$ref": "#/components/responses/InternalError" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/accounts/{accountId}/outbound-payment-instructions/{instructionReference}": {
      "get": {
        "operationId": "findWorkloadOutboundBooking",
        "security": [{ "LedgerPrincipal": [] }],
        "description": "Exact, read-only booking lookup for a verified WORKLOAD with account.read on the sender. BOOKED links the original booking command and journal. BOOKING_REJECTED is a durable refusal with no journal. RECEIVED reports an unresolved booking at observation time, including when the original accounting date precedes the observed Oslo date. A missing or unresolved result calls for reconciliation of the original instruction.",
        "parameters": [
          { "$ref": "#/components/parameters/AccountID" },
          { "$ref": "#/components/parameters/OutboundInstructionReference" }
        ],
        "responses": {
          "200": {
            "description": "Original instruction and observed local booking outcome",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OutboundBookingLookup" } } }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "description": "A valid bearer token is required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "403": { "description": "A verified WORKLOAD principal is required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "404": { "$ref": "#/components/responses/NotFound" },
          "500": { "$ref": "#/components/responses/InternalError" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/accounts/{accountId}/outbound-payment-instructions/{instructionReference}/booking": {
      "post": {
        "operationId": "bookWorkloadOutboundPayment",
        "security": [{ "LedgerPrincipal": [] }],
        "description": "A verified WORKLOAD with account.debit on the sender books the frozen instruction against outbound clearing and creates one synthetic dispatch intent. Send an empty body and a stable booking Idempotency-Key. Identical retries replay the prior local result. A response loss can be reconciled by exact instruction reference. An unbooked prior-Oslo-date instruction can fail initial admission with 400 and remain RECEIVED. This operation neither sends the dispatch nor records external acceptance or settlement.",
        "parameters": [
          { "$ref": "#/components/parameters/AccountID" },
          { "$ref": "#/components/parameters/OutboundInstructionReference" },
          { "$ref": "#/components/parameters/IdempotencyKey" },
          { "$ref": "#/components/parameters/CorrelationID" }
        ],
        "responses": {
          "200": {
            "description": "Durable BOOKED or BOOKING_REJECTED decision, including insufficient funds",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkloadOutboundBookingReceipt" } } }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "description": "A valid bearer token is required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "403": { "description": "A verified WORKLOAD principal is required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "404": { "$ref": "#/components/responses/NotFound" },
          "409": { "$ref": "#/components/responses/Conflict" },
          "500": { "$ref": "#/components/responses/InternalError" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/accounts/{accountId}/outbound-payment-instructions/{instructionReference}/dispatch": {
      "post": {
        "operationId": "sendSyntheticOutboundDispatch",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Sends the frozen synthetic message for a booked payment. Requires a signed WORKLOAD with current operator.execute on the legal entity, a matching sender, instruction and dispatch, and the configured synthetic receiver. Replay uses the same dispatch and message identity.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "instructionReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendSyntheticOutboundDispatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Existing or newly recorded terminal receiver evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyntheticOutboundDispatchLookup"
                }
              }
            }
          },
          "202": {
            "description": "A durable attempt is recorded and the receiver outcome is unknown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyntheticOutboundDispatchLookup"
                }
              }
            }
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "get": {
        "operationId": "findSyntheticOutboundDispatch",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Finds the exact synthetic dispatch by sender account and instruction reference. Requires a signed WORKLOAD with current account.read covering the sender or operator.read on the legal entity.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "instructionReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Frozen message, latest attempt and exact receiver evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyntheticOutboundDispatchLookup"
                }
              }
            }
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/outbound-payment-instructions/{instructionReference}/settlements": {
      "post": {
        "operationId": "recordSyntheticOutboundSettlement",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Registers one synthetic settlement evidence item against the frozen booked dispatch. Requires a signed WORKLOAD with current entity payment.settle. The server fixes the settlement scope and uses the submitted amount as the single item control total.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "instructionReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordSyntheticOutboundSettlementRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Original or replayed decision, including a retained rejection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyntheticOutboundSettlementReceipt"
                }
              }
            },
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            }
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/outbound-payment-instructions/{instructionReference}/settlements/{evidenceReference}": {
      "get": {
        "operationId": "findSyntheticOutboundSettlement",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Finds the original synthetic settlement decision by sender account, instruction reference and evidence reference. Requires a signed WORKLOAD with current account.read covering the sender.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "instructionReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "evidenceReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Original source, booking and settlement evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyntheticOutboundSettlementLookup"
                }
              }
            }
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/outbound-payment-instructions/{instructionReference}/returns": {
      "post": {
        "operationId": "recordSyntheticOutboundReturn",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Records the full synthetic return against the original applied settlement. Requires a signed WORKLOAD with current payment.settle on the legal entity and the frozen account, instruction, dispatch and settlement binding.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "instructionReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordSyntheticOutboundReturnRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Durable return evidence, including a retained mismatch rejection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyntheticOutboundReturnReceipt"
                }
              }
            },
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            }
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/outbound-payment-instructions/{instructionReference}/returns/{evidenceReference}": {
      "get": {
        "operationId": "findSyntheticOutboundReturn",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Requires a signed WORKLOAD with current account.read covering the original sender. Finds the original settlement and return journal, current payable and latest credit attempt for one exact return source.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "instructionReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "evidenceReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Original return evidence and current credit state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyntheticOutboundReturnLookup"
                }
              }
            }
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/outbound-payment-instructions/{instructionReference}/returns/{evidenceReference}/credit": {
      "post": {
        "operationId": "creditSyntheticOutboundReturn",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Credits only the frozen original sender for this exact return. Requires a signed WORKLOAD with current operator.execute on the legal entity and account.credit covering that sender. An optional expectedPreviousAttempt protects a new credit decision against stale evidence. A stale expectation returns 409. An exact idempotent replay returns the original result.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "instructionReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "evidenceReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreditSyntheticOutboundReturnRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Durable credit attempt or retained review with an open payable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyntheticOutboundReturnCreditReceipt"
                }
              }
            }
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/payments": {
      "get": {
        "operationId": "listVisiblePayments",
        "description": "Read-only internal and outbound payment list. account.read applies to both accounts for internal payments and the sender for outbound payments before keyset pagination. Cursor binds entity, scope and filters. Each page is an observed snapshot; reload to see later status.",
        "parameters": [
          { "name": "kind", "in": "query", "schema": { "type": "string", "enum": ["INTERNAL", "OUTBOUND"] } },
          { "name": "accountId", "in": "query", "schema": { "$ref": "#/components/schemas/Identifier" } },
          { "name": "referencePrefix", "in": "query", "schema": { "$ref": "#/components/schemas/Identifier" } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } },
          { "name": "pageToken", "in": "query", "schema": { "type": "string", "minLength": 1, "maxLength": 2048 } }
        ],
        "responses": {
          "200": { "description": "Visible payments", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaymentReadPage" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "description": "Authentication required" },
          "403": { "$ref": "#/components/responses/Forbidden" }, "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/payments/{kind}/{id}": {
      "get": {
        "operationId": "getVisiblePayment",
        "description": "Consistent read-only payment timeline: instruction, booking, transport, receiver status, settlement, return and reconciliation findings remain separate. Unknown and out-of-scope IDs both return 404.",
        "parameters": [
          { "name": "kind", "in": "path", "required": true, "schema": { "type": "string", "enum": ["INTERNAL", "OUTBOUND"] } },
          { "name": "id", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }
        ],
        "responses": {
          "200": { "description": "Payment timeline", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaymentReadDetail" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "description": "Authentication required" },
          "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/payment-batches": {
      "get": {
        "operationId": "listVisiblePaymentBatches",
        "description": "Read-only outbound batch list. A batch and its totals are visible only when every member sender is covered by current account.read grants before pagination.",
        "parameters": [
          { "name": "referencePrefix", "in": "query", "schema": { "$ref": "#/components/schemas/Identifier" } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } },
          { "name": "pageToken", "in": "query", "schema": { "type": "string", "minLength": 1, "maxLength": 2048 } }
        ],
        "responses": {
          "200": { "description": "Visible batches", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaymentBatchReadPage" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "description": "Authentication required" },
          "403": { "$ref": "#/components/responses/Forbidden" }, "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/payment-batches/{id}": {
      "get": {
        "operationId": "getVisiblePaymentBatch",
        "description": "Consistent read-only snapshot of each batch member and its own registration, application, position, settlement, return and finding count. Unknown and out-of-scope IDs both return 404.",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }],
        "responses": {
          "200": { "description": "Batch members", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaymentBatchReadDetail" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "description": "Authentication required" },
          "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/gui-write-intents": {
      "post": {
        "operationId": "createGuiWriteIntent",
        "description": "TEST operator only. Freezes one account, funding or transfer request under the verified actor and entity. This stores an immutable intent without economic effect; current account grants are required.",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateGuiWriteIntentRequest" } } } },
        "responses": {
          "201": { "description": "Durable confirmation created", "headers": { "Location": { "$ref": "#/components/headers/Location" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiWriteIntent" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      },
      "get": {
        "operationId": "listRecentGuiWriteIntents",
        "description": "Up to 20 recent intents of the verified TEST operator, filtered again by current action grants. No operation ID grants access by itself.",
        "responses": {
          "200": { "description": "Current visible intents", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiWriteIntentList" } } } },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/gui-write-intents/{id}": {
      "get": {
        "operationId": "getGuiWriteIntent",
        "description": "Verified actor and current action grants are checked again. A completed result is recorded durably even if its HTTP reply was lost.",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }],
        "responses": {
          "200": { "description": "Own visible intent", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiWriteIntent" } } } },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/gui-write-intents/{id}/execute": {
      "post": {
        "operationId": "executeGuiWriteIntent",
        "description": "Rechecks current action grants and executes the frozen request with its intent ID as the ledger idempotency key. Duplicate or late retries return the same account/journal result. An unexecuted posting intent with an old Oslo accounting date may be rejected; a completed retry still replays.",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }],
        "responses": {
          "200": { "description": "Completed or exact prior result replayed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiWriteIntent" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "409": { "$ref": "#/components/responses/Conflict" },
          "422": { "$ref": "#/components/responses/Unprocessable" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/gui-lifecycle-intents": {
      "post": {
        "operationId": "createGuiLifecycleIntent",
        "description": "TEST operator only. Freeze one reservation, prospect, terms or restriction command with its expected version and reason. Requires current action grant; no domain effect occurs until execute.",
        "parameters": [{ "$ref": "#/components/parameters/IdempotencyKey" }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateGuiLifecycleIntentRequest" } } } },
        "responses": {
          "201": { "description": "Durable confirmation created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiLifecycleIntent" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" }, "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      },
      "get": {
        "operationId": "listRecentGuiLifecycleIntents",
        "description": "Up to 20 recent operations of the verified TEST operator, filtered by current read grants.",
        "responses": {
          "200": { "description": "Visible operations", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiLifecycleIntentList" } } } },
          "403": { "$ref": "#/components/responses/Forbidden" }, "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/gui-lifecycle-intents/{id}": {
      "get": {
        "operationId": "getGuiLifecycleIntent",
        "description": "Actor ownership and current read grant are checked again; completed result survives an HTTP response loss.",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }],
        "responses": {
          "200": { "description": "Own visible operation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiLifecycleIntent" } } } },
          "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/gui-lifecycle-intents/{id}/execute": {
      "post": {
        "operationId": "executeGuiLifecycleIntent",
        "description": "Rechecks current action grant and executes immutable input through existing domain commands with the intent ID as idempotency key. Exact retries replay the prior result.",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } }],
        "responses": {
          "200": { "description": "Completed or prior result replayed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuiLifecycleIntent" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" }, "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" },
          "422": { "$ref": "#/components/responses/Unprocessable" }, "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
      "/account-summaries": {
        "get": {
          "operationId": "listVisibleAccountSummaries",
          "description": "Live keyset listing of visible deposit accounts and their current projection balances/status in one SQL read. account.read grants are applied before search and pagination. Cursor is bound to entity, filters and current read scope; balanceUpdatedAt is the projection update time, not a page snapshot.",
          "parameters": [
            { "name": "customerId", "in": "query", "schema": { "$ref": "#/components/schemas/Identifier" } },
            { "name": "referencePrefix", "in": "query", "schema": { "$ref": "#/components/schemas/Identifier" } },
            { "name": "status", "in": "query", "schema": { "type": "string", "enum": ["OPEN", "FROZEN", "CLOSED"] } },
            { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } },
            { "name": "pageToken", "in": "query", "schema": { "type": "string", "minLength": 1, "maxLength": 2048 } }
          ],
          "responses": {
            "200": { "description": "Visible deposit account summaries", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountSummaryPage" } } } },
            "400": { "$ref": "#/components/responses/BadRequest" },
            "401": { "description": "Authentication required" },
            "403": { "description": "No account.read grant" },
            "503": { "$ref": "#/components/responses/Unavailable" }
          }
        }
      },
      "/customers": {
        "get": {
          "operationId": "listVisibleCustomers",
          "description": "Live keyset listing of synthetic customer references with at least one visible deposit account. account.read grants are applied before search, count and pagination; no customer master names or prospect-only customers. Cursor is bound to entity, prefix and current read scope.",
          "parameters": [
            {
              "name": "prefix",
              "in": "query",
              "schema": {
                "$ref": "#/components/schemas/Identifier"
              }
            },
            {
              "name": "limit",
              "in": "query",
              "schema": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "default": 50
              }
            },
            {
              "name": "pageToken",
              "in": "query",
              "schema": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048
              }
            }
          ],
          "responses": {
            "200": {
              "description": "Visible customer references only",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/CustomerDirectoryPage"
                  }
                }
              }
            },
            "400": {
              "$ref": "#/components/responses/BadRequest"
            },
            "401": {
              "description": "Authentication required"
            },
            "403": {
              "description": "No account.read grant"
            },
            "503": {
              "$ref": "#/components/responses/Unavailable"
            }
          }
        }
      },
      "/customers/{customerId}": {
        "get": {
          "operationId": "getVisibleCustomerAccounts",
          "description": "Only deposit accounts visible through current account.read grants. Unknown and out-of-scope customer references both return 404. Live keyset listing.",
          "parameters": [
            {
              "name": "customerId",
              "in": "path",
              "required": true,
              "schema": {
                "$ref": "#/components/schemas/Identifier"
              }
            },
            {
              "name": "limit",
              "in": "query",
              "schema": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "default": 50
              }
            },
            {
              "name": "pageToken",
              "in": "query",
              "schema": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048
              }
            }
          ],
          "responses": {
            "200": {
              "description": "Visible accounts for one customer",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/CustomerAccountPage"
                  }
                }
              }
            },
            "400": {
              "$ref": "#/components/responses/BadRequest"
            },
            "404": {
              "description": "Customer not found or not visible"
            },
            "503": {
              "$ref": "#/components/responses/Unavailable"
            }
          }
        }
      },
    "/accounts": {
      "post": {
        "operationId": "openDepositAccount",
        "description": "Open an account in a registered ledger unit. The chosen unit belongs to the account.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenAccountRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/AccountCreated"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "get": {
        "operationId": "listAccounts",
        "description": "Live directory filtered by opaque customer reference and the configured legal entity. Sorted by accountReference using byte order. A page token binds customer and entity, but grants no authority. Concurrent new accounts before the cursor require a fresh traversal; this is not a statement snapshot. Synthetic local access only. Balances are read separately from the account endpoint.",
        "parameters": [
          {
            "name": "customerId",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account directory page; unknown customer returns an empty accounts array",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDirectoryPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}": {
      "get": {
        "operationId": "getAccount",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "Account and protected balance",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestID"
              },
              "X-Correlation-ID": {
                "$ref": "#/components/headers/CorrelationID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/fundings": {
      "post": {
        "operationId": "fundDepositAccount",
        "description": "Credit the account in its own unit, with a matching debit to the NOK cash control or the unit's issuance account.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostingRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/PostingCreated"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/account-closures/{closureId}": {
      "get": {
        "operationId": "getAccountClosure",
        "description": "Follow the closure Location. Requires account.read on the original deposit account. Missing and inaccessible closures have the same response.",
        "parameters": [
          {
            "name": "closureId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Durable original account closure receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CloseAccountResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/closure": {
      "get": {
        "operationId": "getAccountClosureForAccount",
        "description": "Read the exact durable closure by the original account after a lost write response. Requires account.read. Access does not depend on the original approval remaining current.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "Durable original account closure receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CloseAccountResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/close": {
      "post": {
        "operationId": "closeDepositAccount",
        "description": "Irreversibly closes an empty unrestricted deposit after all durable reservation, capture and interest obligations are proven settled.",
        "parameters": [
          { "$ref": "#/components/parameters/AccountID" },
          { "$ref": "#/components/parameters/IdempotencyKey" },
          { "$ref": "#/components/parameters/CorrelationID" }
        ],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloseAccountRequest" } } }
        },
        "responses": {
          "201": {
            "description": "Account closure committed or exact prior result replayed",
            "headers": {
              "Location": { "$ref": "#/components/headers/Location" },
              "X-Request-ID": { "$ref": "#/components/headers/RequestID" },
              "X-Correlation-ID": { "$ref": "#/components/headers/CorrelationID" }
            },
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloseAccountResult" } } }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" },
          "409": { "$ref": "#/components/responses/Conflict" },
          "415": { "$ref": "#/components/responses/UnsupportedMediaType" },
          "500": { "$ref": "#/components/responses/InternalError" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/transfers": {
      "post": {
        "operationId": "transferOnUs",
        "description": "Transfer a positive amount between accounts in the same legal entity and ledger unit.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/PostingCreated"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/journals/{journalId}/metadata": {
      "get": {
        "operationId": "getJournalMetadata",
        "description": "Requires account.read on all journal legs. The first page fixes the committed metadata watermark.",
        "parameters": [
          {
            "$ref": "#/components/parameters/JournalID"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata entries in append order",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LedgerMetadataPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "post": {
        "operationId": "appendJournalMetadata",
        "description": "Requires account.correct on all journal legs. Adds new keys atomically. An exact retry returns the original result.",
        "parameters": [
          {
            "$ref": "#/components/parameters/JournalID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppendLedgerMetadataRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Metadata appended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LedgerMetadataAppendResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/journals/{journalId}": {
      "get": {
        "operationId": "getJournal",
        "parameters": [
          {
            "$ref": "#/components/parameters/JournalID"
          }
        ],
        "responses": {
          "200": {
            "description": "Immutable posted journal",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestID"
              },
              "X-Correlation-ID": {
                "$ref": "#/components/headers/CorrelationID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/journals/{journalId}/reversals": {
      "post": {
        "operationId": "reverseTransaction",
        "parameters": [
          {
            "$ref": "#/components/parameters/JournalID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReversalRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/PostingCreated"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/history": {
      "get": {
        "operationId": "getAccountHistory",
        "description": "Immutable posted account entries ordered by journal sequence then line number, ascending. First page captures a committed prefix watermark for the selected account, reused by continuation tokens; unrelated account activity does not advance it. Optional accounting-date interval is from inclusive to exclusive. Totals cover the whole interval at that watermark and use exact integer strings; entry amounts remain int64. Tokens must be returned unchanged with the same account and date filters, and grant no authority. New postings are excluded until a fresh traversal. Synthetic TEST access only.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "from",
            "in": "query",
            "description": "Inclusive accounting date; omitted means beginning of history.",
            "schema": {
              "$ref": "#/components/schemas/BusinessDate"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Exclusive accounting date; omitted means through the captured watermark.",
            "schema": {
              "$ref": "#/components/schemas/BusinessDate"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account history and interval totals at a fixed committed journal watermark",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountHistoryPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/statements": {
      "post": {
        "operationId": "issueAccountStatement",
        "description": "Issues an immutable, versioned machine-readable statement for one complete past Oslo calendar month. Without an explicit clean product-period-close proof the statement is provisional. The issued version freezes its journal watermark, exact totals, entries, interest lineage, corrections and content digest.",
        "parameters": [
          { "$ref": "#/components/parameters/AccountID" },
          { "$ref": "#/components/parameters/IdempotencyKey" },
          { "$ref": "#/components/parameters/CorrelationID" }
        ],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IssueAccountStatementRequest" } } }
        },
        "responses": {
          "201": {
            "description": "Statement issued",
            "headers": { "Location": { "schema": { "type": "string" } } },
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountStatementResult" } } }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" },
          "409": { "$ref": "#/components/responses/Conflict" },
          "415": { "$ref": "#/components/responses/UnsupportedMediaType" },
          "500": { "$ref": "#/components/responses/InternalError" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/account-statements/{statementId}": {
      "get": {
        "operationId": "getAccountStatement",
        "description": "Reads one immutable statement version. Entry pages are bound to the statement identity and content digest; interest and correction lineage is repeated unchanged on every page.",
        "parameters": [
          { "name": "statementId", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/Identifier" } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } },
          { "name": "pageToken", "in": "query", "schema": { "type": "string", "minLength": 1, "maxLength": 2048 } }
        ],
        "responses": {
          "200": { "description": "Statement page", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountStatementPage" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" },
          "409": { "$ref": "#/components/responses/Conflict" },
          "500": { "$ref": "#/components/responses/InternalError" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/journals": {
      "get": {
        "operationId": "lookupJournals",
        "description": "Exact source triple lookup scoped to the configured entity, NOK and current account.read grants. A journal appears only if every line is readable; visibility is applied before ordering and pagination. Ascending journal sequence, default 50 and maximum 100. Continuations fix the visible matching watermark and bind the source triple and read scope; return tokens unchanged. Later postings are excluded. Tokens are not credentials or signed evidence.",
        "parameters": [
          {
            "name": "sourceSystem",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
            }
          },
          {
            "name": "sourceType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
            }
          },
          {
            "name": "sourceValue",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[!-~]{1,128}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048,
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching posted journals in a fixed committed NOK prefix; empty array if no match.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestID"
              },
              "X-Correlation-ID": {
                "$ref": "#/components/headers/CorrelationID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JournalLookupPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/terms": {
      "get": {
        "operationId": "getDepositTerms",
        "description": "Effective immutable deposit terms on at, or the current Oslo date when omitted. Only deposit.nok with interestMode NONE is supported. Migrated baseline identifies a PoC policy assumption, not a historical agreement. Synthetic local authority only.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "at",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/BusinessDate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Effective terms version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositTerms"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "post": {
        "operationId": "changeDepositTerms",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeDepositTermsRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Terms version committed or exact prior result replayed",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestID"
              },
              "X-Correlation-ID": {
                "$ref": "#/components/headers/CorrelationID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangeDepositTermsResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "description": "Append the next terms version atomically with audit, outbox and an idempotent result. expectedVersion matches the latest recorded version. effectiveDate must follow receipt in Oslo and all scheduled versions; starts at Oslo midnight. No same-day/backdated change, cancellation, interest accrual or journal posting. Exact retries return their original result even after later changes."
      }
    },
    "/accounts/{accountId}/terms/history": {
      "get": {
        "operationId": "getDepositTermsHistory",
        "description": "Ascending immutable terms versions at a fixed version watermark. Continuation binds account and configured entity; later versions are excluded. Token is pagination context, not authority.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Terms history at a fixed version watermark",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositTermsPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/restrictions": {
      "get": {
        "operationId": "getRestrictionPolicy",
        "description": "Version zero derives policy from legacy status and has no fabricated change metadata. Existing FROZEN means ALL. CLOSED cannot be reopened by release.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          }
        ],
        "responses": {
          "200": {
            "description": "Current restriction policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestrictionPolicy"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "post": {
        "operationId": "applyRestriction",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyRestrictionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Restriction change committed or exact prior result replayed",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestID"
              },
              "X-Correlation-ID": {
                "$ref": "#/components/headers/CorrelationID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestrictionResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "description": "Immediately apply DEBITS or ALL with an expected restriction version, controlled reason, immutable audit and atomic outbox/idempotency. Exact retries preserve prior results. Synthetic authority only."
      }
    },
    "/accounts/{accountId}/restrictions/history": {
      "get": {
        "operationId": "getRestrictionHistory",
        "description": "Ascending immutable changes with fixed version watermark, default 50 and maximum 100. Empty history has watermark zero. Cursor binds configured entity and account.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Immutable restriction changes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestrictionHistoryPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/restrictions/release": {
      "post": {
        "operationId": "releaseRestriction",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReleaseRestrictionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Restriction change committed or exact prior result replayed",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestID"
              },
              "X-Correlation-ID": {
                "$ref": "#/components/headers/CorrelationID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestrictionResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "description": "Explicitly release an existing restriction with expected version and reason. Does not reopen CLOSED accounts."
      }
    },
    "/deposit-prospects": {
      "get": {
        "operationId": "listVisibleDepositProspects",
        "description": "Live keyset list of visible prospects. Customer read scope and source integrity are checked before pagination; cursor binds entity, scope and filter.",
        "parameters": [
          { "name": "customerId", "in": "query", "schema": { "$ref": "#/components/schemas/Identifier" } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } },
          { "name": "pageToken", "in": "query", "schema": { "type": "string", "minLength": 1, "maxLength": 2048 } }
        ],
        "responses": {
          "200": { "description": "Visible prospects", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DepositProspectPage" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" }, "403": { "$ref": "#/components/responses/Forbidden" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      },
      "post": {
        "operationId": "createDepositProspect",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDepositProspectRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Prospect created or exact prior result replayed",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestID"
              },
              "X-Correlation-ID": {
                "$ref": "#/components/headers/CorrelationID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDepositProspectResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "description": "Create a single-holder synthetic prospective arrangement with no ledger account, balance or posting eligibility. Customer linkage and the configured actor are not verified authority."
      }
    },
    "/deposit-prospects/{prospectId}": {
      "get": {
        "operationId": "getDepositProspect",
        "description": "Scoped immutable creation and activation evidence. PROSPECT has version 1 and explicit null accountId/activation; ACTIVATED has version 2 and an account reference. Read current account/restriction state separately. Inconsistent source fails closed.",
        "parameters": [
          {
            "name": "prospectId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Prospective arrangement or its historical activation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositProspect"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/deposit-prospects/{prospectId}/activate": {
      "post": {
        "operationId": "activateDepositProspect",
        "parameters": [
          {
            "name": "prospectId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivateDepositProspectRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/AccountCreated"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "description": "Activate expected version 1 once, creating account, zero protected balance, initial no-interest terms, immutable activation and both events atomically. Different-key repeat activation conflicts; exact completed replay retains the original account result."
      }
    },
    "/accounts/{accountId}/reservations/{id}/card-captures": {
      "post": {
        "operationId": "captureWorkloadCardReservation",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "A signed workload with current card.capture and account.debit captures a hold bound to konseptbank-card-v1. Submit the original authorization reference and the distinct processor claim reference. Ledger selects the registered clearing account. Late submissions record REQUIRES_REVIEW. Exact retries use the original key and input.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkloadCardCaptureRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Durable card capture outcome",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaptureReservationResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          }
        }
      }
    },
    "/card-positions/{positionId}/settlements": {
      "post": {
        "operationId": "settleWorkloadCardPosition",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Signed WORKLOAD with entity-scope card.settle. A matching synthetic NOK settlement posts the terminal journal. A wrong claim reference or amount produces a durable REQUIRES_REVIEW receipt and keeps the position open. Replay with the same workload, key and input. Recover from uncertainty using the original account and processor claim reference with findWorkloadCardClaim.",
        "parameters": [
          {
            "name": "positionId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkloadCardSettlementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Committed settlement or review receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkloadCardTerminalReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/card-positions/{positionId}/correction-approvals": {
      "post": {
        "operationId": "approveWorkloadCardCorrection",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "A signed Ledger OPERATOR or WORKLOAD with current operator.approve on the original account or entity independently approves the exact correction and its requester-scoped correctionIdempotencyKey. The requester must be a distinct current WORKLOAD with card.correct and account.correct for the account. The Idempotency-Key header identifies issuance and correctionIdempotencyKey identifies the future correction. Approval expires after one real-time hour. Retry issuance with its original identity, key and input.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "positionId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardCorrectionApprovalRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Immutable approval receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardCorrectionApprovalReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/card-positions/{positionId}/corrections": {
      "post": {
        "operationId": "correctWorkloadCardPosition",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Signed WORKLOAD with current card.correct and account.correct on the original account. Submit the exact approved correction fields and the Idempotency-Key frozen by the independent approver. Original journal and open position are checked for first posting. A completed exact retry retains its original receipt after approval expiry. Recover using findWorkloadCardClaim and current account.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "positionId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkloadCardCorrectionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Committed linked correction receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkloadCardTerminalReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/card-positions/{positionId}/refund-approvals": {
      "post": {
        "operationId": "approveSettledCardRefund",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Independent signed OPERATOR or WORKLOAD with current operator.approve on the original account. Binds the exact settled purchase, proposal, requester key and exclusive original approval window.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "positionId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardRefundApprovalRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Durable exact refund attestation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardRefundApprovalReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/card-positions/{positionId}/refunds": {
      "post": {
        "operationId": "postSettledCardRefund",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Signed WORKLOAD with current card.refund and account.credit on the original account. Posts one full refund with an unexpired exact attestation. Exact replay after expiry returns the original evidence.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "positionId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "X-Correlation-ID",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardRefundRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "201": {
            "description": "Original refund journal and settlement evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardRefundEvidence"
                }
              }
            },
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            }
          }
        }
      }
    },
    "/accounts/{accountId}/card-refunds/{refundReference}": {
      "get": {
        "operationId": "findSettledCardRefund",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Exact original account and refund reference lookup with current account.read, including after approval expiry.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "refundReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Original refund journal and settlement evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardRefundEvidence"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/accounts/{accountId}/card-claims/{claimReference}": {
      "get": {
        "operationId": "findWorkloadCardClaim",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Exact claim lookup in konseptbank-card-v1 for a signed workload with current account.read on the original deposit. Shows the capture claim, open or terminal position and settlement reviews. Missing and out-of-scope evidence both return 404.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "claimReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Exact card claim and clearing evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkloadCardClaim"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "head": {
        "operationId": "headWorkloadCardClaim",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Exact claim lookup in konseptbank-card-v1 for a signed workload with current account.read on the original deposit. Shows the capture claim, open or terminal position and settlement reviews. Missing and out-of-scope evidence both return 404.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "claimReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Exact card claim and clearing evidence"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/reservations": {
      "post": {
        "operationId": "createReservation",
        "description": "Creating a hold in the konseptbank-card-v1 namespace requires a signed workload with current card.authorize and account.debit on the deposit. The external reference value is the 32-character lower-case hexadecimal authorization reference. Ledger binds it atomically to the new hold.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReservationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Reservation change committed or exact prior result replayed",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestID"
              },
              "X-Correlation-ID": {
                "$ref": "#/components/headers/CorrelationID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        },
        "description": "Create a positive NOK hold on an eligible deposit with available funds. Stable external reference is economically unique in configured entity scope. Command, source, availability and outbox commit atomically; exact retries return the original result before current eligibility checks."
      }
    },
    "/reservations/{reservationId}/metadata": {
      "get": {
        "operationId": "getReservationMetadata",
        "description": "Requires account.read on the reservation account. The first page fixes the committed metadata watermark.",
        "parameters": [
          {
            "name": "reservationId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata entries in append order",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LedgerMetadataPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "post": {
        "operationId": "appendReservationMetadata",
        "description": "Requires account.debit on the reservation account. Adds new keys atomically. An exact retry returns the original result.",
        "parameters": [
          {
            "name": "reservationId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppendLedgerMetadataRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Metadata appended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LedgerMetadataAppendResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/reservations/{reservationId}": {
      "get": {
        "operationId": "getReservation",
        "description": "Available funds remain held until a durable release or expiry transition. Passing expiresAt alone does not change current state or availability.",
        "parameters": [
          {
            "name": "reservationId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current anchored reservation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reservation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/reservations/{reservationId}/change": {
      "post": {
        "operationId": "changeReservation",
        "parameters": [
          {
            "name": "reservationId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeReservationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Reservation change committed or exact prior result replayed",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestID"
              },
              "X-Correlation-ID": {
                "$ref": "#/components/headers/CorrelationID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        },
        "description": "Set held amount and expiry on the expected active version before its existing deadline. Increase or extension requires unrestricted OPEN status; reduction without extension may unwind a restricted obligation."
      }
    },
    "/reservations/{reservationId}/release": {
      "post": {
        "operationId": "releaseReservation",
        "parameters": [
          {
            "name": "reservationId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReleaseReservationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Reservation change committed or exact prior result replayed",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestID"
              },
              "X-Correlation-ID": {
                "$ref": "#/components/headers/CorrelationID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        },
        "description": "Release the remaining hold from its expected active version, including on restricted or closed accounts. Terminal reservations cannot reopen."
      }
    },
    "/reservations/{reservationId}/history": {
      "get": {
        "operationId": "getReservationHistory",
        "description": "Immutable ascending reservation changes at a fixed committed reservation sequence. Default 50, maximum 100. Cursor binds entity and reservation; later changes are excluded.",
        "parameters": [
          {
            "name": "reservationId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reservation history",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationHistoryPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/accounts/{accountId}/reservations": {
      "get": {
        "operationId": "listAccountReservations",
        "description": "All reservation identities for an account in creation order, each with its state at a fixed reservation sequence. Includes terminal holds; concurrent changes cannot alter an earlier page snapshot.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountID"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account reservations at captured source boundary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountReservationsPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/bank-lab/central/{runId}/reserves": {
      "post": {
        "operationId": "provisionBankLabCentralReserves",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Synthetic bank lab only. Requires the signed central bank WORKLOAD with the entity grant bank-lab.reserve.provision. Opens two assigned NOK reserve liabilities and the balancing synthetic opening asset in one journal.",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BankLabOpeningRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "201": {
            "description": "Original durable laboratory result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankLabOpening"
                }
              }
            }
          }
        }
      }
    },
    "/bank-lab/central/{runId}/settlements/{senderParticipantId}/{paymentReference}": {
      "post": {
        "operationId": "settleBankLabCentralPayment",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Synthetic bank lab only. Requires a signed WORKLOAD with bank-lab.settlement.submit and the registered sender binding. Exact economic replay can use a new transport key. A recorded rejection has no journal.",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "senderParticipantId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "paymentReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BankLabSettlementRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "201": {
            "description": "Original durable laboratory result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankLabSettlement"
                }
              }
            },
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "findBankLabCentralSettlement",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Synthetic bank lab only. A signed WORKLOAD with bank-lab.settlement.read can read durable evidence as registered sender or recipient. HTTP 404 gives no observation of a terminal result.",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "senderParticipantId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "paymentReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "200": {
            "description": "Exact original settled or rejected result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankLabSettlement"
                }
              }
            }
          }
        }
      }
    },
    "/bank-lab/payments/{runId}/{paymentReference}/opening": {
      "post": {
        "operationId": "openBankLabCustomerPayment",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Synthetic bank laboratory only. Freezes one payment route and posts the local opening. Signed local bank-lab.payment.provision.",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "paymentReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "201": {
            "description": "Signed evidence from the local authoritative bank",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankLabSignedProof"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BankLabLocalOpeningRequest"
              }
            }
          }
        }
      }
    },
    "/bank-lab/payments/{runId}/{paymentReference}/steps/{step}": {
      "post": {
        "operationId": "applyBankLabCustomerPaymentStep",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Synthetic bank laboratory only. Signed local bank-lab.payment.write. Applies an authoritative upstream proof to the matching local bank step. The local credit step uses the retained receipt and an empty body object.",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "paymentReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "step",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "opening",
                "book",
                "reserve",
                "sender-settle",
                "sender-finish",
                "recipient-settle",
                "receive",
                "credit"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "201": {
            "description": "Signed evidence from the local authoritative bank",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankLabSignedProof"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BankLabApplyStepRequest"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "findBankLabCustomerPaymentStep",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Synthetic bank laboratory only. With bank-lab.payment.read, returns the signed exact local outcome. HTTP 404 means the step has no observed fact in the caller scope.",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "paymentReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "step",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "opening",
                "book",
                "reserve",
                "sender-settle",
                "sender-finish",
                "recipient-settle",
                "receive",
                "credit"
              ]
            }
          }
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "200": {
            "description": "Signed evidence from the local authoritative bank",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankLabSignedProof"
                }
              }
            }
          }
        }
      }
    },
    "/bank-lab/central/{runId}/settlements/{senderParticipantId}/{paymentReference}/customer-payment": {
      "post": {
        "operationId": "settleBankLabCustomerPaymentAtCentralBank",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Synthetic bank laboratory only. The central settlement workload must own the debit reserve, and supply the signed private coverage for the opted-in customer payment.",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "senderParticipantId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "paymentReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "201": {
            "description": "Signed evidence from the local authoritative bank",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankLabSignedProof"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BankLabApplyStepRequest"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "findBankLabCentralCustomerPaymentProof",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Synthetic bank laboratory only. Sender or recipient with bank-lab.settlement.read retrieves signed terminal evidence for the designated customer payment.",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "senderParticipantId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "paymentReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "200": {
            "description": "Signed evidence from the local authoritative bank",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankLabSignedProof"
                }
              }
            }
          }
        }
      }
    },
    "/bank-lab/payments/{runId}/{paymentReference}/checkpoint": {
      "get": {
        "operationId": "readBankLabPaymentCheckpoint",
        "security": [
          {
            "LedgerPrincipal": []
          }
        ],
        "description": "Synthetic bank laboratory only. Signed WORKLOAD with the bank-lab.payment.reconcile grant. Projects the exact payment journal prefix in a read-only transaction.",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "paymentReference",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "A valid signed Ledger bearer token is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "200": {
            "description": "Bank-local authoritative payment checkpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankLabCheckpoint"
                }
              }
            }
          }
        }
      }
    },
    "/reservations/{reservationId}/captures": {
      "post": {
        "operationId": "captureReservation",
        "description": "Capture a positive amount from the expected active reservation into another NOK deposit in the configured entity. RETAIN keeps the uncaptured residual held; RELEASE returns it to available funds. Terminal or deadline-late requests record REQUIRES_REVIEW without a journal or financial effect and point Location to the claim. Database claim admission under account locks fixes the deadline outcome. Stable external claim reference is economically unique, and an exact transport retry returns the original result. Each successful capture copies the reservation metadata into its journal.",
        "parameters": [
          {
            "name": "reservationId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaptureReservationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Reservation capture committed or exact prior result replayed",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestID"
              },
              "X-Correlation-ID": {
                "$ref": "#/components/headers/CorrelationID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaptureReservationResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/reservation-claims/{claimId}": {
      "get": {
        "operationId": "getReservationClaim",
        "description": "Immutable capture claim within the configured legal entity. Reads do not change the claim, hold or financial state.",
        "parameters": [
          {
            "name": "claimId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ReservationClaim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationClaim"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/reservations/{reservationId}/claims": {
      "get": {
        "operationId": "getReservationClaims",
        "description": "Immutable claims in ascending claim sequence at a fixed committed watermark. Default 50, maximum 100. Cursor binds legal entity, reservation and query kind; subsequent claims are excluded from the traversal.",
        "parameters": [
          {
            "name": "reservationId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ReservationClaimPage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationClaimPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/interest-rate-profiles": {
      "post": {
        "operationId": "createRateProfile",
        "description": "Create an entity-scoped synthetic NOK rate profile. The first effective date must follow the Oslo receipt date. Configuration does not change account terms or post money.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "responses": {
          "201": {
            "description": "Successful result or exact prior command replay",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestID"
              },
              "X-Correlation-ID": {
                "$ref": "#/components/headers/CorrelationID"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateProfileResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRateProfileRequest"
              }
            }
          }
        }
      }
    },
    "/interest-rate-profiles/{profileId}": {
      "get": {
        "operationId": "getRateProfile",
        "description": "Read the rate effective on the selected Oslo date (default current date). latestVersion describes configuration; effectiveRate is null before the first effective date. An explicit zero rate is retained.",
        "parameters": [
          {
            "name": "profileId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "at",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/BusinessDate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful result or exact prior command replay",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestID"
              },
              "X-Correlation-ID": {
                "$ref": "#/components/headers/CorrelationID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateProfile"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/interest-rate-profiles/{profileId}/rates": {
      "post": {
        "operationId": "changeRateProfile",
        "description": "Append a rate after both the Oslo receipt date and the latest scheduled effective date. expectedVersion matches latestVersion. Prior rates are immutable; exact retries return their original result.",
        "parameters": [
          {
            "name": "profileId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful result or exact prior command replay",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestID"
              },
              "X-Correlation-ID": {
                "$ref": "#/components/headers/CorrelationID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateProfileResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeRateProfileRequest"
              }
            }
          }
        }
      }
    },
    "/accounts/{accountId}/interest-calculations": {
      "post": {
        "operationId": "calculateInterestDay",
        "description": "Retain one exact calculation for an account and CLOSED Oslo journal day. Select effective sources and closing balance at the retained journal prefix. This records calculation evidence; it does not book or settle interest. A different command for an already calculated day conflicts.",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/CorrelationID"
          }
        ],
        "responses": {
          "201": {
            "description": "Successful result or exact prior command replay",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestID"
              },
              "X-Correlation-ID": {
                "$ref": "#/components/headers/CorrelationID"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DailyInterestResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculateInterestDayRequest"
              }
            }
          }
        }
      }
    },
    "/accounts/{accountId}/interest-calculations/{accountingDate}": {
      "get": {
        "operationId": "getDailyInterest",
        "description": "Read immutable retained daily inputs and exact rational result. NONE has null rate fields and explicit zero interest; a zero-rate interest policy retains its actual rate identity. This resource is calculation evidence, not a payment receipt.",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Identifier"
            }
          },
          {
            "name": "accountingDate",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/BusinessDate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful result or exact prior command replay",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestID"
              },
              "X-Correlation-ID": {
                "$ref": "#/components/headers/CorrelationID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DailyInterest"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "LedgerPrincipal": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "RS256 token with pinned issuer and audience. The subject and grant_version select the current server-side principal grants; customer IDs, account IDs, cursors and idempotency keys never establish authority."
      },
      "EntraUser": {
        "type": "oauth2",
        "description": "TEST only. Sign in with an enrolled user from the private Entra tenant. The API additionally checks the calling client and current ledger operator grants.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://login.microsoftonline.com/eec70094-32a4-45e6-bbd8-1cfbafd06bbb/oauth2/v2.0/authorize",
            "tokenUrl": "https://login.microsoftonline.com/eec70094-32a4-45e6-bbd8-1cfbafd06bbb/oauth2/v2.0/token",
            "scopes": {
              "api://a668d2ba-4c9c-4657-b014-f6ccaaf0bc47/ledger.test": "Delegated access to the synthetic ledger TEST API"
            }
          }
        }
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/Identifier"
        }
      },
      "CorrelationID": {
        "name": "X-Correlation-ID",
        "in": "header",
        "required": false,
        "schema": {
          "$ref": "#/components/schemas/Identifier"
        }
      },
      "AccountID": {
        "name": "accountId",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/Identifier"
        }
      },
      "OutboundInstructionReference": {
        "name": "instructionReference",
        "in": "path",
        "required": true,
        "schema": { "$ref": "#/components/schemas/Identifier" }
      },
      "JournalID": {
        "name": "journalId",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/Identifier"
        }
      }
    },
    "headers": {
      "RequestID": {
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/Identifier"
        },
        "description": "Unique request identifier accepted or generated by the service."
      },
      "CorrelationID": {
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/Identifier"
        },
        "description": "Accepted correlation identifier or the generated request identifier."
      },
      "Location": {
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "Canonical path of the created account or journal."
      },
      "Allow": {
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "HTTP methods accepted by the known route."
      }
    },
    "responses": {
      "AccountCreated": {
        "description": "Account opened or exact prior result replayed",
        "headers": {
          "Location": {
            "$ref": "#/components/headers/Location"
          },
          "X-Request-ID": {
            "$ref": "#/components/headers/RequestID"
          },
          "X-Correlation-ID": {
            "$ref": "#/components/headers/CorrelationID"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/OpenAccountResult"
            }
          }
        }
      },
      "PostingCreated": {
        "description": "Posting committed or exact prior result replayed",
        "headers": {
          "Location": {
            "$ref": "#/components/headers/Location"
          },
          "X-Request-ID": {
            "$ref": "#/components/headers/RequestID"
          },
          "X-Correlation-ID": {
            "$ref": "#/components/headers/CorrelationID"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PostingResult"
            }
          }
        }
      },
      "BadRequest": {
        "description": "Invalid headers, path value, strict JSON syntax, exact member set, or business input",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/RequestID"
          },
          "X-Correlation-ID": {
            "$ref": "#/components/headers/CorrelationID"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Verified principal lacks the current TEST operator kind or required action grant",
        "headers": {
          "X-Request-ID": { "$ref": "#/components/headers/RequestID" },
          "X-Correlation-ID": { "$ref": "#/components/headers/CorrelationID" }
        },
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      },
      "NotFound": {
        "description": "Resource not found",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/RequestID"
          },
          "X-Correlation-ID": {
            "$ref": "#/components/headers/CorrelationID"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "MethodNotAllowed": {
        "description": "Known route with an unsupported method",
        "headers": {
          "Allow": {
            "$ref": "#/components/headers/Allow"
          },
          "X-Request-ID": {
            "$ref": "#/components/headers/RequestID"
          },
          "X-Correlation-ID": {
            "$ref": "#/components/headers/CorrelationID"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Conflict": {
        "description": "Idempotency or immutable-fact conflict",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/RequestID"
          },
          "X-Correlation-ID": {
            "$ref": "#/components/headers/CorrelationID"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "UnsupportedMediaType": {
        "description": "Content-Type is not application/json",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/RequestID"
          },
          "X-Correlation-ID": {
            "$ref": "#/components/headers/CorrelationID"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unprocessable": {
        "description": "A valid transfer or reversal would violate available-funds policy",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/RequestID"
          },
          "X-Correlation-ID": {
            "$ref": "#/components/headers/CorrelationID"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "InternalError": {
        "description": "Unexpected internal ledger failure",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/RequestID"
          },
          "X-Correlation-ID": {
            "$ref": "#/components/headers/CorrelationID"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unavailable": {
        "description": "Command deadline, database pool, lock, statement, ambiguous commit outcome, or persistence dependency unavailable; retry writes with the same idempotency key",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/RequestID"
          },
          "X-Correlation-ID": {
            "$ref": "#/components/headers/CorrelationID"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "PurchaseLoanSettlementRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "legalEntityId",
          "profileId",
          "receiptId",
          "receiptDigest",
          "status",
          "originalCommandId",
          "originalJournalId",
          "amountMinorUnits",
          "currency",
          "settledAt",
          "settlementDate",
          "accountingDate"
        ],
        "properties": {
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "profileId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "receiptId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "receiptDigest": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "SETTLED"
            ]
          },
          "originalCommandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "originalJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          },
          "settledAt": {
            "type": "string",
            "format": "date-time"
          },
          "settlementDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          }
        }
      },
      "PurchaseLoanSettlementJournal": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "journalId",
          "legalEntityId",
          "profileId",
          "receiptId",
          "positionId",
          "payableAccountId",
          "cashAccountId",
          "actorId",
          "correlationId",
          "receiptDigest",
          "amountMinorUnits",
          "currency",
          "settledAt",
          "receivedTime",
          "recordedTime",
          "settlementDate",
          "accountingDate",
          "entries"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "profileId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "receiptId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "positionId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "payableAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "cashAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "actorId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "correlationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "receiptDigest": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          },
          "settledAt": {
            "type": "string",
            "format": "date-time"
          },
          "receivedTime": {
            "type": "string",
            "format": "date-time"
          },
          "recordedTime": {
            "type": "string",
            "format": "date-time"
          },
          "settlementDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "entries": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
              "$ref": "#/components/schemas/LoanJournalLeg"
            }
          }
        }
      },
      "PurchaseLoanSettlementEvidence": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "opening",
          "settlement",
          "position"
        ],
        "properties": {
          "opening": {
            "$ref": "#/components/schemas/WorkloadLoanSettlementDrawdownBooking"
          },
          "settlement": {
            "$ref": "#/components/schemas/PurchaseLoanSettlementJournal"
          },
          "position": {
            "$ref": "#/components/schemas/WorkloadLoanSettlementDrawdownPosition"
          }
        }
      },
      "WorkloadLoanSettlementDrawdownRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "borrowerId",
          "agreementRevision",
          "providerId",
          "eventId",
          "amountMinorUnits",
          "currency",
          "transactionTime",
          "effectiveDate",
          "accountingDate",
          "settlementAccountId",
          "lienReference",
          "releaseReference"
        ],
        "properties": {
          "borrowerId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "agreementRevision": {
            "$ref": "#/components/schemas/Identifier"
          },
          "providerId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "eventId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "settlementAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "lienReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "releaseReference": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "WorkloadLoanSettlementDrawdownBooking": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "originalCommandId",
          "journalId",
          "loanId",
          "borrowerId",
          "depositAccountId",
          "principalAccountId",
          "settlementAccountId",
          "positionId",
          "agreementRevision",
          "lienReference",
          "releaseReference",
          "providerId",
          "eventId",
          "actorId",
          "correlationId",
          "amountMinorUnits",
          "currency",
          "transactionTime",
          "receivedTime",
          "recordedTime",
          "effectiveDate",
          "accountingDate",
          "entries"
        ],
        "properties": {
          "originalCommandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "loanId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "borrowerId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "depositAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "principalAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "settlementAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "positionId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "agreementRevision": {
            "$ref": "#/components/schemas/Identifier"
          },
          "lienReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "releaseReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "providerId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "eventId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "actorId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "correlationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "receivedTime": {
            "type": "string",
            "format": "date-time"
          },
          "recordedTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "entries": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
              "$ref": "#/components/schemas/LoanJournalLeg"
            }
          }
        }
      },
      "WorkloadLoanSettlementDrawdownReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "booking"
        ],
        "properties": {
          "booking": {
            "$ref": "#/components/schemas/WorkloadLoanSettlementDrawdownBooking"
          }
        }
      },
      "WorkloadLoanSettlementDrawdownPosition": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "positionId",
          "status",
          "openAmountMinorUnits",
          "currency"
        ],
        "properties": {
          "positionId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "status": {
            "type": "string",
            "enum": [
              "OPEN",
              "SETTLED"
            ]
          },
          "openAmountMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          }
        }
      },
      "WorkloadLoanSettlementDrawdownEvidence": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "booking",
          "position"
        ],
        "properties": {
          "booking": {
            "$ref": "#/components/schemas/WorkloadLoanSettlementDrawdownBooking"
          },
          "position": {
            "$ref": "#/components/schemas/WorkloadLoanSettlementDrawdownPosition"
          }
        }
      },
      "WorkloadLoanDrawdownRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "borrowerId",
          "agreementRevision",
          "providerId",
          "eventId",
          "amountMinorUnits",
          "currency",
          "transactionTime",
          "effectiveDate",
          "accountingDate"
        ],
        "properties": {
          "borrowerId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "agreementRevision": {
            "$ref": "#/components/schemas/Identifier"
          },
          "providerId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "eventId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          }
        }
      },
      "WorkloadLoanDrawdownReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "originalCommandId",
          "journalId",
          "loanId",
          "depositAccountId",
          "principalAccountId",
          "interestReceivableAccountId"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "originalCommandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "loanId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "depositAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "principalAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "interestReceivableAccountId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "GuiReadPage": { "type": "object", "required": ["items", "observedAt"], "properties": { "items": { "type": "array", "maxItems": 50, "items": { "type": "object" } }, "nextPageToken": { "type": ["string", "null"], "maxLength": 2048 }, "observedAt": { "type": "string", "format": "date-time" } } },
      "GuiInterestPage": { "allOf": [{ "$ref": "#/components/schemas/GuiReadPage" }, { "type": "object", "properties": { "items": { "type": "array", "maxItems": 50, "items": { "$ref": "#/components/schemas/GuiInterestEvent" } } } }] },
      "GuiPeriodPage": { "allOf": [{ "$ref": "#/components/schemas/GuiReadPage" }, { "type": "object", "properties": { "items": { "type": "array", "maxItems": 50, "items": { "$ref": "#/components/schemas/GuiPeriodEvent" } } } }] },
      "GuiReconciliationPage": { "allOf": [{ "$ref": "#/components/schemas/GuiReadPage" }, { "type": "object", "properties": { "items": { "type": "array", "maxItems": 50, "items": { "$ref": "#/components/schemas/GuiReconciliationEvent" } } } }] },
      "GuiExceptionPage": { "allOf": [{ "$ref": "#/components/schemas/GuiReadPage" }, { "type": "object", "properties": { "items": { "type": "array", "maxItems": 50, "items": { "$ref": "#/components/schemas/GuiExceptionEvent" } } } }] },
      "GuiGlPage": { "allOf": [{ "$ref": "#/components/schemas/GuiReadPage" }, { "type": "object", "properties": { "items": { "type": "array", "maxItems": 50, "items": { "$ref": "#/components/schemas/GuiGlEvent" } } } }] },
      "GuiInterestEvent": { "type": "object", "required": ["id", "kind", "accountId", "sourceDate", "recordedAt", "status", "actorId", "reasonCode"], "properties": { "id": { "$ref": "#/components/schemas/Identifier" }, "kind": { "type": "string", "enum": ["CALCULATION", "RECOGNITION", "CAPITALIZATION", "CORRECTION", "TERMINAL"] }, "accountId": { "$ref": "#/components/schemas/Identifier" }, "sourceDate": { "$ref": "#/components/schemas/BusinessDate" }, "recordedAt": { "type": "string", "format": "date-time" }, "status": { "type": "string" }, "numerator": { "type": ["string", "null"] }, "denominator": { "type": ["integer", "null"], "format": "int64" }, "minorUnits": { "type": ["integer", "null"], "format": "int64" }, "residualNumerator": { "type": ["string", "null"] }, "journalId": { "type": ["string", "null"] }, "sourceId": { "type": ["string", "null"] }, "actorId": { "$ref": "#/components/schemas/Identifier" }, "reasonCode": { "type": "string" } } },
      "GuiPeriodEvent": { "type": "object", "required": ["id", "kind", "periodStart", "periodEnd", "recordedAt", "status"], "properties": { "id": { "type": "string" }, "kind": { "type": "string", "enum": ["ACCOUNTING_DAY", "PRODUCT_CLOSE"] }, "periodStart": { "$ref": "#/components/schemas/BusinessDate" }, "periodEnd": { "$ref": "#/components/schemas/BusinessDate" }, "recordedAt": { "type": "string", "format": "date-time" }, "status": { "type": "string" }, "stage": { "type": ["string", "null"] }, "journalWatermark": { "type": ["integer", "null"], "format": "int64" }, "accountCount": { "type": ["integer", "null"] }, "completedAccountCount": { "type": ["integer", "null"] }, "exceptionCount": { "type": ["integer", "null"] }, "actorId": { "type": ["string", "null"] }, "reasonCode": { "type": ["string", "null"] } } },
      "GuiReconciliationEvent": { "type": "object", "required": ["id", "controlName", "status", "observedAt", "journalWatermark", "checkedJournalCount", "discrepancyCount", "openExceptionCount", "externalPositionStatus"], "properties": { "id": { "$ref": "#/components/schemas/Identifier" }, "controlName": { "type": "string" }, "status": { "type": "string" }, "observedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": ["string", "null"], "format": "date-time" }, "journalWatermark": { "type": "integer", "format": "int64" }, "checkedJournalCount": { "type": "integer", "format": "int64" }, "discrepancyCount": { "type": "integer", "format": "int64" }, "openExceptionCount": { "type": "integer", "format": "int64" }, "externalPositionStatus": { "type": "string" } } },
      "LoanJournalLeg": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "lineNumber",
          "accountId",
          "accountClass",
          "direction",
          "amountMinorUnits"
        ],
        "properties": {
          "lineNumber": {
            "type": "integer",
            "minimum": 1
          },
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountClass": {
            "type": "string",
            "enum": [
              "ASSET",
              "LIABILITY"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "DEBIT",
              "CREDIT"
            ]
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          }
        }
      },
      "LoanPostingJournalEvidence": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "posting",
          "source",
          "kind",
          "currency",
          "actorId",
          "correlationId",
          "amountMinorUnits",
          "principalMinorUnits",
          "interestMinorUnits",
          "transactionTime",
          "receivedTime",
          "recordedTime",
          "effectiveDate",
          "accountingDate",
          "entries",
          "drawdownJournalId"
        ],
        "properties": {
          "posting": {
            "$ref": "#/components/schemas/WorkloadLoanDrawdownReceipt"
          },
          "source": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "providerId",
              "eventId"
            ],
            "properties": {
              "providerId": {
                "$ref": "#/components/schemas/Identifier"
              },
              "eventId": {
                "$ref": "#/components/schemas/Identifier"
              }
            }
          },
          "kind": {
            "type": "string",
            "enum": [
              "DRAWDOWN",
              "REPAYMENT"
            ]
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          },
          "actorId": {
            "$ref": "#/components/schemas/Identifier",
            "description": "Verified posting actor on the original journal."
          },
          "correlationId": {
            "$ref": "#/components/schemas/Identifier",
            "description": "Correlation identity persisted on the original journal."
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "principalMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "interestMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "receivedTime": {
            "type": "string",
            "format": "date-time"
          },
          "recordedTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "entries": {
            "type": "array",
            "minItems": 2,
            "maxItems": 3,
            "items": {
              "$ref": "#/components/schemas/LoanJournalLeg"
            }
          },
          "drawdownJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "correctionJournalId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "WorkloadLoanRepaymentRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "providerId",
          "eventId",
          "amountMinorUnits",
          "currency",
          "transactionTime",
          "effectiveDate",
          "accountingDate",
          "principalMinorUnits",
          "interestMinorUnits"
        ],
        "properties": {
          "providerId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "eventId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "principalMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "interestMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "WorkloadLoanRepaymentReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "originalCommandId",
          "journalId",
          "loanId",
          "depositAccountId",
          "principalAccountId",
          "interestReceivableAccountId"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "originalCommandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "loanId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "depositAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "principalAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "interestReceivableAccountId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "WorkloadLoanRepaymentEvidence": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "posting"
        ],
        "properties": {
          "posting": {
            "$ref": "#/components/schemas/WorkloadLoanRepaymentReceipt"
          },
          "correctionJournalId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "GuiExceptionEvent": { "type": "object", "required": ["id", "runId", "controlName", "code", "ownerCode", "severity", "detectedAt", "detailsJson"], "properties": { "id": { "$ref": "#/components/schemas/Identifier" }, "runId": { "type": "string" }, "controlName": { "type": "string" }, "code": { "type": "string" }, "sourceJournalId": { "type": ["string", "null"] }, "ownerCode": { "type": "string" }, "severity": { "type": "string" }, "detectedAt": { "type": "string", "format": "date-time" }, "detailsJson": { "type": "string" } } },
      "GuiGlEvent": { "type": "object", "required": ["id", "periodStart", "periodEnd", "exportVersion", "mappingVersion", "journalWatermark", "journalCount", "entryCount", "debitMinorUnits", "creditMinorUnits", "contentDigest", "createdAt"], "properties": { "id": { "$ref": "#/components/schemas/Identifier" }, "periodStart": { "$ref": "#/components/schemas/BusinessDate" }, "periodEnd": { "$ref": "#/components/schemas/BusinessDate" }, "exportVersion": { "type": "integer" }, "mappingVersion": { "type": "string" }, "journalWatermark": { "type": "integer", "format": "int64" }, "journalCount": { "type": "integer", "format": "int64" }, "entryCount": { "type": "integer", "format": "int64" }, "debitMinorUnits": { "type": "string" }, "creditMinorUnits": { "type": "string" }, "contentDigest": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "dispatchId": { "type": ["string", "null"] }, "latestAttempt": { "type": ["string", "null"] }, "transportOutcome": { "type": ["string", "null"] }, "validationOutcome": { "type": ["string", "null"] }, "postingOutcome": { "type": ["string", "null"] }, "externalJournalReference": { "type": ["string", "null"] } } },
      "GuiOperationsOverview": { "type": "object", "required": ["observedAt", "calculationCount", "recognitionCount", "capitalizationCount", "openAccountingDays", "incompleteProductCloses", "openReconciliationExceptions", "unpostedGlExports"], "properties": { "observedAt": { "type": "string", "format": "date-time" }, "calculationCount": { "type": "integer", "format": "int64" }, "recognitionCount": { "type": "integer", "format": "int64" }, "capitalizationCount": { "type": "integer", "format": "int64" }, "openAccountingDays": { "type": "integer", "format": "int64" }, "incompleteProductCloses": { "type": "integer", "format": "int64" }, "openReconciliationExceptions": { "type": "integer", "format": "int64" }, "unpostedGlExports": { "type": "integer", "format": "int64" }, "latestCalculationAt": { "type": ["string", "null"], "format": "date-time" }, "latestReconciliationAt": { "type": ["string", "null"], "format": "date-time" }, "latestGlExportAt": { "type": ["string", "null"], "format": "date-time" } } },
      "GuiProductCloseDetail": { "type": "object", "required": ["progress", "days"], "properties": { "progress": { "type": "object", "description": "Source-validated existing ProductPeriodCloseProgress, including request digest, stage, revision, all frozen members and outcomes." }, "days": { "type": "array", "minItems": 28, "maxItems": 31, "items": { "type": "object", "required": ["accountingDate", "closeId", "journalWatermark"], "properties": { "accountingDate": { "$ref": "#/components/schemas/BusinessDate" }, "closeId": { "$ref": "#/components/schemas/Identifier" }, "journalWatermark": { "type": "integer", "format": "int64" } } } } } },
      "GuiGlDetail": { "type": "object", "required": ["page"], "properties": { "page": { "type": "object", "description": "Source-validated existing GlExportPage with bounded rows, entries and cursor." }, "dispatch": { "type": ["object", "null"], "description": "Existing GlDispatchEvidence with all attempts and independent transport, validation and posting receipts." } } },
      "CreateGuiOperatorActionRequest": { "type": "object", "additionalProperties": false, "required": ["kind"], "properties": {
        "kind": { "type": "string", "enum": ["CREATE_BATCH", "SETTLE_MEMBER"] },
        "batchReference": { "$ref": "#/components/schemas/Identifier" },
        "dispatchIds": { "type": "array", "minItems": 1, "maxItems": 20, "uniqueItems": true, "items": { "$ref": "#/components/schemas/Identifier" } },
        "batchId": { "$ref": "#/components/schemas/Identifier" },
        "memberMessageId": { "$ref": "#/components/schemas/Identifier" },
        "importJobId": { "$ref": "#/components/schemas/Identifier" }
      } },
      "GuiOperatorActionView": { "type": "object", "required": ["action"], "properties": {
        "action": { "$ref": "#/components/schemas/GuiOperatorAction" },
        "attempts": { "type": ["array", "null"], "maxItems": 100, "items": { "type": "object" } }
      } },
      "GuiOperatorAction": { "type": "object", "required": ["id", "actorId", "actorGrantVersion", "clientKey", "kind", "businessKey", "inputDigest", "status", "attemptCount", "createdAt"], "properties": {
        "id": { "$ref": "#/components/schemas/Identifier" }, "actorId": { "$ref": "#/components/schemas/Identifier" },
        "actorGrantVersion": { "type": "integer", "format": "int64" }, "clientKey": { "$ref": "#/components/schemas/Identifier" },
        "kind": { "type": "string", "enum": ["CREATE_BATCH", "SETTLE_MEMBER"] }, "businessKey": { "$ref": "#/components/schemas/Identifier" },
        "batchReference": { "type": ["string", "null"] }, "dispatchIds": { "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Identifier" } },
        "batchId": { "type": ["string", "null"] }, "memberMessageId": { "type": ["string", "null"] },
        "importJobId": { "type": ["string", "null"] }, "inputDigest": { "type": "string", "description": "Base64 SHA-256 of frozen action input" },
        "status": { "type": "string", "enum": ["QUEUED", "PROCESSING", "SUCCEEDED", "FAILED"] },
        "attemptCount": { "type": "integer" }, "lastError": { "type": ["string", "null"] },
        "resultId": { "type": ["string", "null"] }, "resultJson": { "type": ["string", "null"] },
        "createdAt": { "type": "string", "format": "date-time" }, "finishedAt": { "type": ["string", "null"], "format": "date-time" }
      } },
      "GuiReportSourcePage": { "type": "object", "required": ["sources", "observedAt"], "properties": {
        "sources": { "type": "array", "maxItems": 50, "items": { "$ref": "#/components/schemas/GuiReportSource" } },
        "nextPageToken": { "type": ["string", "null"] }, "observedAt": { "type": "string", "format": "date-time" }
      } },
      "GuiReportSource": { "type": "object", "required": ["id", "accountId", "kind", "status", "sourceDigest", "entryCount", "createdAt"], "properties": {
        "id": { "$ref": "#/components/schemas/Identifier" }, "accountId": { "$ref": "#/components/schemas/Identifier" },
        "kind": { "type": "string", "enum": ["STATEMENT", "INTRADAY", "NOTIFICATION"] },
        "status": { "type": "string", "enum": ["PROVISIONAL", "FINAL", "SEALED"] },
        "sourceDigest": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
        "entryCount": { "type": "integer", "format": "int64" }, "createdAt": { "type": "string", "format": "date-time" }
      } },
      "SimulateBatchStatusRequest": { "type": "object", "additionalProperties": false, "required": ["reportId", "createdAt", "decisions"], "properties": {
        "reportId": { "$ref": "#/components/schemas/Identifier" }, "createdAt": { "type": "string", "format": "date-time" },
        "decisions": { "type": "array", "minItems": 1, "maxItems": 20, "items": { "type": "object", "required": ["messageId", "outcome"], "properties": {
          "messageId": { "$ref": "#/components/schemas/Identifier" }, "outcome": { "type": "string", "enum": ["ACCEPTED", "REJECTED"] }
        } } }
      } },
      "FileImportJob": { "type": "object", "required": ["id", "originalName", "batchId", "profile", "sha256", "sizeBytes", "status", "members", "published", "attemptCount", "createdAt"], "properties": {
        "id": { "$ref": "#/components/schemas/Identifier" }, "originalName": { "type": "string" }, "batchId": { "$ref": "#/components/schemas/Identifier" },
        "reportId": { "type": ["string", "null"] }, "profile": { "type": "string", "enum": ["pain.002.001.10"] },
        "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "sizeBytes": { "type": "integer", "minimum": 1, "maximum": 262144 },
        "status": { "type": "string", "enum": ["INVALID", "READY", "QUEUED", "PROCESSING", "SUCCEEDED", "FAILED"] },
        "validationError": { "type": ["string", "null"] }, "members": { "type": "array", "maxItems": 20, "items": { "type": "object" } },
        "receiptCount": { "type": ["integer", "null"] }, "published": { "type": "boolean" }, "artifactId": { "type": ["string", "null"] },
        "attemptCount": { "type": "integer" }, "lastError": { "type": ["string", "null"] }, "result": { "type": ["object", "null"] },
        "createdAt": { "type": "string", "format": "date-time" }, "confirmedAt": { "type": ["string", "null"], "format": "date-time" },
        "finishedAt": { "type": ["string", "null"], "format": "date-time" },
        "attempts": { "type": ["array", "null"], "items": { "type": "object" } }
      } },
      "FileArtifact": { "type": "object", "required": ["id", "relativeKey", "direction", "profile", "mediaType", "syntaxStatus", "sizeBytes", "sha256", "discoveredAt"], "properties": {
        "id": { "$ref": "#/components/schemas/Identifier" }, "relativeKey": { "type": "string", "maxLength": 256 },
        "direction": { "type": "string", "enum": ["IN", "OUT"] }, "profile": { "type": "string" },
        "mediaType": { "type": "string", "enum": ["application/xml", "application/json"] },
        "messageReference": { "type": ["string", "null"] }, "originalMessageReference": { "type": ["string", "null"] },
        "syntaxStatus": { "type": "string", "enum": ["WELL_FORMED", "INVALID"] },
        "sizeBytes": { "type": "integer", "minimum": 1, "maximum": 4194304 }, "sha256": { "type": "string", "description": "Base64-encoded SHA-256 bytes" },
        "originalName": { "type": ["string", "null"] }, "discoveredAt": { "type": "string", "format": "date-time" }
      } },
      "FileArtifactPage": { "type": "object", "required": ["files", "observedAt"], "properties": {
        "files": { "type": "array", "items": { "$ref": "#/components/schemas/FileArtifact" } },
        "nextPageToken": { "type": ["string", "null"] }, "observedAt": { "type": "string", "format": "date-time" }
      } },
      "FileArtifactDetail": { "type": "object", "required": ["file", "preview", "observedAt"], "properties": {
        "file": { "$ref": "#/components/schemas/FileArtifact" },
        "preview": { "type": "array", "maxItems": 30, "items": { "type": "object", "required": ["name", "value"], "properties": { "name": { "type": "string" }, "value": { "type": "string" } } } },
        "parseError": { "type": ["string", "null"] },
        "source": { "type": ["object", "null"], "properties": { "kind": { "type": "string", "enum": ["PAYMENT", "BATCH", "ACCOUNT"] }, "id": { "$ref": "#/components/schemas/Identifier" } } },
        "observedAt": { "type": "string", "format": "date-time" }
      } },
      "PaymentReadEntry": { "type": "object", "required": ["kind", "id", "reference", "senderAccountId", "amountMinorUnits", "currency", "status", "receivedAt"], "properties": {
        "kind": { "type": "string", "enum": ["INTERNAL", "OUTBOUND"] }, "id": { "$ref": "#/components/schemas/Identifier" },
        "reference": { "$ref": "#/components/schemas/Identifier" }, "senderAccountId": { "$ref": "#/components/schemas/Identifier" },
        "receiverAccountId": { "type": ["string", "null"] }, "counterpartyReference": { "type": ["string", "null"] },
        "amountMinorUnits": { "type": "integer", "format": "int64" }, "currency": { "type": "string", "enum": ["NOK"] },
        "status": { "type": "string" }, "bookingJournalId": { "type": ["string", "null"] },
        "receivedAt": { "type": "string", "format": "date-time" }
      } },
      "PaymentReadPage": { "type": "object", "required": ["payments", "observedAt"], "properties": {
        "payments": { "type": "array", "items": { "$ref": "#/components/schemas/PaymentReadEntry" } },
        "nextPageToken": { "type": ["string", "null"] }, "observedAt": { "type": "string", "format": "date-time" }
      } },
      "PaymentReadEvent": { "type": "object", "required": ["stage", "status", "occurredAt"], "properties": {
        "stage": { "type": "string" }, "status": { "type": "string" }, "occurredAt": { "type": "string", "format": "date-time" },
        "evidenceId": { "type": ["string", "null"] }, "journalId": { "type": ["string", "null"] },
        "reasonCode": { "type": ["string", "null"] }
      } },
      "PaymentReadFinding": { "type": "object", "required": ["findingId", "runId", "exceptionCode", "detectedAt"], "properties": {
        "findingId": { "$ref": "#/components/schemas/Identifier" }, "runId": { "$ref": "#/components/schemas/Identifier" },
        "exceptionCode": { "type": "string" }, "detectedAt": { "type": "string", "format": "date-time" }
      } },
      "PaymentReadDetail": { "type": "object", "required": ["payment", "events", "findings", "observedAt"], "properties": {
        "payment": { "$ref": "#/components/schemas/PaymentReadEntry" }, "dispatchId": { "type": ["string", "null"] },
        "messageId": { "type": ["string", "null"] }, "receiverContract": { "type": ["string", "null"] },
        "dispatchOutcome": { "type": ["string", "null"] }, "positionStatus": { "type": ["string", "null"] },
        "batchId": { "type": ["string", "null"] }, "batchOrdinal": { "type": ["integer", "null"] },
        "events": { "type": "array", "items": { "$ref": "#/components/schemas/PaymentReadEvent" } },
        "findings": { "type": "array", "items": { "$ref": "#/components/schemas/PaymentReadFinding" } },
        "observedAt": { "type": "string", "format": "date-time" }
      } },
      "PaymentBatchReadEntry": { "type": "object", "required": ["batchId", "batchReference", "messageId", "memberCount", "amountMinorUnits", "currency", "createdAt"], "properties": {
        "batchId": { "$ref": "#/components/schemas/Identifier" }, "batchReference": { "$ref": "#/components/schemas/Identifier" },
        "messageId": { "$ref": "#/components/schemas/Identifier" }, "memberCount": { "type": "integer" },
        "amountMinorUnits": { "type": "integer", "format": "int64" }, "currency": { "type": "string", "enum": ["NOK"] },
        "createdAt": { "type": "string", "format": "date-time" }
      } },
      "PaymentBatchReadPage": { "type": "object", "required": ["batches", "observedAt"], "properties": {
        "batches": { "type": "array", "items": { "$ref": "#/components/schemas/PaymentBatchReadEntry" } },
        "nextPageToken": { "type": ["string", "null"] }, "observedAt": { "type": "string", "format": "date-time" }
      } },
      "PaymentBatchMemberRead": { "type": "object", "required": ["ordinal", "payment", "dispatchId", "dispatchOutcome", "positionStatus", "findingCount"], "properties": {
        "ordinal": { "type": "integer" }, "payment": { "$ref": "#/components/schemas/PaymentReadEntry" },
        "dispatchId": { "$ref": "#/components/schemas/Identifier" }, "dispatchOutcome": { "type": "string" },
        "receiverReceiptId": { "type": ["string", "null"] }, "positionStatus": { "type": "string" },
        "reportId": { "type": ["string", "null"] }, "reportOutcome": { "type": ["string", "null"] },
        "reportDetailCode": { "type": ["string", "null"] }, "reportRecordedAt": { "type": ["string", "null"], "format": "date-time" },
        "appliedAt": { "type": ["string", "null"], "format": "date-time" },
        "settlementStatus": { "type": ["string", "null"] }, "returnStatus": { "type": ["string", "null"] },
        "findingCount": { "type": "integer" }
      } },
      "PaymentBatchReadDetail": { "type": "object", "required": ["batch", "members", "observedAt"], "properties": {
        "batch": { "$ref": "#/components/schemas/PaymentBatchReadEntry" },
        "members": { "type": "array", "items": { "$ref": "#/components/schemas/PaymentBatchMemberRead" } },
        "observedAt": { "type": "string", "format": "date-time" }
      } },
      "SourceReferences": {
        "type": "array",
        "maxItems": 8,
        "uniqueItems": true,
        "items": {
          "$ref": "#/components/schemas/SourceReference"
        },
        "description": "Unordered set, persisted before posting and then immutable. Omitted/empty preserves legacy hashes. Reversals do not inherit original references."
      },
      "SourceReference": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "system",
          "type",
          "value"
        ],
        "properties": {
          "system": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
          },
          "type": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
          },
          "value": {
            "type": "string",
            "pattern": "^[!-~]{1,128}$"
          }
        },
        "description": "Case-sensitive opaque source lineage, not request idempotency or authority. A triple may identify several journals."
      },
      "Identifier": {
        "type": "string",
        "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
      },
      "ReasonCode": {
        "type": "string",
        "pattern": "^[A-Z][A-Z0-9_]{0,63}$"
      },
      "Currency": {
        "type": "string",
        "const": "NOK"
      },
      "LedgerUnitCode": {
        "type": "string",
        "pattern": "^[A-Z][A-Z0-9_]{0,31}$",
        "description": "A registered ledger unit such as NOK, PLING or STJERNE. Amounts are expressed in the smallest unit defined by its scale."
      },
      "MinorUnits": {
        "type": "integer",
        "format": "int64",
        "minimum": 1
      },
      "BusinessDate": {
        "type": "string",
        "format": "date"
      },
      "ReceiveWorkloadPaymentInstructionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "instructionReference",
          "receiverAccountId",
          "amountMinorUnits",
          "currency",
          "transactionTime",
          "effectiveDate",
          "accountingDate"
        ],
        "properties": {
          "instructionReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "receiverAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "amountMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "currency": {
            "const": "NOK"
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          }
        }
      },
      "WorkloadPaymentInstructionReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "instructionId",
          "instructionReference",
          "status"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "instructionId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "instructionReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "status": {
            "type": "string",
            "enum": [
              "RECEIVED",
              "COMPLETED",
              "REJECTED",
              "CANCELED"
            ]
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "outcomeReason": {
            "type": "string"
          }
        }
      },
      "WorkloadPaymentInstructionEvidence": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "instruction",
          "receiveCommandId"
        ],
        "properties": {
          "instruction": {
            "$ref": "#/components/schemas/WorkloadPaymentInstruction"
          },
          "receiveCommandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "terminalCommandId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "WorkloadPaymentInstruction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "instructionId",
          "instructionReference",
          "senderAccountId",
          "receiverAccountId",
          "amountMinorUnits",
          "currency",
          "time",
          "status",
          "receivedAt"
        ],
        "properties": {
          "instructionId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "instructionReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "senderAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "receiverAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "amountMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "currency": {
            "const": "NOK"
          },
          "time": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "transactionTime",
              "effectiveDate",
              "accountingDate"
            ],
            "properties": {
              "transactionTime": {
                "type": "string",
                "format": "date-time"
              },
              "effectiveDate": {
                "$ref": "#/components/schemas/BusinessDate"
              },
              "accountingDate": {
                "$ref": "#/components/schemas/BusinessDate"
              }
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "RECEIVED",
              "COMPLETED",
              "REJECTED",
              "CANCELED"
            ]
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "outcomeReason": {
            "type": "string"
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time"
          },
          "terminalAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ReceiveWorkloadOutboundPaymentRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["instructionReference", "counterpartyReference", "amountMinorUnits", "currency", "transactionTime", "effectiveDate", "accountingDate"],
        "properties": {
          "instructionReference": { "$ref": "#/components/schemas/Identifier" },
          "counterpartyReference": { "$ref": "#/components/schemas/Identifier" },
          "amountMinorUnits": { "$ref": "#/components/schemas/MinorUnits" },
          "currency": { "$ref": "#/components/schemas/Currency" },
          "transactionTime": { "type": "string", "format": "date-time" },
          "effectiveDate": { "$ref": "#/components/schemas/BusinessDate" },
          "accountingDate": { "$ref": "#/components/schemas/BusinessDate" }
        }
      },
      "OutboundPaymentReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": ["commandId", "instructionId", "instructionReference", "senderAccountId", "counterpartyReference", "amountMinorUnits", "currency", "status"],
        "properties": {
          "commandId": { "$ref": "#/components/schemas/Identifier", "description": "The command receipt associated with this operation key." },
          "instructionId": { "$ref": "#/components/schemas/Identifier" },
          "instructionReference": { "$ref": "#/components/schemas/Identifier" },
          "senderAccountId": { "$ref": "#/components/schemas/Identifier" },
          "counterpartyReference": { "$ref": "#/components/schemas/Identifier" },
          "amountMinorUnits": { "$ref": "#/components/schemas/MinorUnits" },
          "currency": { "$ref": "#/components/schemas/Currency" },
          "status": { "type": "string", "enum": ["RECEIVED", "BOOKED", "BOOKING_REJECTED"] },
          "bookingJournalId": { "$ref": "#/components/schemas/Identifier" },
          "dispatchId": { "$ref": "#/components/schemas/Identifier" },
          "messageId": { "$ref": "#/components/schemas/Identifier" },
          "outcomeReason": { "$ref": "#/components/schemas/ReasonCode" }
        }
      },
      "WorkloadOutboundBookingReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": ["payment", "bookingCommandId"],
        "properties": {
          "payment": {
            "$ref": "#/components/schemas/OutboundPaymentReceipt",
            "properties": { "status": { "enum": ["BOOKED", "BOOKING_REJECTED"] } }
          },
          "bookingCommandId": { "$ref": "#/components/schemas/Identifier", "description": "The original terminal booking decision command, shared by every receipt for this decision." }
        }
      },
      "SendSyntheticOutboundDispatchRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "dispatchId"
        ],
        "properties": {
          "dispatchId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "SyntheticOutboundDispatchEvidence": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "payment",
          "dispatchOutcome",
          "positionStatus",
          "receiverContract",
          "requestDigest",
          "createdAt"
        ],
        "properties": {
          "payment": {
            "$ref": "#/components/schemas/OutboundPaymentReceipt"
          },
          "dispatchOutcome": {
            "type": "string",
            "enum": [
              "PENDING",
              "UNKNOWN",
              "ACCEPTED",
              "REJECTED"
            ]
          },
          "positionStatus": {
            "type": "string"
          },
          "correctionJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "receiverContract": {
            "type": "string",
            "enum": [
              "synthetic.payment.receiver.v1"
            ]
          },
          "receiverReceiptId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "requestDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "receiverResponseDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        }
      },
      "OutboundDispatchAttemptEvidence": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "attemptSequence",
          "outcome",
          "startedAt"
        ],
        "properties": {
          "attemptSequence": {
            "type": "integer",
            "format": "int32",
            "minimum": 1
          },
          "outcome": {
            "type": "string",
            "enum": [
              "STARTED",
              "UNKNOWN",
              "RECEIVED"
            ]
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SyntheticOutboundDispatchLookup": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "evidence"
        ],
        "properties": {
          "evidence": {
            "$ref": "#/components/schemas/SyntheticOutboundDispatchEvidence"
          },
          "latestAttempt": {
            "$ref": "#/components/schemas/OutboundDispatchAttemptEvidence"
          }
        }
      },
      "RecordSyntheticOutboundSettlementRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "dispatchId",
          "evidenceReference",
          "transportId",
          "amountMinorUnits",
          "currency",
          "occurredAt"
        ],
        "properties": {
          "dispatchId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "evidenceReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "transportId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time",
            "description": "Provider timestamp with offset and at most microsecond precision."
          }
        }
      },
      "SyntheticOutboundSettlementReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "evidenceId",
          "instructionId",
          "kind",
          "status",
          "positionStatus"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "evidenceId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "instructionId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "kind": {
            "type": "string",
            "enum": [
              "SETTLED"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "APPLIED",
              "REJECTED"
            ]
          },
          "outcomeReason": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "positionStatus": {
            "type": "string"
          }
        }
      },
      "SyntheticOutboundSettlementLookup": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "evidenceId",
          "instructionId",
          "senderAccountId",
          "instructionReference",
          "dispatchId",
          "bookingJournalId",
          "evidenceReference",
          "transportId",
          "settlementScope",
          "amountMinorUnits",
          "currency",
          "occurredAt",
          "status"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "evidenceId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "instructionId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "senderAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "instructionReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "bookingJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "dispatchId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "evidenceReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "transportId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time",
            "description": "Provider timestamp with offset and at most microsecond precision."
          },
          "settlementScope": {
            "type": "string",
            "enum": [
              "synthetic.nok.v1"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "APPLIED",
              "REJECTED"
            ]
          },
          "outcomeReason": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "RecordSyntheticOutboundReturnRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "dispatchId",
          "evidenceReference",
          "transportId",
          "amountMinorUnits",
          "currency",
          "occurredAt",
          "settlementEvidenceReference"
        ],
        "properties": {
          "dispatchId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "evidenceReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "transportId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time",
            "description": "Provider timestamp with offset and at most microsecond precision."
          },
          "settlementEvidenceReference": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "OutboundReturnCreditExpectation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "attemptSequence"
        ],
        "properties": {
          "attemptSequence": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "description": "Zero means no previous credit attempt."
          },
          "attemptId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Identifier"
              },
              {
                "type": "null"
              }
            ],
            "description": "Required to match the exact latest attempt when the sequence is positive."
          }
        },
        "oneOf": [
          {
            "properties": {
              "attemptSequence": {
                "const": 0
              },
              "attemptId": {
                "type": "null"
              }
            }
          },
          {
            "required": [
              "attemptId"
            ],
            "properties": {
              "attemptSequence": {
                "minimum": 1
              },
              "attemptId": {
                "$ref": "#/components/schemas/Identifier"
              }
            }
          }
        ]
      },
      "CreditSyntheticOutboundReturnRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "returnId",
          "reasonCode"
        ],
        "properties": {
          "returnId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "expectedPreviousAttempt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OutboundReturnCreditExpectation"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional on legacy requests. When supplied, the exact latest attempt is checked under the return lock before a new decision."
          }
        }
      },
      "SyntheticOutboundReturnReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "evidenceId",
          "instructionId",
          "kind",
          "status",
          "positionStatus"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "evidenceId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "instructionId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "kind": {
            "type": "string",
            "enum": [
              "RETURNED"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "APPLIED",
              "REJECTED"
            ]
          },
          "outcomeReason": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "positionStatus": {
            "type": "string"
          },
          "returnId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "SyntheticOutboundReturnCreditReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "attemptId",
          "returnId",
          "outcome",
          "positionStatus"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "attemptId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "returnId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "outcome": {
            "type": "string",
            "enum": [
              "CREDITED",
              "REQUIRES_REVIEW"
            ]
          },
          "outcomeReason": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "positionStatus": {
            "type": "string"
          }
        }
      },
      "SyntheticOutboundReturnCreditAttempt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "attemptId",
          "commandId",
          "attemptSequence",
          "outcome",
          "attemptedAt"
        ],
        "properties": {
          "attemptId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "attemptSequence": {
            "type": "integer",
            "format": "int32",
            "minimum": 1
          },
          "outcome": {
            "type": "string",
            "enum": [
              "CREDITED",
              "REQUIRES_REVIEW"
            ]
          },
          "outcomeReason": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "attemptedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SyntheticOutboundReturnLookup": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "evidenceId",
          "instructionId",
          "senderAccountId",
          "instructionReference",
          "dispatchId",
          "settlementEvidenceId",
          "settlementJournalId",
          "evidenceReference",
          "transportId",
          "settlementScope",
          "amountMinorUnits",
          "currency",
          "occurredAt",
          "status",
          "positionStatus"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "evidenceId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "instructionId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "senderAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "instructionReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "settlementEvidenceId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "settlementJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "returnId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "returnPayableAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "cashReceiptJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "creditJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "dispatchId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "evidenceReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "transportId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time",
            "description": "Provider timestamp with offset and at most microsecond precision."
          },
          "settlementScope": {
            "type": "string",
            "enum": [
              "synthetic.nok.v1"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "APPLIED",
              "REJECTED"
            ]
          },
          "outcomeReason": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "positionStatus": {
            "type": "string"
          },
          "returnStatus": {
            "type": "string",
            "enum": [
              "CREDIT_PENDING",
              "REQUIRES_REVIEW",
              "CREDITED"
            ]
          },
          "latestCreditAttempt": {
            "$ref": "#/components/schemas/SyntheticOutboundReturnCreditAttempt"
          }
        }
      },
      "OutboundBookingLookup": {
        "type": "object",
        "additionalProperties": false,
        "required": ["instructionId", "instructionReference", "senderAccountId", "counterpartyReference", "amountMinorUnits", "currency",
          "transactionTime", "effectiveDate", "accountingDate", "observedAccountingDate", "status", "receiveCommandId"],
        "properties": {
          "instructionId": { "$ref": "#/components/schemas/Identifier" },
          "instructionReference": { "$ref": "#/components/schemas/Identifier" },
          "senderAccountId": { "$ref": "#/components/schemas/Identifier" },
          "counterpartyReference": { "$ref": "#/components/schemas/Identifier" },
          "amountMinorUnits": { "$ref": "#/components/schemas/MinorUnits" },
          "currency": { "$ref": "#/components/schemas/Currency" },
          "transactionTime": { "type": "string", "format": "date-time" },
          "effectiveDate": { "$ref": "#/components/schemas/BusinessDate" },
          "accountingDate": { "$ref": "#/components/schemas/BusinessDate", "description": "The frozen accounting date of the instruction." },
          "observedAccountingDate": { "$ref": "#/components/schemas/BusinessDate", "description": "Oslo date observed by the ledger for this read." },
          "status": { "type": "string", "enum": ["RECEIVED", "BOOKED", "BOOKING_REJECTED"] },
          "receiveCommandId": { "$ref": "#/components/schemas/Identifier" },
          "bookingCommandId": { "$ref": "#/components/schemas/Identifier" },
          "bookingJournalId": { "$ref": "#/components/schemas/Identifier" },
          "outcomeReason": { "$ref": "#/components/schemas/ReasonCode" }
        }
      },
      "CreateGuiWriteIntentRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["kind"],
        "properties": {
          "kind": { "type": "string", "enum": ["account", "funding", "transfer", "outbound"] },
          "customerId": { "oneOf": [{ "$ref": "#/components/schemas/Identifier" }, { "type": "null" }] },
          "accountId": { "oneOf": [{ "$ref": "#/components/schemas/Identifier" }, { "type": "null" }] },
          "receiverAccountId": { "oneOf": [{ "$ref": "#/components/schemas/Identifier" }, { "type": "null" }] },
          "counterpartyReference": { "oneOf": [{ "$ref": "#/components/schemas/Identifier" }, { "type": "null" }] },
          "amountMinorUnits": { "oneOf": [{ "type": "integer", "format": "int64", "minimum": 1 }, { "type": "null" }] }
        }
      },
      "GuiWriteIntent": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "kind", "createdAt"],
        "properties": {
          "id": { "$ref": "#/components/schemas/Identifier" },
          "kind": { "type": "string", "enum": ["ACCOUNT", "FUNDING", "TRANSFER", "OUTBOUND"] },
          "customerId": { "oneOf": [{ "$ref": "#/components/schemas/Identifier" }, { "type": "null" }] },
          "accountId": { "oneOf": [{ "$ref": "#/components/schemas/Identifier" }, { "type": "null" }] },
          "receiverAccountId": { "oneOf": [{ "$ref": "#/components/schemas/Identifier" }, { "type": "null" }] },
          "counterpartyReference": { "oneOf": [{ "$ref": "#/components/schemas/Identifier" }, { "type": "null" }] },
          "amountMinorUnits": { "oneOf": [{ "type": "integer", "format": "int64", "minimum": 1 }, { "type": "null" }] },
          "transactionTime": { "oneOf": [{ "type": "string", "format": "date-time" }, { "type": "null" }] },
          "accountingDate": { "oneOf": [{ "$ref": "#/components/schemas/BusinessDate" }, { "type": "null" }] },
          "resultId": { "oneOf": [{ "$ref": "#/components/schemas/Identifier" }, { "type": "null" }] },
          "createdAt": { "type": "string", "format": "date-time" }
        }
      },
      "GuiWriteIntentList": {
        "type": "object",
        "additionalProperties": false,
        "required": ["operations"],
        "properties": { "operations": { "type": "array", "maxItems": 20, "items": { "$ref": "#/components/schemas/GuiWriteIntent" } } }
      },
      "CreateGuiLifecycleIntentRequest": {
        "type": "object", "additionalProperties": false, "required": ["kind", "targetId", "input"],
        "properties": {
          "kind": { "type": "string", "enum": ["RESERVATION_CREATE", "RESERVATION_CHANGE", "RESERVATION_RELEASE", "PROSPECT_CREATE", "PROSPECT_ACTIVATE", "TERMS_CHANGE", "RESTRICTION_APPLY", "RESTRICTION_RELEASE"] },
          "targetId": { "$ref": "#/components/schemas/Identifier" },
          "input": { "$ref": "#/components/schemas/GuiLifecycleInput" }
        }
      },
      "GuiLifecycleInput": {
        "type": "object", "additionalProperties": false,
        "properties": {
          "expectedVersion": { "type": ["integer", "null"], "format": "int64", "minimum": 0 },
          "amountMinorUnits": { "type": ["integer", "null"], "format": "int64", "minimum": 1 },
          "expiresAt": { "type": ["string", "null"], "format": "date-time" },
          "externalSystem": { "oneOf": [{ "$ref": "#/components/schemas/Identifier" }, { "type": "null" }] },
          "externalReference": { "oneOf": [{ "$ref": "#/components/schemas/Identifier" }, { "type": "null" }] },
          "reasonCode": { "type": ["string", "null"] },
          "productCode": { "type": ["string", "null"] },
          "productVersion": { "type": ["string", "null"] },
          "interestMode": { "type": ["string", "null"] },
          "effectiveDate": { "type": ["string", "null"], "format": "date" },
          "rateProfileId": { "oneOf": [{ "$ref": "#/components/schemas/Identifier" }, { "type": "null" }] },
          "mode": { "type": ["string", "null"] }
        }
      },
      "GuiLifecycleIntent": {
        "type": "object", "additionalProperties": false, "required": ["id", "kind", "targetId", "input", "complete", "createdAt"],
        "properties": {
          "id": { "$ref": "#/components/schemas/Identifier" },
          "kind": { "type": "string" },
          "targetId": { "$ref": "#/components/schemas/Identifier" },
          "input": { "$ref": "#/components/schemas/GuiLifecycleInput" },
          "resultId": { "oneOf": [{ "$ref": "#/components/schemas/Identifier" }, { "type": "null" }] },
          "resultVersion": { "type": ["integer", "null"], "format": "int64" },
          "complete": { "type": "boolean" },
          "createdAt": { "type": "string", "format": "date-time" }
        }
      },
      "GuiLifecycleIntentList": {
        "type": "object", "additionalProperties": false, "required": ["operations"],
        "properties": { "operations": { "type": "array", "maxItems": 20, "items": { "$ref": "#/components/schemas/GuiLifecycleIntent" } } }
      },
      "DepositProspectSummary": {
        "type": "object", "additionalProperties": false,
        "required": ["prospectId", "customerId", "state", "version", "actorId", "reasonCode", "createdAt"],
        "properties": {
          "prospectId": { "$ref": "#/components/schemas/Identifier" },
          "customerId": { "$ref": "#/components/schemas/Identifier" },
          "state": { "type": "string", "enum": ["PROSPECT", "ACTIVATED"] },
          "version": { "type": "integer", "format": "int64" },
          "accountId": { "oneOf": [{ "$ref": "#/components/schemas/Identifier" }, { "type": "null" }] },
          "actorId": { "$ref": "#/components/schemas/Identifier" },
          "reasonCode": { "type": "string" },
          "createdAt": { "type": "string", "format": "date-time" },
          "activatedAt": { "type": ["string", "null"], "format": "date-time" }
        }
      },
      "DepositProspectPage": {
        "type": "object", "additionalProperties": false, "required": ["prospects", "observedAt"],
        "properties": {
          "prospects": { "type": "array", "maxItems": 50, "items": { "$ref": "#/components/schemas/DepositProspectSummary" } },
          "nextPageToken": { "type": ["string", "null"] },
          "observedAt": { "type": "string", "format": "date-time" }
        }
      },
      "OpenAccountRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "currency"
        ],
        "properties": {
          "currency": {
            "$ref": "#/components/schemas/LedgerUnitCode"
          },
          "customerId": {
            "type": "string",
            "pattern": "^([A-Za-z0-9][A-Za-z0-9._:-]{0,127})?$",
            "description": "Optional opaque synthetic customer reference; empty or omitted allocates a new synthetic reference. This is not an access claim."
          }
        }
      },
      "CloseAccountRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["expectedVersion", "effectiveDate", "reasonCode", "approvalReference"],
        "properties": {
          "expectedVersion": { "type": "integer", "format": "int64", "minimum": 0 },
          "effectiveDate": { "$ref": "#/components/schemas/BusinessDate" },
          "reasonCode": { "$ref": "#/components/schemas/ReasonCode" },
          "approvalReference": {
            "allOf": [{ "$ref": "#/components/schemas/Identifier" }],
            "description": "Identifier of current immutable server-side approval evidence from a different authorized workload principal, bound to this exact account.close.v1 scope and input."
          },
          "expectedTerminalFenceVersion": { "oneOf": [{ "type": "integer", "format": "int64", "const": 1 }, { "type": "null" }] }
        }
      },
      "LedgerMetadata": {
        "type": "object",
        "maxProperties": 100,
        "additionalProperties": {
          "type": "string",
          "maxLength": 1024
        },
        "description": "Optional, case-sensitive integration keys. A key must be nonblank, contain no control characters and fit in 128 UTF-8 bytes. A value can have up to 1024 UTF-8 bytes. The JSON request limit is 64 KiB.",
        "example": {
          "checkout session": "session-123",
          "merchant.order-id": "order-456"
        }
      },
      "AppendLedgerMetadataRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "metadata"
        ],
        "properties": {
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/LedgerMetadata"
              }
            ],
            "minProperties": 1
          }
        }
      },
      "LedgerMetadataEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "value"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "LedgerMetadataPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entries"
        ],
        "properties": {
          "entries": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/LedgerMetadataEntry"
            }
          },
          "nextPageToken": {
            "type": "string"
          }
        }
      },
      "LedgerMetadataAppendResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "objectId",
          "addedCount"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "objectId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "addedCount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          }
        }
      },
      "PostingRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "amountMinorUnits",
          "currency",
          "transactionTime",
          "effectiveDate",
          "accountingDate"
        ],
        "properties": {
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "$ref": "#/components/schemas/LedgerUnitCode"
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate",
            "description": "New commands require the calendar date in Europe/Oslo at server receipt. Completed exact retries retain their original dates."
          },
          "sourceReferences": {
            "$ref": "#/components/schemas/SourceReferences"
          },
          "metadata": {
            "anyOf": [
              { "$ref": "#/components/schemas/LedgerMetadata" },
              { "type": "null" }
            ]
          }
        }
      },
      "TransferRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "senderAccountId",
          "receiverAccountId",
          "amountMinorUnits",
          "currency",
          "transactionTime",
          "effectiveDate",
          "accountingDate"
        ],
        "properties": {
          "senderAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "receiverAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "$ref": "#/components/schemas/LedgerUnitCode"
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate",
            "description": "New commands require the calendar date in Europe/Oslo at server receipt. Completed exact retries retain their original dates."
          },
          "sourceReferences": {
            "$ref": "#/components/schemas/SourceReferences"
          },
          "metadata": {
            "anyOf": [
              { "$ref": "#/components/schemas/LedgerMetadata" },
              { "type": "null" }
            ]
          }
        }
      },
      "ReversalRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reasonCode",
          "transactionTime",
          "effectiveDate",
          "accountingDate"
        ],
        "properties": {
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate",
            "description": "New commands require the calendar date in Europe/Oslo at server receipt. Completed exact retries retain their original dates."
          },
          "sourceReferences": {
            "$ref": "#/components/schemas/SourceReferences"
          },
          "metadata": {
            "anyOf": [
              { "$ref": "#/components/schemas/LedgerMetadata" },
              { "type": "null" }
            ]
          }
        }
      },
      "Account": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accountId",
          "legalEntityId",
          "currency",
          "accountClass",
          "status",
          "bookedMinorUnits",
          "availableMinorUnits",
          "version"
          ,"lifecycleVersion"
        ],
        "properties": {
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "customerId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "currency": {
            "$ref": "#/components/schemas/LedgerUnitCode"
          },
          "accountClass": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "bookedMinorUnits": {
            "type": "integer",
            "format": "int64"
          },
          "availableMinorUnits": {
            "type": "integer",
            "format": "int64"
          },
          "version": {
            "type": "integer",
            "format": "int64"
          },
          "lifecycleVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "Optimistic concurrency token for restriction and terminal lifecycle changes; distinct from the protected balance version."
          },
          "lastJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountReference": {
            "$ref": "#/components/schemas/Identifier",
            "description": "Opaque synthetic account reference; not a domestic account number. Absent on exact legacy command replays and internal accounts."
          }
        }
      },
      "JournalEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entryId",
          "lineNumber",
          "accountId",
          "accountClass",
          "direction",
          "amountMinorUnits"
        ],
        "properties": {
          "entryId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "lineNumber": {
            "type": "integer"
          },
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountClass": {
            "type": "string"
          },
          "direction": {
            "type": "string",
            "enum": [
              "DEBIT",
              "CREDIT"
            ]
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          }
        }
      },
      "Journal": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "journalId",
          "legalEntityId",
          "currency",
          "commandId",
          "businessEvent",
          "postingRuleVersion",
          "actorId",
          "correlationId",
          "causationId",
          "status",
          "transactionTime",
          "receivedTime",
          "recordedTime",
          "effectiveDate",
          "accountingDate",
          "entries"
        ],
        "properties": {
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "currency": {
            "$ref": "#/components/schemas/LedgerUnitCode"
          },
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "businessEvent": {
            "type": "string"
          },
          "postingRuleVersion": {
            "type": "string"
          },
          "actorId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "correlationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "causationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "status": {
            "type": "string",
            "const": "POSTED"
          },
          "reversalOfJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reversedByJournalId": {
            "$ref": "#/components/schemas/Identifier",
            "description": "Journal that reverses this original, when one exists. Additive read-only link; the reversal retains the original journal."
          },
          "reversalReasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "receivedTime": {
            "type": "string",
            "format": "date-time"
          },
          "recordedTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate",
            "description": "New commands require the calendar date in Europe/Oslo at server receipt. Completed exact retries retain their original dates."
          },
          "accountingDatePolicyVersion": {
            "type": "string",
            "description": "Immutable admission policy; absent for journals recorded before policy evidence was introduced."
          },
          "entries": {
            "type": "array",
            "minItems": 2,
            "items": {
              "$ref": "#/components/schemas/JournalEntry"
            }
          },
          "sourceReferences": {
            "$ref": "#/components/schemas/SourceReferences"
          }
        }
      },
      "JournalLookupPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "legalEntityId",
          "currency",
          "sourceReference",
          "watermarkJournalSequence",
          "journals"
        ],
        "properties": {
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "sourceReference": {
            "$ref": "#/components/schemas/SourceReference"
          },
          "watermarkJournalSequence": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "journals": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/JournalMatch"
            }
          },
          "nextPageToken": {
            "type": "string",
            "maxLength": 2048
          }
        }
      },
      "JournalMatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "journalId",
          "journalSequence",
          "businessEvent",
          "accountingDate"
        ],
        "properties": {
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "journalSequence": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "businessEvent": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "reversalOfJournalId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "IssueAccountStatementRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["periodEnd", "reasonCode", "approvalReference"],
        "properties": {
          "periodEnd": { "$ref": "#/components/schemas/BusinessDate" },
          "productPeriodCloseRunId": { "$ref": "#/components/schemas/Identifier" },
          "reasonCode": { "type": "string", "pattern": "^[A-Z][A-Z0-9_]{0,63}$" },
          "approvalReference": { "$ref": "#/components/schemas/Identifier" }
        }
      },
      "AccountStatementResult": {
        "type": "object",
        "additionalProperties": false,
        "required": ["commandId", "statementId", "accountId", "periodStart", "periodEnd", "statementVersion", "status", "watermarkJournalSequence", "contentDigest"],
        "properties": {
          "commandId": { "$ref": "#/components/schemas/Identifier" },
          "statementId": { "$ref": "#/components/schemas/Identifier" },
          "accountId": { "$ref": "#/components/schemas/Identifier" },
          "periodStart": { "$ref": "#/components/schemas/BusinessDate" },
          "periodEnd": { "$ref": "#/components/schemas/BusinessDate" },
          "statementVersion": { "type": "integer", "minimum": 1 },
          "status": { "type": "string", "enum": ["PROVISIONAL", "FINAL"] },
          "watermarkJournalSequence": { "type": "integer", "format": "int64", "minimum": 0 },
          "contentDigest": { "type": "string", "pattern": "^[0-9a-f]{64}$" }
        }
      },
      "AccountStatementPage": {
        "type": "object",
        "additionalProperties": false,
        "required": ["statement", "legalEntityId", "currency", "totals", "issuedAt", "interest", "corrections", "entries"],
        "properties": {
          "statement": { "$ref": "#/components/schemas/AccountStatementResult" },
          "legalEntityId": { "$ref": "#/components/schemas/Identifier" },
          "currency": { "$ref": "#/components/schemas/Currency" },
          "totals": { "$ref": "#/components/schemas/AccountHistoryTotals" },
          "productPeriodCloseRunId": { "$ref": "#/components/schemas/Identifier" },
          "issuedAt": { "type": "string", "format": "date-time" },
          "interest": { "type": "array", "items": { "$ref": "#/components/schemas/AccountStatementInterest" } },
          "corrections": { "type": "array", "items": { "$ref": "#/components/schemas/AccountStatementCorrection" } },
          "entries": { "type": "array", "maxItems": 100, "items": { "$ref": "#/components/schemas/AccountStatementEntry" } },
          "nextPageToken": { "type": "string", "minLength": 1, "maxLength": 2048 }
        }
      },
      "AccountStatementEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": ["ordinal", "entryId", "journalId", "journalSequence", "lineNumber", "businessEvent", "postingRuleVersion", "direction", "amountMinorUnits", "balanceChangeMinorUnits", "transactionTime", "recordedTime", "effectiveDate", "accountingDate", "receivedTime"],
        "properties": {
          "ordinal": { "type": "integer", "format": "int64", "minimum": 1 },
          "entryId": { "$ref": "#/components/schemas/Identifier" },
          "journalId": { "$ref": "#/components/schemas/Identifier" },
          "journalSequence": { "type": "integer", "format": "int64", "minimum": 1 },
          "lineNumber": { "type": "integer", "minimum": 1 },
          "businessEvent": { "$ref": "#/components/schemas/Identifier" },
          "postingRuleVersion": { "$ref": "#/components/schemas/Identifier" },
          "direction": { "type": "string", "enum": ["DEBIT", "CREDIT"] },
          "amountMinorUnits": { "$ref": "#/components/schemas/MinorUnits" },
          "balanceChangeMinorUnits": { "type": "integer", "format": "int64" },
          "transactionTime": { "type": "string", "format": "date-time" },
          "recordedTime": { "type": "string", "format": "date-time" },
          "effectiveDate": { "$ref": "#/components/schemas/BusinessDate" },
          "accountingDate": { "$ref": "#/components/schemas/BusinessDate" },
          "reversalOfJournalId": { "$ref": "#/components/schemas/Identifier" },
          "receivedTime": { "type": "string", "format": "date-time" }
        }
      },
      "AccountStatementInterest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["ordinal", "recognitionId", "periodStart", "periodEnd", "accruedNumerator", "denominator", "bookedMinorUnits", "residualNumerator"],
        "properties": {
          "ordinal": { "type": "integer", "format": "int64", "minimum": 1 },
          "recognitionId": { "$ref": "#/components/schemas/Identifier" },
          "periodStart": { "$ref": "#/components/schemas/BusinessDate" },
          "periodEnd": { "$ref": "#/components/schemas/BusinessDate" },
          "accruedNumerator": { "type": "string", "pattern": "^(0|[1-9][0-9]*)$" },
          "denominator": { "type": "integer", "format": "int64", "const": 365000000 },
          "bookedMinorUnits": { "type": "integer", "format": "int64", "minimum": 0 },
          "residualNumerator": { "type": "string", "pattern": "^(0|-?[1-9][0-9]*)$" },
          "recognitionJournalId": { "$ref": "#/components/schemas/Identifier" },
          "capitalizationId": { "$ref": "#/components/schemas/Identifier" },
          "capitalizationOutcome": { "type": "string", "enum": ["CAPITALIZED", "ZERO", "UNPAID_RESTRICTED", "UNPAID_CLOSED"] },
          "capitalizedMinorUnits": { "type": "integer", "format": "int64", "minimum": 0 },
          "capitalizationJournalId": { "$ref": "#/components/schemas/Identifier" }
        }
      },
      "AccountStatementCorrection": {
        "type": "object",
        "additionalProperties": false,
        "required": ["ordinal", "correctionId", "recognitionId", "sequence", "replacementSourceReference", "exactDifferenceNumerator", "denominator", "effectMinorUnits", "stage", "attemptId", "attemptSequence", "attemptOutcome"],
        "properties": {
          "ordinal": { "type": "integer", "format": "int64", "minimum": 1 },
          "correctionId": { "$ref": "#/components/schemas/Identifier" },
          "recognitionId": { "$ref": "#/components/schemas/Identifier" },
          "sequence": { "type": "integer", "format": "int64", "minimum": 1 },
          "replacementSourceReference": { "$ref": "#/components/schemas/Identifier" },
          "exactDifferenceNumerator": { "type": "string", "pattern": "^(0|-?[1-9][0-9]*)$" },
          "denominator": { "type": "integer", "format": "int64", "const": 365000000 },
          "effectMinorUnits": { "type": "integer", "format": "int64" },
          "stage": { "type": "string", "enum": ["PRE_CAPITALIZATION", "POST_CAPITALIZATION"] },
          "attemptId": { "$ref": "#/components/schemas/Identifier" },
          "attemptSequence": { "type": "integer", "format": "int64", "minimum": 1 },
          "attemptOutcome": { "type": "string", "enum": ["APPLIED", "ZERO", "UNRESOLVED_FUNDS", "UNRESOLVED_RESTRICTED", "UNRESOLVED_CLOSED", "REJECTED"] },
          "journalId": { "$ref": "#/components/schemas/Identifier" }
        }
      },
      "AccountHistoryPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accountId",
          "legalEntityId",
          "currency",
          "accountClass",
          "watermarkJournalSequence",
          "totals",
          "entries"
        ],
        "properties": {
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "currency": {
            "$ref": "#/components/schemas/LedgerUnitCode"
          },
          "accountClass": {
            "type": "string",
            "enum": [
              "ASSET",
              "LIABILITY",
              "EQUITY",
              "INCOME",
              "EXPENSE"
            ]
          },
          "from": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "to": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "watermarkJournalSequence": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "totals": {
            "$ref": "#/components/schemas/AccountHistoryTotals"
          },
          "entries": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/AccountHistoryEntry"
            }
          },
          "nextPageToken": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          }
        }
      },
      "AccountHistoryEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entryId",
          "journalId",
          "journalSequence",
          "lineNumber",
          "businessEvent",
          "postingRuleVersion",
          "direction",
          "amountMinorUnits",
          "balanceChangeMinorUnits",
          "transactionTime",
          "recordedTime",
          "effectiveDate",
          "accountingDate",
          "receivedTime"
        ],
        "properties": {
          "entryId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "journalSequence": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "lineNumber": {
            "type": "integer",
            "minimum": 1
          },
          "businessEvent": {
            "$ref": "#/components/schemas/Identifier"
          },
          "postingRuleVersion": {
            "$ref": "#/components/schemas/Identifier"
          },
          "direction": {
            "type": "string",
            "enum": [
              "DEBIT",
              "CREDIT"
            ]
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "balanceChangeMinorUnits": {
            "type": "integer",
            "format": "int64"
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "recordedTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "reversalOfJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "receivedTime": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AccountHistoryTotals": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "openingBookedMinorUnits",
          "debitMinorUnits",
          "creditMinorUnits",
          "movementMinorUnits",
          "closingBookedMinorUnits",
          "entryCount"
        ],
        "properties": {
          "openingBookedMinorUnits": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$",
            "description": "Exact integer minor-unit aggregate, encoded as a string to avoid overflow or loss of precision."
          },
          "debitMinorUnits": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$",
            "description": "Exact integer minor-unit aggregate, encoded as a string to avoid overflow or loss of precision."
          },
          "creditMinorUnits": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$",
            "description": "Exact integer minor-unit aggregate, encoded as a string to avoid overflow or loss of precision."
          },
          "movementMinorUnits": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$",
            "description": "Exact integer minor-unit aggregate, encoded as a string to avoid overflow or loss of precision."
          },
          "closingBookedMinorUnits": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$",
            "description": "Exact integer minor-unit aggregate, encoded as a string to avoid overflow or loss of precision."
          },
          "entryCount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
        "CustomerDirectoryPage": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "customers"
          ],
          "properties": {
            "customers": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "$ref": "#/components/schemas/CustomerDirectoryEntry"
              }
            },
            "nextPageToken": {
              "type": "string",
              "maxLength": 2048
            }
          }
        },
        "CustomerDirectoryEntry": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "customerId",
            "visibleAccountCount"
          ],
          "properties": {
            "customerId": {
              "$ref": "#/components/schemas/Identifier"
            },
            "visibleAccountCount": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "description": "Count of accounts visible to this principal only"
            }
          }
        },
        "CustomerAccountPage": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "customerId",
            "accounts"
          ],
          "properties": {
            "customerId": {
              "$ref": "#/components/schemas/Identifier"
            },
            "accounts": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "$ref": "#/components/schemas/AccountDirectoryEntry"
              }
            },
            "nextPageToken": {
              "type": "string",
              "maxLength": 2048
            }
          }
        },
      "AccountSummaryPage": {
        "type": "object", "additionalProperties": false,
        "required": ["accounts"],
        "properties": {
          "accounts": { "type": "array", "maxItems": 100, "items": { "$ref": "#/components/schemas/AccountSummaryEntry" } },
          "nextPageToken": { "type": "string", "maxLength": 2048 }
        }
      },
      "AccountSummaryEntry": {
        "type": "object", "additionalProperties": false,
        "required": ["accountId", "customerId", "accountReference", "currency", "status", "bookedMinorUnits", "availableMinorUnits", "balanceUpdatedAt"],
        "properties": {
          "accountId": { "$ref": "#/components/schemas/Identifier" },
          "customerId": { "$ref": "#/components/schemas/Identifier" },
          "accountReference": { "$ref": "#/components/schemas/Identifier" },
          "currency": { "type": "string", "enum": ["NOK"] },
          "status": { "type": "string", "enum": ["OPEN", "FROZEN", "CLOSED"] },
          "bookedMinorUnits": { "type": "integer", "format": "int64" },
          "availableMinorUnits": { "type": "integer", "format": "int64" },
          "balanceUpdatedAt": { "type": "string", "format": "date-time", "description": "Last projection update; status can change independently" }
        }
      },
      "AccountDirectoryPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accounts"
        ],
        "properties": {
          "accounts": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/AccountDirectoryEntry"
            }
          },
          "nextPageToken": {
            "type": "string",
            "maxLength": 2048
          }
        }
      },
      "AccountDirectoryEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accountId",
          "customerId",
          "accountReference"
        ],
        "properties": {
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "customerId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountReference": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "DepositTermsPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accountId",
          "legalEntityId",
          "watermarkVersion",
          "terms"
        ],
        "properties": {
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "watermarkVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "terms": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/DepositTerms"
            }
          },
          "nextPageToken": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          }
        }
      },
      "DepositTerms": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accountId",
          "legalEntityId",
          "actorId",
          "correlationId",
          "productVersion",
          "version",
          "productCode",
          "interestMode",
          "effectiveDate",
          "recordedAt",
          "reasonCode",
          "origin"
        ],
        "properties": {
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "actorId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "correlationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "productVersion": {
            "$ref": "#/components/schemas/Identifier"
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "productCode": {
            "type": "string",
            "enum": [
              "deposit.nok"
            ]
          },
          "interestMode": {
            "type": "string",
            "enum": [
              "NONE",
              "DAILY_ACT365F"
            ]
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "origin": {
            "type": "string",
            "enum": [
              "MIGRATED_BASELINE",
              "ACCOUNT_OPENED",
              "TERMS_CHANGED"
            ]
          },
          "rateProfileId": {
            "$ref": "#/components/schemas/Identifier"
          }
        },
        "oneOf": [
          {
            "properties": {
              "interestMode": {
                "enum": [
                  "NONE"
                ]
              }
            },
            "not": {
              "required": [
                "rateProfileId"
              ]
            }
          },
          {
            "properties": {
              "interestMode": {
                "enum": [
                  "DAILY_ACT365F"
                ]
              },
              "productVersion": {
                "enum": [
                  "interest.act365f.v1"
                ]
              }
            },
            "required": [
              "rateProfileId"
            ]
          }
        ]
      },
      "ChangeDepositTermsResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "accountId",
          "version"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 2
          }
        }
      },
      "ChangeDepositTermsRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "expectedVersion",
          "productCode",
          "productVersion",
          "interestMode",
          "effectiveDate",
          "reasonCode"
        ],
        "properties": {
          "expectedVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 9223372036854775806
          },
          "productCode": {
            "type": "string",
            "enum": [
              "deposit.nok"
            ]
          },
          "productVersion": {
            "$ref": "#/components/schemas/Identifier"
          },
          "interestMode": {
            "type": "string",
            "enum": [
              "NONE",
              "DAILY_ACT365F"
            ]
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "rateProfileId": {
            "$ref": "#/components/schemas/Identifier"
          }
        },
        "oneOf": [
          {
            "properties": {
              "interestMode": {
                "enum": [
                  "NONE"
                ]
              }
            },
            "not": {
              "required": [
                "rateProfileId"
              ]
            }
          },
          {
            "properties": {
              "interestMode": {
                "enum": [
                  "DAILY_ACT365F"
                ]
              },
              "productVersion": {
                "enum": [
                  "interest.act365f.v1"
                ]
              }
            },
            "required": [
              "rateProfileId"
            ]
          }
        ]
      },
      "RestrictionResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "accountId",
          "version"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        }
      },
      "ReleaseRestrictionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "expectedVersion",
          "reasonCode"
        ],
        "properties": {
          "expectedVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "maximum": 9223372036854775806
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          }
        }
      },
      "RestrictionHistoryPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accountId",
          "legalEntityId",
          "watermarkVersion",
          "changes"
        ],
        "properties": {
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "watermarkVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RestrictionChange"
            }
          },
          "nextPageToken": {
            "type": "string"
          }
        }
      },
      "RestrictionChange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accountId",
          "legalEntityId",
          "version",
          "fromMode",
          "toMode",
          "effectiveAt",
          "recordedAt",
          "actorId",
          "reasonCode",
          "correlationId",
          "commandId"
        ],
        "properties": {
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "fromMode": {
            "type": "string",
            "enum": [
              "NONE",
              "DEBITS",
              "ALL"
            ]
          },
          "toMode": {
            "type": "string",
            "enum": [
              "NONE",
              "DEBITS",
              "ALL"
            ]
          },
          "effectiveAt": {
            "type": "string",
            "format": "date-time"
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          },
          "actorId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "correlationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "ApplyRestrictionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "expectedVersion",
          "mode",
          "reasonCode"
        ],
        "properties": {
          "expectedVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "maximum": 9223372036854775806
          },
          "mode": {
            "type": "string",
            "enum": [
              "DEBITS",
              "ALL"
            ]
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          }
        }
      },
      "RestrictionPolicy": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accountId",
          "legalEntityId",
          "accountStatus",
          "mode",
          "version"
        ],
        "properties": {
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountStatus": {
            "type": "string",
            "enum": [
              "OPEN",
              "FROZEN",
              "CLOSED"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "NONE",
              "DEBITS",
              "ALL"
            ]
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "lastChange": {
            "$ref": "#/components/schemas/RestrictionChange"
          }
        },
        "description": "Version zero derives policy from legacy status and has no fabricated change metadata. Existing FROZEN means ALL. CLOSED cannot be reopened by release."
      },
      "ActivateDepositProspectRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "expectedVersion",
          "reasonCode"
        ],
        "properties": {
          "expectedVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "reasonCode": {
            "type": "string",
            "pattern": "^[A-Z][A-Z0-9_]{0,63}$"
          }
        }
      },
      "DepositProspect": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "prospectId",
          "legalEntityId",
          "customerId",
          "currency",
          "productCode",
          "productVersion",
          "interestMode",
          "state",
          "version",
          "accountId",
          "creation",
          "activation"
        ],
        "properties": {
          "prospectId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "customerId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          },
          "productCode": {
            "type": "string",
            "enum": [
              "deposit.nok"
            ]
          },
          "productVersion": {
            "type": "string",
            "enum": [
              "non-interest.v1"
            ]
          },
          "interestMode": {
            "type": "string",
            "enum": [
              "NONE"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "PROSPECT",
              "ACTIVATED"
            ]
          },
          "version": {
            "type": "integer",
            "enum": [
              1,
              2
            ]
          },
          "accountId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Identifier"
              },
              {
                "type": "null"
              }
            ]
          },
          "creation": {
            "$ref": "#/components/schemas/DepositProspectEvidence"
          },
          "activation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DepositProspectEvidence"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "DepositProspectEvidence": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "recordedAt",
          "actorId",
          "reasonCode",
          "correlationId",
          "commandId"
        ],
        "properties": {
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          },
          "actorId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reasonCode": {
            "type": "string",
            "pattern": "^[A-Z][A-Z0-9_]{0,63}$"
          },
          "correlationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "CreateDepositProspectResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "prospectId",
          "version"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "prospectId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "version": {
            "type": "integer",
            "enum": [
              1
            ]
          }
        }
      },
      "CreateDepositProspectRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "customerId",
          "currency",
          "reasonCode"
        ],
        "properties": {
          "customerId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          },
          "reasonCode": {
            "type": "string",
            "pattern": "^[A-Z][A-Z0-9_]{0,63}$"
          }
        }
      },
      "AccountReservationsPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reservations",
          "watermarkSequence"
        ],
        "properties": {
          "reservations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Reservation"
            }
          },
          "watermarkSequence": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "nextPageToken": {
            "type": "string"
          }
        }
      },
      "Reservation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reservationId",
          "accountId",
          "legalEntityId",
          "currency",
          "externalReference",
          "createdAt",
          "status",
          "current"
        ],
        "properties": {
          "reservationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "currency": {
            "const": "NOK"
          },
          "externalReference": {
            "$ref": "#/components/schemas/ReservationReference"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "CAPTURED",
              "RELEASED",
              "EXPIRED"
            ]
          },
          "current": {
            "$ref": "#/components/schemas/ReservationChange"
          }
        },
        "description": "Available funds remain held until a durable release or expiry transition. Passing expiresAt alone does not change current state or availability."
      },
      "ReservationChange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reservationId",
          "version",
          "sequence",
          "kind",
          "heldMinorUnits",
          "expiresAt",
          "recordedAt",
          "actorId",
          "reasonCode",
          "correlationId",
          "commandId"
        ],
        "properties": {
          "reservationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "sequence": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "kind": {
            "type": "string",
            "enum": [
              "CREATE",
              "CHANGE",
              "PARTIAL_CAPTURE",
              "CAPTURE",
              "RELEASE",
              "EXPIRE"
            ]
          },
          "heldMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          },
          "actorId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "correlationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "captureClaimId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "ReservationReference": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "system",
          "value"
        ],
        "properties": {
          "system": {
            "$ref": "#/components/schemas/Identifier"
          },
          "value": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "ReservationHistoryPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "changes",
          "watermarkSequence"
        ],
        "properties": {
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReservationChange"
            }
          },
          "watermarkSequence": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "nextPageToken": {
            "type": "string"
          }
        }
      },
      "ReservationResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "reservationId",
          "version"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reservationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        }
      },
      "ReleaseReservationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "expectedVersion",
          "reasonCode"
        ],
        "properties": {
          "expectedVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 9223372036854775806
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          }
        }
      },
      "ChangeReservationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "expectedVersion",
          "amountMinorUnits",
          "expiresAt",
          "reasonCode"
        ],
        "properties": {
          "expectedVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 9223372036854775806
          },
          "amountMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "Explicit future expiry instant with at most microsecond precision. Offsets are normalized to UTC; finer precision is rejected."
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          }
        }
      },
      "CreateReservationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accountId",
          "amountMinorUnits",
          "currency",
          "expiresAt",
          "externalReference",
          "reasonCode"
        ],
        "properties": {
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "amountMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "currency": {
            "const": "NOK"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "Explicit future expiry instant with at most microsecond precision. Offsets are normalized to UTC; finer precision is rejected."
          },
          "externalReference": {
            "$ref": "#/components/schemas/ReservationReference"
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "metadata": {
            "anyOf": [
              { "$ref": "#/components/schemas/LedgerMetadata" },
              { "type": "null" }
            ]
          }
        }
      },
      "ReservationClaimPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "claims",
          "watermarkSequence"
        ],
        "properties": {
          "watermarkSequence": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "nextPageToken": {
            "type": "string"
          },
          "claims": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReservationClaim"
            }
          }
        }
      },
      "ReservationClaim": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "claimId",
          "reservationId",
          "legalEntityId",
          "sourceAccountId",
          "destinationAccountId",
          "actorId",
          "correlationId",
          "commandId",
          "sequence",
          "observedVersion",
          "requestedMinorUnits",
          "capturedMinorUnits",
          "releasedMinorUnits",
          "currency",
          "externalReference",
          "residualPolicy",
          "outcome",
          "outcomeReason",
          "recordedAt",
          "reasonCode",
          "submittedIntent"
        ],
        "properties": {
          "submittedIntent": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SubmittedCaptureIntent"
              },
              {
                "type": "null"
              }
            ],
            "description": "Original submitted version and time axes; null when unavailable for a legacy claim."
          },
          "claimId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reservationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "sourceAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "destinationAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "actorId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "correlationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "sequence": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "observedVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "resultVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "requestedMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "capturedMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "releasedMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "currency": {
            "const": "NOK"
          },
          "externalReference": {
            "$ref": "#/components/schemas/ReservationReference"
          },
          "residualPolicy": {
            "type": "string",
            "enum": [
              "RETAIN",
              "RELEASE"
            ]
          },
          "outcome": {
            "enum": [
              "CAPTURED",
              "REQUIRES_REVIEW"
            ]
          },
          "outcomeReason": {
            "enum": [
              "CAPTURED",
              "RESERVATION_RELEASED",
              "RESERVATION_EXPIRED",
              "RESERVATION_CAPTURED",
              "DEADLINE_PASSED"
            ]
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          }
        },
        "oneOf": [
          {
            "required": [
              "journalId",
              "resultVersion"
            ],
            "properties": {
              "outcome": {
                "const": "CAPTURED"
              },
              "outcomeReason": {
                "const": "CAPTURED"
              },
              "capturedMinorUnits": {
                "minimum": 1
              }
            }
          },
          {
            "properties": {
              "outcome": {
                "const": "REQUIRES_REVIEW"
              },
              "outcomeReason": {
                "enum": [
                  "RESERVATION_RELEASED",
                  "RESERVATION_EXPIRED",
                  "RESERVATION_CAPTURED",
                  "DEADLINE_PASSED"
                ]
              },
              "capturedMinorUnits": {
                "const": 0
              },
              "releasedMinorUnits": {
                "const": 0
              }
            },
            "not": {
              "anyOf": [
                {
                  "required": [
                    "journalId"
                  ]
                },
                {
                  "required": [
                    "resultVersion"
                  ]
                }
              ]
            }
          }
        ]
      },
      "SubmittedCaptureIntent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "expectedVersion",
          "transactionTime",
          "effectiveDate",
          "accountingDate"
        ],
        "properties": {
          "expectedVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "type": "string",
            "format": "date"
          },
          "accountingDate": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "CaptureReservationResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "claimId",
          "reservationId",
          "journalId",
          "version",
          "heldMinorUnits",
          "capturedMinorUnits",
          "releasedMinorUnits",
          "outcome"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "claimId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reservationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "journalId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Identifier"
              },
              {
                "const": ""
              }
            ]
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "heldMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "capturedMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "releasedMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "outcome": {
            "enum": [
              "CAPTURED",
              "REQUIRES_REVIEW"
            ]
          },
          "outcomeReason": {
            "enum": [
              "CAPTURED",
              "RESERVATION_RELEASED",
              "RESERVATION_EXPIRED",
              "RESERVATION_CAPTURED",
              "DEADLINE_PASSED"
            ]
          }
        },
        "oneOf": [
          {
            "properties": {
              "outcome": {
                "const": "CAPTURED"
              },
              "journalId": {
                "$ref": "#/components/schemas/Identifier"
              },
              "version": {
                "minimum": 2
              },
              "capturedMinorUnits": {
                "minimum": 1
              }
            },
            "not": {
              "required": [
                "outcomeReason"
              ]
            }
          },
          {
            "required": [
              "outcomeReason"
            ],
            "properties": {
              "outcome": {
                "const": "REQUIRES_REVIEW"
              },
              "outcomeReason": {
                "enum": [
                  "RESERVATION_RELEASED",
                  "RESERVATION_EXPIRED",
                  "RESERVATION_CAPTURED",
                  "DEADLINE_PASSED"
                ]
              },
              "journalId": {
                "const": ""
              },
              "capturedMinorUnits": {
                "const": 0
              },
              "releasedMinorUnits": {
                "const": 0
              }
            }
          }
        ]
      },
      "WorkloadCardCaptureRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "authorizationReference",
          "claimReference",
          "expectedVersion",
          "amountMinorUnits",
          "currency",
          "residualPolicy",
          "reasonCode",
          "transactionTime",
          "effectiveDate",
          "accountingDate"
        ],
        "properties": {
          "authorizationReference": {
            "type": "string",
            "pattern": "^[0-9a-f]{32}$"
          },
          "claimReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "expectedVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 9223372036854775806
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "const": "NOK"
          },
          "residualPolicy": {
            "type": "string",
            "enum": [
              "RETAIN",
              "RELEASE"
            ]
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate",
            "description": "New commands require the calendar date in Europe/Oslo at server receipt. Completed exact retries retain their original dates."
          }
        }
      },
      "WorkloadCardClaim": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "claim",
          "reviews"
        ],
        "properties": {
          "claim": {
            "$ref": "#/components/schemas/ReservationClaim"
          },
          "positionId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "positionStatus": {
            "enum": [
              "OPEN",
              "SETTLED",
              "CORRECTED"
            ]
          },
          "terminal": {
            "$ref": "#/components/schemas/WorkloadCardTerminalReceipt"
          },
          "reviews": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkloadCardTerminalReceipt"
            }
          }
        }
      },
      "WorkloadCardSettlementRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "settlementReference",
          "claimReference",
          "amountMinorUnits",
          "currency",
          "transactionTime",
          "effectiveDate",
          "accountingDate"
        ],
        "properties": {
          "settlementReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "claimReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "const": "NOK"
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          }
        }
      },
      "WorkloadCardCorrectionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "originalJournalId",
          "reasonCode",
          "approvalReference",
          "transactionTime",
          "effectiveDate",
          "accountingDate"
        ],
        "properties": {
          "originalJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "approvalReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          }
        }
      },
      "CardCorrectionApprovalRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "requesterSubject",
          "correctionIdempotencyKey",
          "originalJournalId",
          "reasonCode",
          "approvalReference",
          "transactionTime",
          "effectiveDate",
          "accountingDate"
        ],
        "properties": {
          "requesterSubject": {
            "$ref": "#/components/schemas/Identifier"
          },
          "correctionIdempotencyKey": {
            "$ref": "#/components/schemas/Identifier"
          },
          "originalJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "approvalReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          }
        }
      },
      "CardCorrectionApprovalReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "approvalReference",
          "positionId",
          "expiresAt"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "approvalReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "positionId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CardRefundProposal": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "refundReference",
          "claimReference",
          "captureCommandId",
          "captureJournalId",
          "settlementReference",
          "settlementCommandId",
          "settlementJournalId",
          "reasonCode",
          "proposalDigest",
          "amountMinorUnits",
          "currency",
          "policyVersion"
        ],
        "properties": {
          "refundReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "claimReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "captureCommandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "captureJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "settlementReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "settlementCommandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "settlementJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reasonCode": {
            "$ref": "#/components/schemas/Identifier"
          },
          "proposalDigest": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          },
          "policyVersion": {
            "type": "string",
            "enum": [
              "synthetic-settled-dispute-refund-v1"
            ]
          }
        }
      },
      "CardRefundRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "refundReference",
          "claimReference",
          "captureCommandId",
          "captureJournalId",
          "settlementReference",
          "settlementCommandId",
          "settlementJournalId",
          "reasonCode",
          "proposalDigest",
          "amountMinorUnits",
          "currency",
          "policyVersion",
          "ledgerApprovalId"
        ],
        "properties": {
          "refundReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "claimReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "captureCommandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "captureJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "settlementReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "settlementCommandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "settlementJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reasonCode": {
            "$ref": "#/components/schemas/Identifier"
          },
          "proposalDigest": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          },
          "policyVersion": {
            "type": "string",
            "enum": [
              "synthetic-settled-dispute-refund-v1"
            ]
          },
          "ledgerApprovalId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "CardRefundApprovalRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "refundReference",
          "claimReference",
          "captureCommandId",
          "captureJournalId",
          "settlementReference",
          "settlementCommandId",
          "settlementJournalId",
          "reasonCode",
          "proposalDigest",
          "amountMinorUnits",
          "currency",
          "policyVersion",
          "bankRequesterId",
          "requesterSubject",
          "refundIdempotencyKey",
          "preparedAt",
          "approvedAt",
          "expiresAt"
        ],
        "properties": {
          "refundReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "claimReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "captureCommandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "captureJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "settlementReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "settlementCommandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "settlementJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reasonCode": {
            "$ref": "#/components/schemas/Identifier"
          },
          "proposalDigest": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          },
          "policyVersion": {
            "type": "string",
            "enum": [
              "synthetic-settled-dispute-refund-v1"
            ]
          },
          "bankRequesterId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "requesterSubject": {
            "$ref": "#/components/schemas/Identifier"
          },
          "refundIdempotencyKey": {
            "$ref": "#/components/schemas/Identifier"
          },
          "preparedAt": {
            "type": "string",
            "format": "date-time"
          },
          "approvedAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CardRefundApprovalReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "ledgerApprovalId",
          "positionId",
          "expiresAt"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "ledgerApprovalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "positionId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CardRefundEvidence": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "journalId",
          "accountId",
          "positionId",
          "ledgerApprovalId",
          "requesterSubject",
          "bankRequesterId",
          "approverSubject",
          "correlationId",
          "expenseAccountId",
          "proposal",
          "terminal",
          "preparedAt",
          "approvedAt",
          "expiresAt",
          "transactionTime",
          "receivedTime",
          "recordedTime",
          "effectiveDate",
          "accountingDate",
          "entries"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "positionId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "ledgerApprovalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "requesterSubject": {
            "$ref": "#/components/schemas/Identifier"
          },
          "bankRequesterId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "approverSubject": {
            "$ref": "#/components/schemas/Identifier"
          },
          "correlationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "expenseAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "proposal": {
            "$ref": "#/components/schemas/CardRefundProposal"
          },
          "terminal": {
            "$ref": "#/components/schemas/WorkloadCardTerminalReceipt"
          },
          "preparedAt": {
            "type": "string",
            "format": "date-time"
          },
          "approvedAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "receivedTime": {
            "type": "string",
            "format": "date-time"
          },
          "recordedTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "entries": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
              "$ref": "#/components/schemas/LoanJournalLeg"
            }
          }
        }
      },
      "WorkloadCardTerminalReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "originalCommandId",
          "positionId",
          "reference",
          "status"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "originalCommandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "positionId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "status": {
            "enum": [
              "SETTLED",
              "CORRECTED",
              "REQUIRES_REVIEW"
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/ReasonCode"
          }
        }
      },
      "BankLabReserveInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "participantId",
          "customerBankId",
          "reserveReference",
          "subjectId",
          "openingMinorUnits"
        ],
        "properties": {
          "participantId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "customerBankId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reserveReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "subjectId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "openingMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        }
      },
      "BankLabOpeningRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "profileVersion",
          "currency",
          "occurredAt",
          "first",
          "second"
        ],
        "properties": {
          "profileVersion": {
            "type": "string",
            "enum": [
              "ledger.bank-lab.settlement.v1"
            ]
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "first": {
            "$ref": "#/components/schemas/BankLabReserveInput"
          },
          "second": {
            "$ref": "#/components/schemas/BankLabReserveInput"
          },
          "customerPaymentReference": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "BankLabReserveIdentity": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "participantId",
          "customerBankId",
          "reserveReference",
          "accountId"
        ],
        "properties": {
          "participantId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "customerBankId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reserveReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "BankLabOpeningReserve": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "participantId",
          "customerBankId",
          "reserveReference",
          "accountId",
          "openingMinorUnits"
        ],
        "properties": {
          "participantId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "customerBankId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reserveReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "openingMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        }
      },
      "BankLabOpening": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "legalEntityId",
          "runId",
          "profileVersion",
          "currency",
          "originalCommandId",
          "journalId",
          "assetAccountId",
          "first",
          "second"
        ],
        "properties": {
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "runId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "profileVersion": {
            "type": "string",
            "enum": [
              "ledger.bank-lab.settlement.v1"
            ]
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          },
          "originalCommandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "assetAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "first": {
            "$ref": "#/components/schemas/BankLabOpeningReserve"
          },
          "second": {
            "$ref": "#/components/schemas/BankLabOpeningReserve"
          }
        }
      },
      "BankLabSettlementRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "profileVersion",
          "recipientParticipantId",
          "amountMinorUnits",
          "currency",
          "occurredAt"
        ],
        "properties": {
          "profileVersion": {
            "type": "string",
            "enum": [
              "ledger.bank-lab.settlement.v1"
            ]
          },
          "recipientParticipantId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "amountMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BankLabSettlement": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "legalEntityId",
          "runId",
          "profileVersion",
          "paymentReference",
          "settlementId",
          "originalCommandId",
          "sender",
          "recipient",
          "amountMinorUnits",
          "currency",
          "occurredAt",
          "recordedAt",
          "accountingDate",
          "outcome"
        ],
        "properties": {
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "runId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "profileVersion": {
            "type": "string",
            "enum": [
              "ledger.bank-lab.settlement.v1"
            ]
          },
          "paymentReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "settlementId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "originalCommandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "sender": {
            "$ref": "#/components/schemas/BankLabReserveIdentity"
          },
          "recipient": {
            "$ref": "#/components/schemas/BankLabReserveIdentity"
          },
          "amountMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "currency": {
            "type": "string",
            "enum": [
              "NOK"
            ]
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          },
          "accountingDate": {
            "type": "string",
            "format": "date"
          },
          "outcome": {
            "type": "string",
            "enum": [
              "SETTLED",
              "REJECTED"
            ]
          },
          "reason": {
            "type": "string",
            "enum": [
              "INSUFFICIENT_RESERVES"
            ]
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "privateCoverEventId": {
            "$ref": "#/components/schemas/Identifier"
          }
        },
        "oneOf": [
          {
            "properties": {
              "outcome": {
                "const": "SETTLED"
              }
            },
            "required": [
              "journalId"
            ],
            "not": {
              "required": [
                "reason"
              ]
            }
          },
          {
            "properties": {
              "outcome": {
                "const": "REJECTED"
              }
            },
            "required": [
              "reason"
            ],
            "not": {
              "required": [
                "journalId"
              ]
            }
          }
        ]
      },
      "BankLabPaymentRoute": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "runId",
          "paymentReference",
          "senderAccountId",
          "recipientAccountId",
          "centralSenderAccountId",
          "centralRecipientAccountId",
          "amountMinorUnits",
          "currency",
          "profileVersion",
          "occurredAt"
        ],
        "properties": {
          "runId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "paymentReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "senderAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "recipientAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "centralSenderAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "centralRecipientAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "amountMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "currency": {
            "const": "NOK"
          },
          "profileVersion": {
            "const": "ledger.bank-lab.settlement.v1"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BankLabLocalOpeningRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "route",
          "claimMinorUnits",
          "depositMinorUnits"
        ],
        "properties": {
          "route": {
            "$ref": "#/components/schemas/BankLabPaymentRoute"
          },
          "claimMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "depositMinorUnits": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        }
      },
      "BankLabSignedProof": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "bankId",
          "type",
          "payload",
          "signature"
        ],
        "properties": {
          "bankId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "type": {
            "type": "string",
            "enum": [
              "bank-lab.local-evidence.v1",
              "bank-lab.central-evidence.v1"
            ]
          },
          "payload": {
            "type": "string",
            "format": "byte"
          },
          "signature": {
            "type": "string",
            "format": "byte"
          }
        }
      },
      "BankLabApplyStepRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "source": {
            "$ref": "#/components/schemas/BankLabSignedProof"
          }
        }
      },
      "BankLabCheckpointAccount": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "role",
          "accountId",
          "accountClass",
          "openingMinorUnits",
          "observedMinorUnits"
        ],
        "properties": {
          "role": {
            "type": "string"
          },
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountClass": {
            "type": "string"
          },
          "openingMinorUnits": {
            "type": "integer",
            "format": "int64"
          },
          "observedMinorUnits": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "BankLabCheckpointEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accountId",
          "direction",
          "amountMinorUnits"
        ],
        "properties": {
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "direction": {
            "type": "string",
            "enum": [
              "DEBIT",
              "CREDIT"
            ]
          },
          "amountMinorUnits": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "BankLabCheckpointStep": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "step",
          "outcome",
          "eventId",
          "commandId",
          "sourceValid",
          "entries"
        ],
        "properties": {
          "step": {
            "type": "string"
          },
          "outcome": {
            "type": "string"
          },
          "eventId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "sourceValid": {
            "type": "boolean"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BankLabCheckpointEntry"
            }
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "journalSequence": {
            "type": "integer",
            "format": "int64"
          },
          "settlementId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "upstreamBank": {
            "$ref": "#/components/schemas/Identifier"
          },
          "upstreamEventId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "upstreamJournalId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "BankLabCheckpoint": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "bankId",
          "legalEntityId",
          "runId",
          "paymentReference",
          "profileVersion",
          "openingSequence",
          "journalWatermark",
          "privateHeldMinorUnits",
          "accounts",
          "steps"
        ],
        "properties": {
          "bankId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "runId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "paymentReference": {
            "$ref": "#/components/schemas/Identifier"
          },
          "profileVersion": {
            "type": "string"
          },
          "openingSequence": {
            "type": "integer",
            "format": "int64"
          },
          "journalWatermark": {
            "type": "integer",
            "format": "int64"
          },
          "privateHeldMinorUnits": {
            "type": "integer",
            "format": "int64"
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BankLabCheckpointAccount"
            }
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BankLabCheckpointStep"
            }
          },
          "route": {
            "$ref": "#/components/schemas/BankLabPaymentRoute"
          },
          "settlementId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "CaptureReservationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "destinationAccountId",
          "expectedVersion",
          "amountMinorUnits",
          "currency",
          "residualPolicy",
          "externalReference",
          "reasonCode",
          "transactionTime",
          "effectiveDate",
          "accountingDate"
        ],
        "properties": {
          "destinationAccountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "expectedVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 9223372036854775806
          },
          "amountMinorUnits": {
            "$ref": "#/components/schemas/MinorUnits"
          },
          "currency": {
            "const": "NOK"
          },
          "residualPolicy": {
            "type": "string",
            "enum": [
              "RETAIN",
              "RELEASE"
            ]
          },
          "externalReference": {
            "$ref": "#/components/schemas/ReservationReference"
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "transactionTime": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate",
            "description": "New commands require the calendar date in Europe/Oslo at server receipt. Completed exact retries retain their original dates."
          }
        }
      },
      "ChangeRateProfileRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "expectedVersion",
          "annualRatePpm",
          "effectiveDate",
          "reasonCode"
        ],
        "properties": {
          "expectedVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 9223372036854775806
          },
          "annualRatePpm": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "maximum": 1000000
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "reasonCode": {
            "type": "string",
            "pattern": "^[A-Z][A-Z0-9_]{0,63}$"
          }
        }
      },
      "RateProfileResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "profileId",
          "rateVersionId",
          "version"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "profileId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "rateVersionId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        }
      },
      "RateProfile": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "profileId",
          "legalEntityId",
          "currency",
          "policyVersion",
          "createdAt",
          "latestVersion",
          "at",
          "effectiveRate"
        ],
        "properties": {
          "profileId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "currency": {
            "type": "string",
            "const": "NOK"
          },
          "policyVersion": {
            "type": "string",
            "const": "deposit.act365f.ppm.v1"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "latestVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "at": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "effectiveRate": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InterestRate"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "InterestRate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "rateVersionId",
          "profileId",
          "legalEntityId",
          "version",
          "annualRatePpm",
          "effectiveDate",
          "recordedAt",
          "actorId",
          "reasonCode",
          "correlationId",
          "commandId"
        ],
        "properties": {
          "rateVersionId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "profileId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "annualRatePpm": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "maximum": 1000000
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          },
          "actorId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reasonCode": {
            "type": "string",
            "pattern": "^[A-Z][A-Z0-9_]{0,63}$"
          },
          "correlationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "CreateRateProfileRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "currency",
          "annualRatePpm",
          "effectiveDate",
          "reasonCode"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "const": "NOK"
          },
          "annualRatePpm": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "maximum": 1000000
          },
          "effectiveDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "reasonCode": {
            "type": "string",
            "pattern": "^[A-Z][A-Z0-9_]{0,63}$"
          }
        }
      },
      "DailyInterest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "calculationId",
          "legalEntityId",
          "accountId",
          "currency",
          "accountingDate",
          "closeId",
          "termsVersion",
          "interestMode",
          "policyVersion",
          "rateProfileId",
          "rateVersionId",
          "rateVersion",
          "annualRatePpm",
          "closingBookedMinorUnits",
          "journalWatermark",
          "accrued",
          "calculatedAt",
          "actorId",
          "reasonCode",
          "correlationId",
          "commandId"
        ],
        "properties": {
          "calculationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "legalEntityId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "currency": {
            "const": "NOK"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "closeId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "termsVersion": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9223372036854775807
          },
          "interestMode": {
            "enum": [
              "NONE",
              "DAILY_ACT365F"
            ]
          },
          "policyVersion": {
            "enum": [
              "deposit.none.v1",
              "deposit.act365f.ppm.v1"
            ]
          },
          "rateProfileId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Identifier"
              },
              {
                "type": "null"
              }
            ]
          },
          "rateVersionId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Identifier"
              },
              {
                "type": "null"
              }
            ]
          },
          "rateVersion": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 9223372036854775807
              },
              {
                "type": "null"
              }
            ]
          },
          "annualRatePpm": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000
              },
              {
                "type": "null"
              }
            ]
          },
          "closingBookedMinorUnits": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9223372036854775807
          },
          "journalWatermark": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9223372036854775807
          },
          "accrued": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "numerator",
              "denominator"
            ],
            "properties": {
              "numerator": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "denominator": {
                "const": "365000000"
              }
            }
          },
          "calculatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "actorId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          },
          "correlationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "CalculateInterestDayRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accountingDate",
          "reasonCode"
        ],
        "properties": {
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ReasonCode"
          }
        }
      },
      "DailyInterestResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "calculationId",
          "accountId",
          "accountingDate"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "calculationId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountingDate": {
            "$ref": "#/components/schemas/BusinessDate"
          }
        }
      },
      "OpenAccountResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "accountId",
          "customerId"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "customerId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "accountReference": {
            "$ref": "#/components/schemas/Identifier",
            "description": "Opaque synthetic account reference; not a domestic account number. Absent on exact legacy command replays and internal accounts."
          }
        }
      },
      "CloseAccountResult": {
        "type": "object",
        "additionalProperties": false,
        "required": ["commandId", "closureId", "accountId", "version", "status", "effectiveDate", "recordedAt", "obligationContractVersion"],
        "properties": {
          "commandId": { "$ref": "#/components/schemas/Identifier" },
          "closureId": { "$ref": "#/components/schemas/Identifier" },
          "accountId": { "$ref": "#/components/schemas/Identifier" },
          "version": { "type": "integer", "format": "int64", "minimum": 1 },
          "status": { "type": "string", "const": "CLOSED" },
          "effectiveDate": { "$ref": "#/components/schemas/BusinessDate" },
          "recordedAt": { "type": "string", "format": "date-time" },
          "obligationContractVersion": { "type": "string", "enum": ["deposit.closure.obligations.v1", "deposit.closure.obligations.v2", "deposit.closure.obligations.v3", "deposit.closure.obligations.v4", "deposit.closure.obligations.v5", "deposit.closure.obligations.v6"] },
          "terminalFenceVersion": { "type": "integer", "format": "int64", "const": 1 }
        }
      },
      "PostingResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "journalId"
        ],
        "properties": {
          "commandId": {
            "$ref": "#/components/schemas/Identifier"
          },
          "journalId": {
            "$ref": "#/components/schemas/Identifier"
          }
        }
      },
      "Error": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message",
              "requestId",
              "correlationId"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "requestId": {
                "$ref": "#/components/schemas/Identifier"
              },
              "correlationId": {
                "$ref": "#/components/schemas/Identifier"
              }
            }
          }
        }
      }
    }
  }
}
