{
  "openapi": "3.0.3",
  "info": {
    "title": "Finto Partner API",
    "version": "1.0.0",
    "description": "The Finto Partner API connects credit institutions (lenders) to applications submitted on finto.lt and autolizingas.lt.\n\nA client fills in one application and signs it with Smart-ID or Mobile-ID. The signed document lists the lenders the client asks Finto to send it to. Every lender on that list that is connected through this API receives an event, fetches the application with its API key, checks the client in its own systems and returns a decision: an offer, a rejection or a request for documents.\n\n## In short\n\n1. **Event.** Finto calls your webhook (or you read `GET /v1/events`). Events contain identifiers only, never personal data.\n2. **Fetch.** `GET /v1/applications/{applicationId}` returns the application. Download the signed PDF from `documents`.\n3. **Decide.** `POST /v1/applications/{applicationId}/decisions` with `in_review`, `info_required`, `approved` (with an offer) or `rejected`.\n4. **Follow up.** When the client chooses your offer you get `offer.selected`. Report `contract_signed` and `disbursed`, or `cancelled`.\n\n## Environments\n\n- **Sandbox:** `https://partners.sandbox.finto.lt`, keys `fnt_test_...`. Generated data only; create test applications with `POST /v1/sandbox/applications`.\n- **Live:** `https://partners.finto.lt`, keys `fnt_live_...`. Real applications, after the go-live check.\n\n## Conventions\n\n- **Authentication:** `Authorization: Bearer <API key>` on every request, from an IP address on your allow-list (required in live).\n- **JSON:** UTF-8, field names in camelCase, enum values in snake_case. Requests are strict: unknown fields are rejected. In responses every documented field is present (empty values are `null`); ignore fields you do not know, and handle enum values you do not know.\n- **Money:** euros as JSON numbers with up to 2 decimals (`14500`, `267.89`). **Percentages:** numbers, `10.78` means 10.78 %.\n- **Time:** RFC 3339 timestamps (Finto sends UTC, `2026-11-20T08:14:03Z`); dates as `YYYY-MM-DD`.\n- **Idempotency:** decisions and uploads require an `Idempotency-Key` header. Repeating a request with the same key and body returns the original result.\n- **Errors:** `application/problem+json` (RFC 9457) with a machine-readable `code`.\n- **Request id:** every response has a `Finto-Request-Id` header. Quote it when you contact us.\n- **Limits:** 600 requests per minute per key; JSON bodies up to 64 KB; uploads up to 10 MB.\n- **Code generation:** use `openapi-3.0.json` (OpenAPI 3.0.3, open enums). `openapi.json` is OpenAPI 3.1.\n\nThe integration guide, lifecycle, webhook signatures with code samples, sandbox scenarios and the go-live checklist are in the [guides](https://partners.finto.lt/docs/).",
    "contact": {
      "name": "Finto",
      "email": "info@finto.lt",
      "url": "https://finto.lt"
    }
  },
  "servers": [
    {
      "url": "https://partners.sandbox.finto.lt",
      "description": "Sandbox: generated data, `fnt_test_` keys"
    },
    {
      "url": "https://partners.finto.lt",
      "description": "Live: real applications, `fnt_live_` keys"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Connection",
      "description": "Check your key, IP address and webhook settings; revoke a key."
    },
    {
      "name": "Events",
      "description": "What happened: the same events as webhooks, in a feed you can read at any time."
    },
    {
      "name": "Applications",
      "description": "Applications the client asked Finto to send to you."
    },
    {
      "name": "Documents",
      "description": "The signed application and other files."
    },
    {
      "name": "Decisions",
      "description": "Your answer to an application, from review to payout."
    },
    {
      "name": "Sandbox",
      "description": "Only at `partners.sandbox.finto.lt`: create test applications and play the client's part."
    }
  ],
  "paths": {
    "/v1/me": {
      "get": {
        "operationId": "getMe",
        "tags": [
          "Connection"
        ],
        "summary": "Check your connection",
        "description": "Returns your lender, the environment, the key you used and when it expires, the IP address Finto sees, your webhook settings and your registered `continueUrl` hosts. Call it first to check the key and the IP allow-list.",
        "responses": {
          "200": {
            "description": "Your connection.",
            "headers": {
              "Finto-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                },
                "example": {
                  "lender": {
                    "id": "cmi1lnd0r0001lb08demo0001",
                    "name": "Demo bankas",
                    "companyCode": "100000001"
                  },
                  "environment": "sandbox",
                  "apiKey": {
                    "id": "cmi1key0r0001lb08demo0001",
                    "prefix": "fnt_test_7Hq2",
                    "label": "Integration tests",
                    "createdAt": "2026-11-18T12:00:00Z",
                    "expiresAt": "2027-11-18T12:00:00Z"
                  },
                  "requestIp": "203.0.113.10",
                  "allowedIps": [
                    "203.0.113.0/28"
                  ],
                  "webhook": {
                    "url": "https://api.demo-bankas.example/finto/webhooks",
                    "enabled": true
                  },
                  "webhookSourceIps": [
                    "198.51.100.7",
                    "198.51.100.8"
                  ],
                  "continueUrlHosts": [
                    "demo-bankas.example"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/IpNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/api-key/revoke": {
      "post": {
        "operationId": "revokeCurrentKey",
        "tags": [
          "Connection"
        ],
        "summary": "Revoke the key you are using",
        "description": "Revokes the API key that authenticates this request, at once and at any hour. Use it when you suspect the key leaked, or to retire the old key after a rotation. Later requests with it return `401`. A new key is issued by Finto.",
        "responses": {
          "200": {
            "description": "The revoked key.",
            "headers": {
              "Finto-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokedApiKey"
                },
                "example": {
                  "id": "cmi1key0r0001lb08demo0001",
                  "prefix": "fnt_test_7Hq2",
                  "revokedAt": "2026-11-26T09:12:00Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/IpNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "listEvents",
        "tags": [
          "Events"
        ],
        "summary": "Read the events feed",
        "description": "Your events after the cursor, in `sequence` order. The same events are sent as webhooks; the feed lets you catch up on anything a webhook did not deliver, or integrate without a public webhook endpoint.\n\n`sequence` is yours alone: 1, 2, 3 and so on without gaps. Once you have seen an event, no event with a lower `sequence` appears later. Store `lastSequence` after processing a page and pass it as `after` next time; call again right away while `hasMore` is true. When polling without webhooks, call every 30 to 60 seconds.\n\nEvents are kept for 30 days. If events after your cursor were already deleted, the response is `410 cursor_expired`: reconcile with `GET /v1/applications` and continue without `after`.",
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Return events with a `sequence` greater than this. Omitted: from the oldest event still kept.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1 to 100. Default 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of events.",
            "headers": {
              "Finto-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventList"
                },
                "example": {
                  "data": [
                    {
                      "id": "cmi7evt0041lb08x0y1z2w3",
                      "sequence": 41,
                      "type": "application.submitted",
                      "environment": "live",
                      "createdAt": "2026-11-20T08:14:06Z",
                      "data": {
                        "applicationId": "cmi7q2x4k0001lb08h3k2v9de",
                        "reference": "P-7KQ2MX",
                        "version": 1,
                        "changes": null,
                        "closedReason": null,
                        "decisionId": null
                      }
                    }
                  ],
                  "hasMore": false,
                  "lastSequence": 41
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/IpNotAllowed"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/events/test": {
      "post": {
        "operationId": "sendTestEvent",
        "tags": [
          "Events"
        ],
        "summary": "Send a test event",
        "description": "Creates a `ping` event and sends it to your webhook. Use it to check that you receive webhooks and verify signatures. The event also appears in the feed. A `ping` is not retried, and you can send up to 5 per minute.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "responses": {
          "201": {
            "description": "The event that was created.",
            "headers": {
              "Finto-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                },
                "example": {
                  "id": "cmi7evt0046lb08x0y1z2w3",
                  "sequence": 46,
                  "type": "ping",
                  "environment": "live",
                  "createdAt": "2026-11-26T08:00:00Z",
                  "data": {
                    "applicationId": null,
                    "reference": null,
                    "version": null,
                    "changes": null,
                    "closedReason": null,
                    "decisionId": null
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/IpNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/applications": {
      "get": {
        "operationId": "listApplications",
        "tags": [
          "Applications"
        ],
        "summary": "List applications sent to you",
        "description": "Applications sent to you, most recently updated first, without personal data. Use it to reconcile; react to events for new work. When you sync by `updatedAfter`, overlap by a few minutes (for example your last sync time minus 5 minutes) and skip what you already have.",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Only applications in this state.",
            "schema": {
              "$ref": "#/components/schemas/ApplicationState"
            }
          },
          {
            "name": "updatedAfter",
            "in": "query",
            "required": false,
            "description": "Only applications updated after this time (RFC 3339).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1 to 100. Default 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "`nextCursor` from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of applications.",
            "headers": {
              "Finto-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationList"
                },
                "example": {
                  "data": [
                    {
                      "id": "cmi7q2x4k0001lb08h3k2v9de",
                      "reference": "P-7KQ2MX",
                      "version": 1,
                      "state": "open",
                      "closedReason": null,
                      "channel": "autolizingas",
                      "product": "car_lease",
                      "amount": 14500,
                      "termMonths": 72,
                      "submittedAt": "2026-11-20T08:14:03Z",
                      "updatedAt": "2026-11-20T08:14:03Z",
                      "expiresAt": "2026-12-20T08:14:03Z",
                      "decision": null
                    }
                  ],
                  "nextCursor": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/IpNotAllowed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/applications/{applicationId}": {
      "get": {
        "operationId": "getApplication",
        "tags": [
          "Applications"
        ],
        "summary": "Get an application",
        "description": "The application with the client's data, at its latest version. Every read is logged.\n\nAvailable while you work on it, and for 14 days after your final decision (`rejected`, `cancelled`, `disbursed`) or after it closes for you; a newer version opens it again. After that, and right after the client withdraws consent, the response is `410`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ApplicationId"
          }
        ],
        "responses": {
          "200": {
            "description": "The application.",
            "headers": {
              "Finto-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Cache-Control": {
                "description": "Always `no-store`: do not cache personal data in proxies.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                },
                "example": {
                  "id": "cmi7q2x4k0001lb08h3k2v9de",
                  "reference": "P-7KQ2MX",
                  "version": 1,
                  "versionNote": null,
                  "state": "open",
                  "closedReason": null,
                  "closedAt": null,
                  "replacedBy": null,
                  "channel": "autolizingas",
                  "submittedAt": "2026-11-20T08:14:03Z",
                  "updatedAt": "2026-11-20T08:14:03Z",
                  "expiresAt": "2026-12-20T08:14:03Z",
                  "request": {
                    "product": "car_lease",
                    "amount": 14500,
                    "termMonths": 72,
                    "downPayment": 2500
                  },
                  "applicant": {
                    "firstName": "Jonas",
                    "lastName": "Petraitis",
                    "personalCode": "50001018865",
                    "dateOfBirth": "2000-01-01",
                    "phone": "+37061234567",
                    "email": "jonas.petraitis@example.com",
                    "address": null,
                    "maritalStatus": null,
                    "idDocumentType": null,
                    "incomes": [
                      {
                        "type": "employment",
                        "monthlyNet": 1650,
                        "tenure": {
                          "minMonths": 4,
                          "maxMonths": null
                        }
                      }
                    ],
                    "obligations": {
                      "hasObligations": true,
                      "monthlyPayments": 120
                    },
                    "monthlyExpenses": 450,
                    "pep": {
                      "isPep": false,
                      "relation": null,
                      "category": null,
                      "position": null,
                      "institution": null,
                      "country": null,
                      "fullName": null
                    },
                    "beneficialOwner": {
                      "forOwnBenefit": true,
                      "fullName": null,
                      "personalCode": null,
                      "relation": null
                    }
                  },
                  "spouse": {
                    "participation": "not_participating",
                    "incomes": [],
                    "firstName": null,
                    "lastName": null,
                    "personalCode": null,
                    "email": null
                  },
                  "creditors": [
                    {
                      "name": "AB „Demo bankas“",
                      "companyCode": "100000001",
                      "isYou": true
                    },
                    {
                      "name": "UAB „Pavyzdys lizingas“",
                      "companyCode": "300000002",
                      "isYou": false
                    }
                  ],
                  "signature": {
                    "documentId": "cmi7q2y1d0003lb08a1f4c7e2",
                    "templateVersion": "2026-11-20",
                    "signedAt": "2026-11-20T08:14:03Z",
                    "level": "qes",
                    "signerName": "JONAS PETRAITIS",
                    "signerPersonalCode": "50001018865"
                  },
                  "documents": [
                    {
                      "id": "cmi7q2y1d0003lb08a1f4c7e2",
                      "type": "signed_application",
                      "title": "Paraiška finansavimui gauti",
                      "fileName": "Paraiska-P-7KQ2MX.pdf",
                      "contentType": "application/pdf",
                      "sizeBytes": 184213,
                      "sha256": "e6e18b747a3138405cf4b0ad147bf63d388a47adf7a3a5b5e50c05c664c2c88e",
                      "uploadedBy": "finto",
                      "createdAt": "2026-11-20T08:14:05Z"
                    }
                  ],
                  "decision": null,
                  "selection": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/IpNotAllowed"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/applications/{applicationId}/documents/{documentId}": {
      "get": {
        "operationId": "downloadDocument",
        "tags": [
          "Documents"
        ],
        "summary": "Download a document",
        "description": "The file itself. Compare its SHA-256 with `sha256` in the application's `documents` (also sent in the `Content-Digest` header). Every download is logged. Files from clients are checked for type and size, not scanned for malware: handle them as untrusted input.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ApplicationId"
          },
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "description": "Document id from the application's `documents`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file.",
            "headers": {
              "Finto-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Content-Disposition": {
                "description": "`attachment; filename=\"...\"`.",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Digest": {
                "description": "RFC 9530 digest, for example `sha-256=:<base64>:`.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/IpNotAllowed"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/applications/{applicationId}/documents": {
      "post": {
        "operationId": "uploadDocument",
        "tags": [
          "Documents"
        ],
        "summary": "Upload your document",
        "description": "Attach a PDF of yours to the application, up to 10 MB, at most 20 files and 50 MB per application. The usual one is the SECCI form (Standard European Consumer Credit Information) for your offer: upload it, then send `approved` with its id in `offer.documentIds`. Your own consent form goes up as `consent_form`, followed by `info_required` with `lender_consent`.\n\nOnly you and Finto see your uploads. Finto passes the documents of your offer to the client together with the offer. Uploads do not change the application `version`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ApplicationId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "type"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The PDF file."
                  },
                  "type": {
                    "$ref": "#/components/schemas/LenderDocumentType"
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Short title, shown with the document."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Repeated request (same `Idempotency-Key` and file): the document stored the first time.",
            "headers": {
              "Finto-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "201": {
            "description": "The stored document.",
            "headers": {
              "Finto-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/IpNotAllowed"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/applications/{applicationId}/decisions": {
      "post": {
        "operationId": "createDecision",
        "tags": [
          "Decisions"
        ],
        "summary": "Send a decision",
        "description": "Your decision or progress on the application. `status` decides which other fields are required; `applicationVersion` is always required.\n\n- `in_review`: you are reviewing. Send it soon after fetching, ideally with `lenderReference`.\n- `info_required`: you need documents or data (`requirements`). Finto asks the client and sends `application.updated` when something arrives.\n- `approved`: your offer (`offer`). Send `approved` again to replace it. After the client chose your offer, changing its terms ends the choice: the client chooses again.\n- `rejected`: no offer. Also withdraws an offer you made.\n- `contract_signed`, `disbursed`: the outcome (`contract`, `disbursement`).\n- `cancelled`: ended without financing for a reason other than your credit decision (`cancellationReason`).\n\nFinto applies decisions in the order it receives them. Which status may follow which, and what is accepted after the application closes, is in the lifecycle guide; a change that is not allowed returns `409` (`invalid_transition`, `application_closed`). Send `previousDecisionId` to have a request refused (`409 decision_conflict`) when your current decision is not the one you think.\n\nRepeating the request with the same `Idempotency-Key` and body returns the stored decision with `200` instead of `201`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ApplicationId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecisionCreate"
              },
              "examples": {
                "in_review": {
                  "summary": "in_review",
                  "value": {
                    "status": "in_review",
                    "applicationVersion": 1,
                    "lenderReference": "DB-2026-118734"
                  }
                },
                "info_required": {
                  "summary": "info_required",
                  "value": {
                    "status": "info_required",
                    "applicationVersion": 1,
                    "lenderReference": "DB-2026-118734",
                    "requirements": [
                      {
                        "type": "income_statement",
                        "description": "Pažyma apie pajamas už paskutinius 6 mėnesius (iš Sodros arba darbdavio)"
                      }
                    ]
                  }
                },
                "approved": {
                  "summary": "approved",
                  "value": {
                    "status": "approved",
                    "applicationVersion": 1,
                    "lenderReference": "DB-2026-118734",
                    "offer": {
                      "amount": 14500,
                      "termMonths": 72,
                      "monthlyPayment": 267.89,
                      "annualInterestRate": 9.9,
                      "aprc": 10.78,
                      "totalAmountPayable": 19438.08,
                      "interestRateType": "fixed",
                      "contractFee": 150,
                      "downPayment": 2500,
                      "validUntil": "2026-12-04",
                      "conditions": [
                        "Privalomas KASKO draudimas"
                      ],
                      "continueUrl": "https://demo-bankas.example/continue/8f3c2a"
                    }
                  }
                },
                "rejected": {
                  "summary": "rejected",
                  "value": {
                    "status": "rejected",
                    "applicationVersion": 1,
                    "rejectionReason": "high_debt_burden",
                    "message": "Esami įsipareigojimai viršija mūsų ribą."
                  }
                },
                "contract_signed": {
                  "summary": "contract_signed",
                  "value": {
                    "status": "contract_signed",
                    "applicationVersion": 1,
                    "contract": {
                      "signedAt": "2026-11-24T13:02:00+02:00",
                      "amount": 14500,
                      "termMonths": 72,
                      "contractNumber": "LS-2026-00981"
                    }
                  }
                },
                "disbursed": {
                  "summary": "disbursed",
                  "value": {
                    "status": "disbursed",
                    "applicationVersion": 1,
                    "disbursement": {
                      "disbursedAt": "2026-11-25T09:30:00+02:00",
                      "amount": 14500
                    }
                  }
                },
                "cancelled": {
                  "summary": "cancelled",
                  "value": {
                    "status": "cancelled",
                    "applicationVersion": 1,
                    "cancellationReason": "client_declined",
                    "message": "Klientui per didelė mėnesio įmoka."
                  }
                },
                "terminated": {
                  "summary": "terminated",
                  "value": {
                    "status": "terminated",
                    "applicationVersion": 1,
                    "termination": {
                      "endedOn": "2027-09-14",
                      "reason": "early_repayment"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Repeated request (same `Idempotency-Key` and body): the decision stored the first time.",
            "headers": {
              "Finto-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Decision"
                },
                "example": {
                  "id": "cmi7r0b6s0009lb08m2n5p8q1",
                  "applicationId": "cmi7q2x4k0001lb08h3k2v9de",
                  "applicationVersion": 1,
                  "status": "approved",
                  "decidedAt": null,
                  "receivedAt": "2026-11-20T09:41:12Z",
                  "lenderReference": "DB-2026-118734",
                  "message": null,
                  "offer": {
                    "monthlyFee": null,
                    "residualValue": null,
                    "documentIds": null,
                    "amount": 14500,
                    "termMonths": 72,
                    "monthlyPayment": 267.89,
                    "annualInterestRate": 9.9,
                    "aprc": 10.78,
                    "totalAmountPayable": 19438.08,
                    "interestRateType": "fixed",
                    "contractFee": 150,
                    "downPayment": 2500,
                    "validUntil": "2026-12-04",
                    "conditions": [
                      "Privalomas KASKO draudimas"
                    ],
                    "continueUrl": "https://demo-bankas.example/continue/8f3c2a"
                  },
                  "requirements": null,
                  "rejectionReason": null,
                  "cancellationReason": null,
                  "contract": null,
                  "disbursement": null,
                  "termination": null
                }
              }
            }
          },
          "201": {
            "description": "Decision stored.",
            "headers": {
              "Finto-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Decision"
                },
                "example": {
                  "id": "cmi7r0b6s0009lb08m2n5p8q1",
                  "applicationId": "cmi7q2x4k0001lb08h3k2v9de",
                  "applicationVersion": 1,
                  "status": "approved",
                  "decidedAt": null,
                  "receivedAt": "2026-11-20T09:41:12Z",
                  "lenderReference": "DB-2026-118734",
                  "message": null,
                  "offer": {
                    "monthlyFee": null,
                    "residualValue": null,
                    "documentIds": null,
                    "amount": 14500,
                    "termMonths": 72,
                    "monthlyPayment": 267.89,
                    "annualInterestRate": 9.9,
                    "aprc": 10.78,
                    "totalAmountPayable": 19438.08,
                    "interestRateType": "fixed",
                    "contractFee": 150,
                    "downPayment": 2500,
                    "validUntil": "2026-12-04",
                    "conditions": [
                      "Privalomas KASKO draudimas"
                    ],
                    "continueUrl": "https://demo-bankas.example/continue/8f3c2a"
                  },
                  "requirements": null,
                  "rejectionReason": null,
                  "cancellationReason": null,
                  "contract": null,
                  "disbursement": null,
                  "termination": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/IpNotAllowed"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "listDecisions",
        "tags": [
          "Decisions"
        ],
        "summary": "List your decisions",
        "description": "Every decision you sent on the application, newest first, as Finto stored it. Useful to reconcile.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ApplicationId"
          }
        ],
        "responses": {
          "200": {
            "description": "Your decisions.",
            "headers": {
              "Finto-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DecisionList"
                },
                "example": {
                  "data": [
                    {
                      "id": "cmi7r0b6s0009lb08m2n5p8q1",
                      "applicationId": "cmi7q2x4k0001lb08h3k2v9de",
                      "applicationVersion": 1,
                      "status": "approved",
                      "decidedAt": null,
                      "receivedAt": "2026-11-20T09:41:12Z",
                      "lenderReference": "DB-2026-118734",
                      "message": null,
                      "offer": {
                        "monthlyFee": null,
                        "residualValue": null,
                        "documentIds": null,
                        "amount": 14500,
                        "termMonths": 72,
                        "monthlyPayment": 267.89,
                        "annualInterestRate": 9.9,
                        "aprc": 10.78,
                        "totalAmountPayable": 19438.08,
                        "interestRateType": "fixed",
                        "contractFee": 150,
                        "downPayment": 2500,
                        "validUntil": "2026-12-04",
                        "conditions": [
                          "Privalomas KASKO draudimas"
                        ],
                        "continueUrl": "https://demo-bankas.example/continue/8f3c2a"
                      },
                      "requirements": null,
                      "rejectionReason": null,
                      "cancellationReason": null,
                      "contract": null,
                      "disbursement": null,
                      "termination": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/IpNotAllowed"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/sandbox/applications": {
      "post": {
        "operationId": "createSandboxApplication",
        "tags": [
          "Sandbox"
        ],
        "summary": "Create a test application (sandbox only)",
        "description": "Generates a signed application addressed only to you, from a scenario. You get `application.submitted` as with a real one. Personal codes come from public Smart-ID and Mobile-ID test identities. Up to 200 per day. Not available in live (`404`).",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxApplicationCreate"
              },
              "example": {
                "scenario": "car_lease",
                "amount": 12000
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created application.",
            "headers": {
              "Finto-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationSummary"
                },
                "example": {
                  "id": "cmi7q2x4k0001lb08h3k2v9de",
                  "reference": "P-7KQ2MX",
                  "version": 1,
                  "state": "open",
                  "closedReason": null,
                  "channel": "autolizingas",
                  "product": "car_lease",
                  "amount": 14500,
                  "termMonths": 72,
                  "submittedAt": "2026-11-20T08:14:03Z",
                  "updatedAt": "2026-11-20T08:14:03Z",
                  "expiresAt": "2026-12-20T08:14:03Z",
                  "decision": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/IpNotAllowed"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/sandbox/applications/{applicationId}/simulate": {
      "post": {
        "operationId": "simulateSandboxAction",
        "tags": [
          "Sandbox"
        ],
        "summary": "Simulate the client or Finto (sandbox only)",
        "description": "Makes the next step happen on a sandbox application: the client chooses your offer, chooses another lender, declines, withdraws consent or uploads a document, Finto adds the spouse's data or corrects data, or the application expires. The resulting event is delivered as in live.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ApplicationId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxSimulate"
              },
              "example": {
                "action": "select_offer"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The event the action produced.",
            "headers": {
              "Finto-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxSimulateResult"
                },
                "example": {
                  "event": {
                    "id": "cmi7evt0003lb08x0y1z2w3",
                    "sequence": 3,
                    "type": "offer.selected",
                    "environment": "sandbox",
                    "createdAt": "2026-11-22T14:20:31Z",
                    "data": {
                      "applicationId": "cmi7q2x4k0001lb08h3k2v9de",
                      "reference": "P-7KQ2MX",
                      "version": 1,
                      "changes": null,
                      "closedReason": null,
                      "decisionId": "cmi7r0b6s0009lb08m2n5p8q1"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/IpNotAllowed"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    }
  },
  "x-webhooks": {
    "event": {
      "post": {
        "operationId": "receiveEvent",
        "summary": "Event notification to your endpoint",
        "description": "Finto sends every event as an HTTPS `POST` to your webhook URL (port 443).\n\n- Verify `Finto-Signature` before trusting the body (see the webhooks guide). Every attempt is signed again with a fresh `t`. The `Finto-Event-Id` and `Finto-Event-Type` headers are not signed: rely on the body.\n- Answer `2xx` within 10 seconds; process the event afterwards. Redirects are not followed.\n- Anything else is retried after 1, 5, 15 and 30 minutes, then 1, 2, 4, 8, 12 and 24 hours. After that the event stays only in the feed. `ping` is not retried.\n- The same event may arrive more than once and in any order: ignore an `id` you already processed and always fetch the current application.",
        "parameters": [
          {
            "name": "Finto-Signature",
            "in": "header",
            "required": true,
            "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`. During a secret rotation two `v1` values are sent; accept the request if either matches.",
            "schema": {
              "type": "string"
            },
            "example": "t=1795162446,v1=841f6842..."
          },
          {
            "name": "Finto-Event-Id",
            "in": "header",
            "required": true,
            "description": "Same as `id` in the body. Not signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Finto-Event-Type",
            "in": "header",
            "required": true,
            "description": "Same as `type` in the body. Not signed.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              },
              "examples": {
                "application_submitted": {
                  "summary": "application.submitted",
                  "value": {
                    "id": "cmi7evt0041lb08x0y1z2w3",
                    "sequence": 41,
                    "type": "application.submitted",
                    "environment": "live",
                    "createdAt": "2026-11-20T08:14:06Z",
                    "data": {
                      "applicationId": "cmi7q2x4k0001lb08h3k2v9de",
                      "reference": "P-7KQ2MX",
                      "version": 1,
                      "changes": null,
                      "closedReason": null,
                      "decisionId": null
                    }
                  }
                },
                "application_updated": {
                  "summary": "application.updated",
                  "value": {
                    "id": "cmi7evt0042lb08x0y1z2w3",
                    "sequence": 42,
                    "type": "application.updated",
                    "environment": "live",
                    "createdAt": "2026-11-21T10:02:44Z",
                    "data": {
                      "applicationId": "cmi7q2x4k0001lb08h3k2v9de",
                      "reference": "P-7KQ2MX",
                      "version": 2,
                      "changes": [
                        "documents"
                      ],
                      "closedReason": null,
                      "decisionId": null
                    }
                  }
                },
                "offer_selected": {
                  "summary": "offer.selected",
                  "value": {
                    "id": "cmi7evt0043lb08x0y1z2w3",
                    "sequence": 43,
                    "type": "offer.selected",
                    "environment": "live",
                    "createdAt": "2026-11-22T14:20:31Z",
                    "data": {
                      "applicationId": "cmi7q2x4k0001lb08h3k2v9de",
                      "reference": "P-7KQ2MX",
                      "version": 2,
                      "changes": null,
                      "closedReason": null,
                      "decisionId": "cmi7r0b6s0009lb08m2n5p8q1"
                    }
                  }
                },
                "application_closed": {
                  "summary": "application.closed",
                  "value": {
                    "id": "cmi7evt0044lb08x0y1z2w3",
                    "sequence": 44,
                    "type": "application.closed",
                    "environment": "live",
                    "createdAt": "2026-11-25T09:31:10Z",
                    "data": {
                      "applicationId": "cmi7q2x4k0001lb08h3k2v9de",
                      "reference": "P-7KQ2MX",
                      "version": 2,
                      "changes": null,
                      "closedReason": "completed",
                      "decisionId": null
                    }
                  }
                },
                "application_withdrawn": {
                  "summary": "application.withdrawn",
                  "value": {
                    "id": "cmi7evt0045lb08x0y1z2w3",
                    "sequence": 45,
                    "type": "application.withdrawn",
                    "environment": "live",
                    "createdAt": "2026-11-26T07:51:02Z",
                    "data": {
                      "applicationId": "cmi7q2x4k0001lb08h3k2v9de",
                      "reference": "P-7KQ2MX",
                      "version": 2,
                      "changes": null,
                      "closedReason": null,
                      "decisionId": null
                    }
                  }
                },
                "ping": {
                  "summary": "ping",
                  "value": {
                    "id": "cmi7evt0046lb08x0y1z2w3",
                    "sequence": 46,
                    "type": "ping",
                    "environment": "live",
                    "createdAt": "2026-11-26T08:00:00Z",
                    "data": {
                      "applicationId": null,
                      "reference": null,
                      "version": null,
                      "changes": null,
                      "closedReason": null,
                      "decisionId": null
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, or none within the timeout, is retried."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Environment": {
        "type": "string",
        "description": "API environment. `live`: real applications at `partners.finto.lt`. `sandbox`: generated test data at `partners.sandbox.finto.lt`.",
        "x-extensible-enum": [
          "live",
          "sandbox"
        ]
      },
      "Channel": {
        "type": "string",
        "description": "Website where the client applied: `finto` (finto.lt) or `autolizingas` (autolizingas.lt). New values may be added.",
        "x-extensible-enum": [
          "finto",
          "autolizingas"
        ]
      },
      "Product": {
        "type": "string",
        "description": "Financing the client asks for. New values may be added; treat an unknown value as a product you do not offer.\n\n- `cash_loan`: consumer loan without a specific purpose.\n- `car_loan`: consumer loan to buy a car.\n- `car_lease`: car leasing (hire purchase): the car is financed and repaid in instalments.\n- `refinancing`: loan to refinance the client's existing obligations.",
        "x-extensible-enum": [
          "cash_loan",
          "car_loan",
          "car_lease",
          "refinancing"
        ]
      },
      "ApplicationState": {
        "type": "string",
        "description": "State of the application on Finto's side, as it concerns you.\n\n- `open`: you may review it and send decisions.\n- `offer_selected`: the client chose your offer. Continue with the agreement.\n- `closed`: the application has ended for you (see `closedReason`). Only `contract_signed`, `disbursed`, `cancelled` and `terminated` are accepted.\n- `withdrawn`: the client withdrew consent. The data is no longer available and no decisions are accepted.",
        "x-extensible-enum": [
          "open",
          "offer_selected",
          "closed",
          "withdrawn"
        ]
      },
      "ClosedReason": {
        "type": "string",
        "description": "Why the application was closed for you. New values may be added.\n\n- `completed`: your outcome is final: you reported `disbursed`, or `cancelled` after an agreement. Corrections and later changes to the agreement (`cancelled` after a withdrawal, `terminated`) are still accepted.\n- `other_offer_chosen`: the client went with another offer.\n- `client_declined`: the client no longer wants the financing, or turned away from your offer after choosing it.\n- `expired`: the application reached `expiresAt` without an outcome.\n- `duplicate`: the application was replaced by a newer one from the same client (see `replacedBy`).\n- `closed_by_finto`: closed by Finto for another reason.",
        "x-extensible-enum": [
          "completed",
          "other_offer_chosen",
          "client_declined",
          "expired",
          "duplicate",
          "closed_by_finto"
        ]
      },
      "IncomeType": {
        "type": "string",
        "description": "Source of income, as answered in the form. New values may be added; treat an unknown one as `other`.\n\n- `employment`: permanent employment in Lithuania.\n- `statutory_officer`: statutory service (for example police, military, customs).\n- `employment_abroad`: employment abroad.\n- `self_employment`: individual activity or business certificate.\n- `other`: other regular income.",
        "x-extensible-enum": [
          "employment",
          "statutory_officer",
          "employment_abroad",
          "self_employment",
          "other"
        ]
      },
      "MaritalStatus": {
        "type": "string",
        "description": "Marital status. `partnership` is a registered partnership.",
        "x-extensible-enum": [
          "single",
          "married",
          "divorced",
          "widowed",
          "partnership"
        ]
      },
      "IdDocumentType": {
        "type": "string",
        "description": "Identity document the client holds: identity card, passport, permanent residence permit in Lithuania, or EU citizen's certificate of the right to reside in Lithuania.",
        "x-extensible-enum": [
          "id_card",
          "passport",
          "permanent_residence_permit",
          "eu_residence_permit"
        ]
      },
      "SpouseParticipation": {
        "type": "string",
        "description": "- `no_spouse`: the client has no spouse.\n- `not_participating`: the client has a spouse who does not take part in the application.\n- `joint`: the client applies together with the spouse; the spouse's incomes are included.",
        "x-extensible-enum": [
          "no_spouse",
          "not_participating",
          "joint"
        ]
      },
      "PepRelation": {
        "type": "string",
        "description": "How the client relates to the politically exposed person: the client is the PEP, an immediate family member, or a close associate.",
        "x-extensible-enum": [
          "self",
          "family_member",
          "close_associate"
        ]
      },
      "PepCategory": {
        "type": "string",
        "description": "Category of the prominent public function, following the list in the Lithuanian Law on the Prevention of Money Laundering and Terrorist Financing.\n\n- `head_of_state_government_or_minister`: head of state or government, minister, vice-minister or deputy minister, state secretary, chancellor of the parliament, government or a ministry.\n- `member_of_parliament`: member of parliament.\n- `supreme_court_judge`: member of a supreme or constitutional court or another high court whose decisions cannot be appealed.\n- `mayor_or_municipal_director`: mayor or director of a municipal administration.\n- `audit_body_or_central_bank_board`: member of the management body of the supreme audit institution, or chair, deputy chair or board member of a central bank.\n- `ambassador_or_senior_military_officer`: ambassador, chargé d'affaires, envoy or minister plenipotentiary, or high-ranking officer of the armed forces.\n- `state_owned_company_board`: member of the management or supervisory body of a company in which the state holds more than 1/2 of the votes.\n- `municipal_company_board`: member of the management or supervisory body of a large company in which a municipality holds more than 1/2 of the votes.\n- `international_organisation_management`: director, deputy director or board member of an international intergovernmental organisation.\n- `political_party_management`: leader, deputy leader or board member of a political party.",
        "x-extensible-enum": [
          "head_of_state_government_or_minister",
          "member_of_parliament",
          "supreme_court_judge",
          "mayor_or_municipal_director",
          "audit_body_or_central_bank_board",
          "ambassador_or_senior_military_officer",
          "state_owned_company_board",
          "municipal_company_board",
          "international_organisation_management",
          "political_party_management"
        ]
      },
      "DocumentType": {
        "type": "string",
        "description": "Document type. New values may be added.\n\nFrom Finto:\n- `signed_application`: the application with the creditor table, signed by the client with a qualified electronic signature (PDF).\n- `income_statement`, `bank_statement`, `employment_contract`, `id_document`, `vehicle_document`: documents the client provided because you asked for them.\n\nFrom you (`POST /v1/applications/{applicationId}/documents`):\n- `consent_form`: your own consent form for the client to sign. The signed copy comes back with the same type, uploaded by the client.\n- `secci`: Standard European Consumer Credit Information form for your offer.\n- `offer`: offer letter.\n- `contract_draft`: draft credit agreement.\n\n- `other`: anything else.",
        "x-extensible-enum": [
          "signed_application",
          "income_statement",
          "bank_statement",
          "employment_contract",
          "id_document",
          "vehicle_document",
          "consent_form",
          "secci",
          "offer",
          "contract_draft",
          "other"
        ]
      },
      "LenderDocumentType": {
        "type": "string",
        "enum": [
          "consent_form",
          "secci",
          "offer",
          "contract_draft",
          "other"
        ],
        "description": "Types you may upload. See `DocumentType`."
      },
      "DocumentUploader": {
        "type": "string",
        "description": "Who provided the document: the client (through Finto), Finto, or you. You only see your own uploads and documents provided for you.",
        "x-extensible-enum": [
          "client",
          "finto",
          "lender"
        ]
      },
      "SignatureLevel": {
        "type": "string",
        "description": "eIDAS level of the client's signature as reported by the signing service: qualified (`qes`), advanced (`aes`) or simple (`es`). In v1 Finto sends only applications signed at `qes`.",
        "x-extensible-enum": [
          "qes",
          "aes",
          "es"
        ]
      },
      "DecisionStatus": {
        "type": "string",
        "enum": [
          "in_review",
          "info_required",
          "approved",
          "rejected",
          "contract_signed",
          "disbursed",
          "cancelled",
          "terminated"
        ],
        "description": "Your decision or progress on an application.\n\n- `in_review`: you are reviewing the application.\n- `info_required`: you need more documents or data (`requirements`).\n- `approved`: you make an offer (`offer`). Send `approved` again to replace it.\n- `rejected`: you do not offer financing. Also withdraws an offer you made.\n- `contract_signed`: the client signed the credit agreement with you (`contract`).\n- `disbursed`: the money was paid out (`disbursement`).\n- `cancelled`: the process ended without financing for a reason other than your credit decision (`cancellationReason`). After the payout, only when the client withdrew within the statutory period (`withdrawal_right`).\n- `terminated`: an agreement that was paid out ended before its term (`termination`), for example repaid early. Send it whenever it happens, also long after the payout.\n\nYour offer can be chosen only while your current status is `approved`."
      },
      "RequirementType": {
        "type": "string",
        "enum": [
          "income_statement",
          "bank_statement",
          "employment_contract",
          "id_document",
          "vehicle_document",
          "lender_consent",
          "spouse_data",
          "other"
        ],
        "description": "What you need from the client.\n\n- `income_statement`: proof of income.\n- `bank_statement`: bank account statement.\n- `employment_contract`: employment contract.\n- `id_document`: copy of an identity document.\n- `vehicle_document`: documents of the vehicle (for example the purchase agreement or registration certificate).\n- `lender_consent`: your own consent form signed by the client. Upload the form first as `consent_form`.\n- `spouse_data`: the spouse's identity, when you need the spouse as co-borrower. Finto adds it to `spouse`.\n- `other`: anything else; explain in `description`."
      },
      "RejectionReason": {
        "type": "string",
        "enum": [
          "credit_history",
          "insufficient_income",
          "high_debt_burden",
          "outside_policy",
          "unable_to_verify",
          "other"
        ],
        "description": "Main reason for a rejection. Shown to Finto staff only, never to the client.\n\n- `credit_history`: negative credit history or current arrears.\n- `insufficient_income`: income too low for the requested financing.\n- `high_debt_burden`: existing obligations too high.\n- `outside_policy`: outside your lending policy (age, residence, product, amount and so on).\n- `unable_to_verify`: identity, income or other data could not be verified.\n- `other`: another reason."
      },
      "CancellationReason": {
        "type": "string",
        "enum": [
          "client_declined",
          "client_unreachable",
          "offer_expired",
          "withdrawal_right",
          "consent_withdrawn",
          "other"
        ],
        "description": "- `client_declined`: the client declined your offer.\n- `client_unreachable`: you could not reach the client, or the client did not provide what you asked for.\n- `offer_expired`: the offer expired without an agreement.\n- `withdrawal_right`: the client withdrew from a signed agreement within the statutory withdrawal period, also after the payout.\n- `consent_withdrawn`: the client withdrew, directly with you, the consent given in the signed application. Finto stops sending you anything about it and follows up with the client.\n- `other`: another reason; explain in `message`.\n\nAfter the payout only `withdrawal_right` and `other` are accepted."
      },
      "TerminationReason": {
        "type": "string",
        "enum": [
          "early_repayment",
          "terminated_by_client",
          "terminated_by_lender",
          "other"
        ],
        "description": "Why an agreement that was paid out ended before its term. New values may be added.\n\n- `early_repayment`: the client repaid everything ahead of schedule, for example after refinancing elsewhere, or bought the car out early.\n- `terminated_by_client`: the client ended the agreement in another way, for example returned the leased car.\n- `terminated_by_lender`: you terminated the agreement. Do not send why or any amounts: Finto does not need them.\n- `other`: another reason; explain in `message`."
      },
      "InterestRateType": {
        "type": "string",
        "enum": [
          "fixed",
          "variable"
        ],
        "description": "Whether the interest rate is fixed or variable (for example EURIBOR plus a margin)."
      },
      "ApplicationChange": {
        "type": "string",
        "description": "What changed in a new version: `data` (application fields) or `documents` (documents were added for you). New values may be added.",
        "x-extensible-enum": [
          "data",
          "documents"
        ]
      },
      "EventType": {
        "type": "string",
        "description": "Event type. New types may be added: ignore types you do not know.\n\n- `application.submitted`: a new application for you. Fetch it and review.\n- `application.updated`: a new version (corrected data, or documents for you). Fetch it again.\n- `offer.selected`: the client chose your offer (`decisionId`). Continue with the agreement.\n- `application.closed`: the application ended for you (`closedReason`).\n- `application.withdrawn`: the client withdrew consent. The data is no longer available.\n- `ping`: test event sent on request (`POST /v1/events/test`).",
        "x-extensible-enum": [
          "application.submitted",
          "application.updated",
          "offer.selected",
          "application.closed",
          "application.withdrawn",
          "ping"
        ]
      },
      "SandboxScenario": {
        "type": "string",
        "enum": [
          "standard",
          "car_lease",
          "car_loan",
          "refinancing",
          "joint",
          "multiple_incomes",
          "high_obligations",
          "pep",
          "not_own_benefit",
          "minimal"
        ],
        "description": "Shape of a generated sandbox application.\n\n- `standard`: cash loan, one applicant, employment income, no obligations.\n- `car_lease`: car leasing with a down payment.\n- `car_loan`: car loan.\n- `refinancing`: refinancing of existing obligations.\n- `joint`: applying together with the spouse.\n- `multiple_incomes`: employment plus self-employment and other income.\n- `high_obligations`: large existing monthly obligations.\n- `pep`: the client is a politically exposed person.\n- `not_own_benefit`: the financing is taken for the benefit of another person.\n- `minimal`: only required fields; every optional field is `null`."
      },
      "SandboxAction": {
        "type": "string",
        "enum": [
          "select_offer",
          "choose_other_offer",
          "decline",
          "expire",
          "withdraw",
          "add_document",
          "add_spouse_data",
          "update_data"
        ],
        "description": "What the simulated client or Finto does next.\n\n- `select_offer`: the client chooses your current offer → `offer.selected`. Requires your current status to be `approved` with a valid offer.\n- `choose_other_offer`: the client signs with another lender → `application.closed` (`other_offer_chosen`).\n- `decline`: the client no longer wants the financing → `application.closed` (`client_declined`).\n- `expire`: the application reaches `expiresAt` → `application.closed` (`expired`).\n- `withdraw`: the client withdraws consent → `application.withdrawn`.\n- `add_document`: the client uploads an income statement for you → `application.updated` (`documents`).\n- `add_spouse_data`: Finto adds the spouse's identity → `application.updated` (`data`).\n- `update_data`: Finto corrects the client's phone number → `application.updated` (`data`)."
      },
      "Tenure": {
        "type": "object",
        "properties": {
          "minMonths": {
            "type": "integer",
            "minimum": 0,
            "description": "Lower bound in months, inclusive."
          },
          "maxMonths": {
            "nullable": true,
            "description": "Upper bound in months, exclusive. `null`: no upper bound.",
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "minMonths",
          "maxMonths"
        ],
        "description": "How long the client has received this income, as a range answered in the form. `{ \"minMonths\": 4, \"maxMonths\": null }` means 4 months or more; `{ \"minMonths\": 0, \"maxMonths\": 4 }` means less than 4 months."
      },
      "Income": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/IncomeType"
          },
          "monthlyNet": {
            "type": "number",
            "minimum": 0,
            "maximum": 10000000,
            "description": "Average net income per month (after taxes), EUR."
          },
          "tenure": {
            "nullable": true,
            "description": "How long this income has been received. `null` when it was not asked.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Tenure"
              }
            ]
          }
        },
        "required": [
          "type",
          "monthlyNet",
          "tenure"
        ],
        "description": "One income source declared by the client."
      },
      "Obligations": {
        "type": "object",
        "properties": {
          "hasObligations": {
            "type": "boolean",
            "description": "Whether the client declared existing financial obligations."
          },
          "monthlyPayments": {
            "type": "number",
            "minimum": 0,
            "maximum": 10000000,
            "description": "Total monthly payments under existing loans, leasing, credit cards and similar, EUR. `0` when `hasObligations` is false."
          }
        },
        "required": [
          "hasObligations",
          "monthlyPayments"
        ],
        "description": "Existing obligations as declared by the client. The signed application asks you to check credit registers yourself."
      },
      "Pep": {
        "type": "object",
        "properties": {
          "isPep": {
            "type": "boolean",
            "description": "Whether the client is a politically exposed person (PEP), an immediate family member or a close associate of one. When false, every other field is `null`."
          },
          "relation": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/PepRelation"
              }
            ]
          },
          "category": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/PepCategory"
              }
            ]
          },
          "position": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Position or duties, free text."
          },
          "institution": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Institution, free text."
          },
          "country": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Country, free text."
          },
          "fullName": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[\\p{L}\\p{M}][\\p{L}\\p{M}' .-]*$",
            "description": "Full name of the PEP when `relation` is not `self`."
          }
        },
        "required": [
          "isPep",
          "relation",
          "category",
          "position",
          "institution",
          "country",
          "fullName"
        ],
        "description": "Answer to the PEP question in the signed application."
      },
      "BeneficialOwner": {
        "type": "object",
        "properties": {
          "forOwnBenefit": {
            "type": "boolean",
            "description": "Whether the client takes the financing in their own name and for their own benefit. When true, every other field is `null`."
          },
          "fullName": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[\\p{L}\\p{M}][\\p{L}\\p{M}' .-]*$",
            "description": "Beneficial owner's full name."
          },
          "personalCode": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 20,
            "description": "Beneficial owner's personal code, as given by the client (not validated)."
          },
          "relation": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Beneficial owner's relation to the client, free text."
          }
        },
        "required": [
          "forOwnBenefit",
          "fullName",
          "personalCode",
          "relation"
        ],
        "description": "Answer to the beneficial owner question in the signed application."
      },
      "Applicant": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[\\p{L}\\p{M}][\\p{L}\\p{M}' .-]*$",
            "description": "First name, as in the signed application."
          },
          "lastName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[\\p{L}\\p{M}][\\p{L}\\p{M}' .-]*$",
            "description": "Last name, as in the signed application."
          },
          "personalCode": {
            "type": "string",
            "pattern": "^\\d{11}$",
            "description": "Lithuanian personal code (asmens kodas), 11 digits with a valid checksum. It matches the signing certificate (see `signature`).",
            "example": "50001018865"
          },
          "dateOfBirth": {
            "nullable": true,
            "description": "Date of birth derived from the personal code. `null` for the rare codes issued without a birth date.",
            "type": "string",
            "format": "date"
          },
          "phone": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{6,14}$",
            "description": "Mobile phone in E.164 format.",
            "example": "+37061234567"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Email address."
          },
          "address": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 300,
            "description": "Residential address as typed by the client, free text. Often `null`: most forms do not ask."
          },
          "maritalStatus": {
            "nullable": true,
            "description": "Marital status. Often `null`: the form asks only whether the client has a spouse (see `spouse`).",
            "allOf": [
              {
                "$ref": "#/components/schemas/MaritalStatus"
              }
            ]
          },
          "idDocumentType": {
            "nullable": true,
            "description": "Identity document type, when Finto staff asked for it. Often `null`.",
            "allOf": [
              {
                "$ref": "#/components/schemas/IdDocumentType"
              }
            ]
          },
          "incomes": {
            "minItems": 1,
            "maxItems": 5,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Income"
            },
            "description": "Income sources. At least one; each type appears at most once."
          },
          "obligations": {
            "$ref": "#/components/schemas/Obligations"
          },
          "monthlyExpenses": {
            "nullable": true,
            "type": "number",
            "minimum": 0,
            "maximum": 10000000,
            "description": "Monthly living expenses the client declared besides the obligations, EUR. Often `null`: most forms do not ask."
          },
          "pep": {
            "$ref": "#/components/schemas/Pep"
          },
          "beneficialOwner": {
            "$ref": "#/components/schemas/BeneficialOwner"
          }
        },
        "required": [
          "firstName",
          "lastName",
          "personalCode",
          "dateOfBirth",
          "phone",
          "email",
          "address",
          "maritalStatus",
          "idDocumentType",
          "incomes",
          "obligations",
          "monthlyExpenses",
          "pep",
          "beneficialOwner"
        ],
        "description": "The client who signed the application."
      },
      "Spouse": {
        "type": "object",
        "properties": {
          "participation": {
            "$ref": "#/components/schemas/SpouseParticipation"
          },
          "incomes": {
            "maxItems": 5,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Income"
            },
            "description": "Spouse's incomes, as in the signed application. Only when `participation` is `joint`; otherwise empty."
          },
          "firstName": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[\\p{L}\\p{M}][\\p{L}\\p{M}' .-]*$",
            "description": "Spouse's first name."
          },
          "lastName": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[\\p{L}\\p{M}][\\p{L}\\p{M}' .-]*$",
            "description": "Spouse's last name."
          },
          "personalCode": {
            "nullable": true,
            "type": "string",
            "pattern": "^\\d{11}$",
            "description": "Spouse's personal code.",
            "example": "50001018865"
          },
          "email": {
            "nullable": true,
            "description": "Spouse's email.",
            "type": "string",
            "format": "email"
          }
        },
        "required": [
          "participation",
          "incomes",
          "firstName",
          "lastName",
          "personalCode",
          "email"
        ],
        "description": "The client's spouse. The form collects only the participation and, for `joint`, the incomes. The spouse's identity is `null` until you ask for it with `info_required` (`spouse_data`) and Finto collects it."
      },
      "LoanRequest": {
        "type": "object",
        "properties": {
          "product": {
            "$ref": "#/components/schemas/Product"
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 10000000,
            "description": "Financing amount the client asks for, EUR. For car products this is the amount to finance, without the down payment. For `refinancing`, the amount the client wants to refinance."
          },
          "termMonths": {
            "nullable": true,
            "description": "Requested term in months. `null` when the form did not ask; offer the term you find suitable.",
            "type": "integer",
            "minimum": 1,
            "maximum": 480
          },
          "downPayment": {
            "nullable": true,
            "type": "number",
            "minimum": 0,
            "maximum": 10000000,
            "description": "Down payment the client offers, EUR. Car products only, otherwise `null`."
          }
        },
        "required": [
          "product",
          "amount",
          "termMonths",
          "downPayment"
        ],
        "description": "What the client asks for."
      },
      "Creditor": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Legal name, as printed in the signed application."
          },
          "companyCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20,
            "description": "Company registration code, as printed in the signed application."
          },
          "isYou": {
            "type": "boolean",
            "description": "True for your own row."
          }
        },
        "required": [
          "name",
          "companyCode",
          "isYou"
        ],
        "description": "One row of the creditor table in the signed application."
      },
      "Signature": {
        "type": "object",
        "properties": {
          "documentId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The signed application document. Download it with `GET /v1/applications/{applicationId}/documents/{documentId}`."
          },
          "templateVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "description": "Version of the application text the client signed, for example `2026-11-20`. Every version is published in the documentation before it is used."
          },
          "signedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the client signed."
          },
          "level": {
            "$ref": "#/components/schemas/SignatureLevel"
          },
          "signerName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[\\p{L}\\p{M}][\\p{L}\\p{M}' .-]*$",
            "description": "Signer's name from the signing certificate."
          },
          "signerPersonalCode": {
            "type": "string",
            "pattern": "^\\d{11}$",
            "description": "Signer's personal code from the signing certificate. Always equal to `applicant.personalCode`.",
            "example": "50001018865"
          }
        },
        "required": [
          "documentId",
          "templateVersion",
          "signedAt",
          "level",
          "signerName",
          "signerPersonalCode"
        ],
        "description": "The client's electronic signature of the application. The signed PDF is the legal record of the request and consents; the JSON fields mirror its content."
      },
      "Document": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Document id."
          },
          "type": {
            "$ref": "#/components/schemas/DocumentType"
          },
          "title": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Short title, when given."
          },
          "fileName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "File name."
          },
          "contentType": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Media type, for example `application/pdf`."
          },
          "sizeBytes": {
            "type": "integer",
            "minimum": 0,
            "description": "File size in bytes."
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "SHA-256 of the file, lowercase hex. Compare it with the file you download."
          },
          "uploadedBy": {
            "$ref": "#/components/schemas/DocumentUploader"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the document was added."
          }
        },
        "required": [
          "id",
          "type",
          "title",
          "fileName",
          "contentType",
          "sizeBytes",
          "sha256",
          "uploadedBy",
          "createdAt"
        ],
        "description": "A file attached to the application."
      },
      "DecisionSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Decision id."
          },
          "status": {
            "$ref": "#/components/schemas/DecisionStatus"
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When Finto received it."
          }
        },
        "required": [
          "id",
          "status",
          "receivedAt"
        ],
        "description": "Your current decision: the last one Finto accepted."
      },
      "Selection": {
        "type": "object",
        "properties": {
          "decisionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Your `approved` decision whose offer the client chose."
          },
          "selectedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the client chose it."
          }
        },
        "required": [
          "decisionId",
          "selectedAt"
        ],
        "description": "Set while the client's choice of your offer stands."
      },
      "Application": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Application id. Opaque; do not parse it."
          },
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "description": "Human-readable application number, for example `P-7KQ2MX`. Random, not sequential. Quote it when you contact Finto."
          },
          "version": {
            "type": "integer",
            "minimum": 1,
            "description": "Your view's version. Starts at 1 and increases by one whenever something you can see changes: corrected data, a document added for you. Your own uploads do not change it."
          },
          "versionNote": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Why the data last changed after signing, for example `Telefono numeris pataisytas kliento prašymu`. `null` while the data is as signed."
          },
          "state": {
            "$ref": "#/components/schemas/ApplicationState"
          },
          "closedReason": {
            "nullable": true,
            "description": "Set when `state` is `closed`.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ClosedReason"
              }
            ]
          },
          "closedAt": {
            "nullable": true,
            "type": "string",
            "format": "date-time",
            "description": "When the application was closed for you."
          },
          "replacedBy": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "With `closedReason` `duplicate`: the newer application that replaced this one, when it was also sent to you."
          },
          "channel": {
            "$ref": "#/components/schemas/Channel"
          },
          "submittedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the client signed the application."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When anything you can see last changed."
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "When Finto closes the application for you (`expired`) if nothing ends it before: 30 days after signing, 90 days once the client has chosen your offer."
          },
          "request": {
            "$ref": "#/components/schemas/LoanRequest"
          },
          "applicant": {
            "$ref": "#/components/schemas/Applicant"
          },
          "spouse": {
            "$ref": "#/components/schemas/Spouse"
          },
          "creditors": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Creditor"
            },
            "description": "Creditor table of the signed application: the lenders the client asked Finto to send the application to. Exactly one row has `isYou`."
          },
          "signature": {
            "$ref": "#/components/schemas/Signature"
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Document"
            },
            "description": "Documents you may access: the signed application, documents provided for you, and your own uploads."
          },
          "decision": {
            "nullable": true,
            "description": "Your current decision, `null` before the first one.",
            "allOf": [
              {
                "$ref": "#/components/schemas/DecisionSummary"
              }
            ]
          },
          "selection": {
            "nullable": true,
            "description": "Set when `state` is `offer_selected`.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Selection"
              }
            ]
          }
        },
        "required": [
          "id",
          "reference",
          "version",
          "versionNote",
          "state",
          "closedReason",
          "closedAt",
          "replacedBy",
          "channel",
          "submittedAt",
          "updatedAt",
          "expiresAt",
          "request",
          "applicant",
          "spouse",
          "creditors",
          "signature",
          "documents",
          "decision",
          "selection"
        ],
        "description": "An application sent to you, at its latest version."
      },
      "ApplicationSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Application id."
          },
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "description": "Human-readable application number."
          },
          "version": {
            "type": "integer",
            "minimum": 1,
            "description": "Your view's latest version."
          },
          "state": {
            "$ref": "#/components/schemas/ApplicationState"
          },
          "closedReason": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/ClosedReason"
              }
            ]
          },
          "channel": {
            "$ref": "#/components/schemas/Channel"
          },
          "product": {
            "$ref": "#/components/schemas/Product"
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 10000000,
            "description": "Requested amount, EUR."
          },
          "termMonths": {
            "nullable": true,
            "description": "Requested term in months.",
            "type": "integer",
            "minimum": 1,
            "maximum": 480
          },
          "submittedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the client signed the application."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When anything you can see last changed."
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "When Finto closes the application for you if nothing ends it before."
          },
          "decision": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/DecisionSummary"
              }
            ]
          }
        },
        "required": [
          "id",
          "reference",
          "version",
          "state",
          "closedReason",
          "channel",
          "product",
          "amount",
          "termMonths",
          "submittedAt",
          "updatedAt",
          "expiresAt",
          "decision"
        ],
        "description": "An application in a list. Contains no personal data."
      },
      "ApplicationList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationSummary"
            }
          },
          "nextCursor": {
            "nullable": true,
            "description": "Pass as `cursor` to get the next page. `null` on the last page.",
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "data",
          "nextCursor"
        ],
        "description": "A page of applications, most recently updated first."
      },
      "OfferInput": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 10000000,
            "description": "Credit amount you offer, EUR. May differ from the requested amount. For car products, without the down payment."
          },
          "termMonths": {
            "type": "integer",
            "minimum": 1,
            "maximum": 480,
            "description": "Term in months."
          },
          "monthlyPayment": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 10000000,
            "description": "Regular monthly payment, EUR, including any monthly fee."
          },
          "annualInterestRate": {
            "type": "number",
            "minimum": 0,
            "maximum": 200,
            "description": "Annual nominal interest rate, percent (`8.9` means 8.9 %). For a variable rate, the current total rate (base rate plus margin). From 0 to 200, up to 3 decimals."
          },
          "aprc": {
            "type": "number",
            "minimum": 0,
            "maximum": 200,
            "description": "Annual percentage rate of charge (BVKKMN), percent, as in your SECCI form. From 0 to 200, up to 3 decimals."
          },
          "totalAmountPayable": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 10000000,
            "description": "Total the client pays under the agreement over the term, EUR: all instalments, fees and any residual value; without the down payment. At least `amount`."
          },
          "validUntil": {
            "type": "string",
            "format": "date",
            "description": "Last day the offer is valid, inclusive, Europe/Vilnius time. Not in the past and at most 180 days ahead."
          },
          "interestRateType": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/InterestRateType"
              }
            ]
          },
          "contractFee": {
            "nullable": true,
            "type": "number",
            "minimum": 0,
            "maximum": 10000000,
            "description": "One-time contract or arrangement fee, EUR."
          },
          "monthlyFee": {
            "nullable": true,
            "type": "number",
            "minimum": 0,
            "maximum": 10000000,
            "description": "Monthly administration fee, EUR."
          },
          "downPayment": {
            "nullable": true,
            "type": "number",
            "minimum": 0,
            "maximum": 10000000,
            "description": "Down payment the client must pay, EUR. Car products."
          },
          "residualValue": {
            "nullable": true,
            "type": "number",
            "minimum": 0,
            "maximum": 10000000,
            "description": "Residual (balloon) value due at the end of the term, EUR. Car leasing."
          },
          "conditions": {
            "nullable": true,
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500,
              "description": "One condition."
            },
            "description": "Conditions the client must meet before signing, in plain Lithuanian, for example `Privalomas KASKO draudimas`. Shown to Finto staff and to the client. No links."
          },
          "continueUrl": {
            "nullable": true,
            "type": "string",
            "maxLength": 2000,
            "format": "uri",
            "description": "Your https page where the client continues (identification, agreement). Its host must be one of your hosts registered with Finto. Given to the client after they choose your offer, with the host shown."
          },
          "documentIds": {
            "nullable": true,
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Document id."
            },
            "description": "Your own uploads on this application that belong to the offer, for example the SECCI form. Upload them first."
          }
        },
        "required": [
          "amount",
          "termMonths",
          "monthlyPayment",
          "annualInterestRate",
          "aprc",
          "totalAmountPayable",
          "validUntil"
        ],
        "additionalProperties": false,
        "description": "Your offer. Required when `status` is `approved`."
      },
      "Offer": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 10000000,
            "description": "Credit amount you offer, EUR. May differ from the requested amount. For car products, without the down payment."
          },
          "termMonths": {
            "type": "integer",
            "minimum": 1,
            "maximum": 480,
            "description": "Term in months."
          },
          "monthlyPayment": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 10000000,
            "description": "Regular monthly payment, EUR, including any monthly fee."
          },
          "annualInterestRate": {
            "type": "number",
            "minimum": 0,
            "maximum": 200,
            "description": "Annual nominal interest rate, percent (`8.9` means 8.9 %). For a variable rate, the current total rate (base rate plus margin). From 0 to 200, up to 3 decimals."
          },
          "aprc": {
            "type": "number",
            "minimum": 0,
            "maximum": 200,
            "description": "Annual percentage rate of charge (BVKKMN), percent, as in your SECCI form. From 0 to 200, up to 3 decimals."
          },
          "totalAmountPayable": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 10000000,
            "description": "Total the client pays under the agreement over the term, EUR: all instalments, fees and any residual value; without the down payment. At least `amount`."
          },
          "validUntil": {
            "type": "string",
            "format": "date",
            "description": "Last day the offer is valid, inclusive, Europe/Vilnius time. Not in the past and at most 180 days ahead."
          },
          "interestRateType": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/InterestRateType"
              }
            ]
          },
          "contractFee": {
            "nullable": true,
            "type": "number",
            "minimum": 0,
            "maximum": 10000000,
            "description": "One-time contract or arrangement fee, EUR."
          },
          "monthlyFee": {
            "nullable": true,
            "type": "number",
            "minimum": 0,
            "maximum": 10000000,
            "description": "Monthly administration fee, EUR."
          },
          "downPayment": {
            "nullable": true,
            "type": "number",
            "minimum": 0,
            "maximum": 10000000,
            "description": "Down payment the client must pay, EUR. Car products."
          },
          "residualValue": {
            "nullable": true,
            "type": "number",
            "minimum": 0,
            "maximum": 10000000,
            "description": "Residual (balloon) value due at the end of the term, EUR. Car leasing."
          },
          "conditions": {
            "nullable": true,
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500,
              "description": "One condition."
            },
            "description": "Conditions the client must meet before signing, in plain Lithuanian, for example `Privalomas KASKO draudimas`. Shown to Finto staff and to the client. No links."
          },
          "continueUrl": {
            "nullable": true,
            "type": "string",
            "maxLength": 2000,
            "format": "uri",
            "description": "Your https page where the client continues (identification, agreement). Its host must be one of your hosts registered with Finto. Given to the client after they choose your offer, with the host shown."
          },
          "documentIds": {
            "nullable": true,
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Document id."
            },
            "description": "Your own uploads on this application that belong to the offer, for example the SECCI form. Upload them first."
          }
        },
        "required": [
          "amount",
          "termMonths",
          "monthlyPayment",
          "annualInterestRate",
          "aprc",
          "totalAmountPayable",
          "validUntil",
          "interestRateType",
          "contractFee",
          "monthlyFee",
          "downPayment",
          "residualValue",
          "conditions",
          "continueUrl",
          "documentIds"
        ],
        "description": "An offer as Finto stored it. Fields you did not send are `null`."
      },
      "RequirementInput": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/RequirementType"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "What exactly you need, in plain Lithuanian, for example `Pažyma apie pajamas už paskutinius 6 mėnesius`. Shown to Finto staff and to the client. No links."
          }
        },
        "required": [
          "type",
          "description"
        ],
        "additionalProperties": false,
        "description": "One thing you need before you can decide."
      },
      "Requirement": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/RequirementType"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "What exactly you need, in plain Lithuanian, for example `Pažyma apie pajamas už paskutinius 6 mėnesius`. Shown to Finto staff and to the client. No links."
          }
        },
        "required": [
          "type",
          "description"
        ],
        "description": "One thing you need before you can decide."
      },
      "ContractInfoInput": {
        "type": "object",
        "properties": {
          "signedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the client signed the agreement."
          },
          "amount": {
            "nullable": true,
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 10000000,
            "description": "Credit amount in the signed agreement, EUR."
          },
          "termMonths": {
            "nullable": true,
            "type": "integer",
            "minimum": 1,
            "maximum": 480,
            "description": "Term in the signed agreement, months."
          },
          "contractNumber": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Your agreement number."
          }
        },
        "required": [
          "signedAt"
        ],
        "additionalProperties": false,
        "description": "The signed agreement. Required when `status` is `contract_signed`."
      },
      "ContractInfo": {
        "type": "object",
        "properties": {
          "signedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the client signed the agreement."
          },
          "amount": {
            "nullable": true,
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 10000000,
            "description": "Credit amount in the signed agreement, EUR."
          },
          "termMonths": {
            "nullable": true,
            "type": "integer",
            "minimum": 1,
            "maximum": 480,
            "description": "Term in the signed agreement, months."
          },
          "contractNumber": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Your agreement number."
          }
        },
        "required": [
          "signedAt",
          "amount",
          "termMonths",
          "contractNumber"
        ],
        "description": "The signed agreement as Finto stored it."
      },
      "DisbursementInput": {
        "type": "object",
        "properties": {
          "disbursedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the money was paid out."
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 10000000,
            "description": "Amount paid out, EUR: the financed amount, without the down payment. If you pay out in parts, send `disbursed` again with the total so far."
          }
        },
        "required": [
          "disbursedAt",
          "amount"
        ],
        "additionalProperties": false,
        "description": "The payout. Required when `status` is `disbursed`."
      },
      "Disbursement": {
        "type": "object",
        "properties": {
          "disbursedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the money was paid out."
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 10000000,
            "description": "Amount paid out, EUR: the financed amount, without the down payment. If you pay out in parts, send `disbursed` again with the total so far."
          }
        },
        "required": [
          "disbursedAt",
          "amount"
        ],
        "description": "The payout as Finto stored it."
      },
      "TerminationInput": {
        "type": "object",
        "properties": {
          "endedOn": {
            "type": "string",
            "format": "date",
            "description": "Day the agreement ended, Europe/Vilnius time. Not in the future."
          },
          "reason": {
            "$ref": "#/components/schemas/TerminationReason"
          }
        },
        "required": [
          "endedOn",
          "reason"
        ],
        "additionalProperties": false,
        "description": "How an agreement that was paid out ended early. Required when `status` is `terminated`."
      },
      "Termination": {
        "type": "object",
        "properties": {
          "endedOn": {
            "type": "string",
            "format": "date",
            "description": "Day the agreement ended, Europe/Vilnius time. Not in the future."
          },
          "reason": {
            "$ref": "#/components/schemas/TerminationReason"
          }
        },
        "required": [
          "endedOn",
          "reason"
        ],
        "description": "The early end of the agreement as Finto stored it."
      },
      "DecisionCreate": {
        "type": "object",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/DecisionStatus"
          },
          "applicationVersion": {
            "type": "integer",
            "minimum": 1,
            "description": "The application `version` you based this decision on: the one you fetched. Must not be higher than the latest. Finto uses it to tell a decision on old data from one on new data."
          },
          "previousDecisionId": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Optional safety check: the id of your current decision as you know it (`null` before your first one). If it is not your current decision any more, the request fails with `409 decision_conflict`: fetch the application and decide again."
          },
          "decidedAt": {
            "nullable": true,
            "type": "string",
            "format": "date-time",
            "description": "When you made the decision, for display. Not in the future and not before the application was submitted. Finto applies decisions in the order it receives them, not by this time."
          },
          "lenderReference": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Your own application number. Send it once you have one; Finto shows it to its staff."
          },
          "message": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "Free text for Finto staff, for example what to tell the client. Never shown to the client as is."
          },
          "offer": {
            "description": "Required when `status` is `approved`, otherwise not allowed.",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/OfferInput"
              }
            ]
          },
          "requirements": {
            "description": "Required (1 to 10) when `status` is `info_required`, otherwise not allowed. An empty list counts as not sent.",
            "nullable": true,
            "maxItems": 10,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequirementInput"
            }
          },
          "rejectionReason": {
            "description": "Optional with `rejected`, otherwise not allowed.",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/RejectionReason"
              }
            ]
          },
          "cancellationReason": {
            "description": "Required when `status` is `cancelled`, otherwise not allowed.",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/CancellationReason"
              }
            ]
          },
          "contract": {
            "description": "Required when `status` is `contract_signed`. Optional with `disbursed`. Otherwise not allowed.",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/ContractInfoInput"
              }
            ]
          },
          "disbursement": {
            "description": "Required when `status` is `disbursed`, otherwise not allowed.",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/DisbursementInput"
              }
            ]
          },
          "termination": {
            "description": "Required when `status` is `terminated`, otherwise not allowed.",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/TerminationInput"
              }
            ]
          }
        },
        "required": [
          "status",
          "applicationVersion"
        ],
        "additionalProperties": false,
        "description": "A decision or progress update. `status` decides which other fields are required; see the field descriptions and the lifecycle guide."
      },
      "Decision": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Decision id."
          },
          "applicationId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Application id."
          },
          "applicationVersion": {
            "type": "integer",
            "minimum": 1,
            "description": "The application version the decision is based on, as you sent it."
          },
          "status": {
            "$ref": "#/components/schemas/DecisionStatus"
          },
          "decidedAt": {
            "nullable": true,
            "type": "string",
            "format": "date-time",
            "description": "When you made the decision, as you sent it."
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When Finto received it. Decisions are applied in this order."
          },
          "lenderReference": {
            "nullable": true,
            "type": "string"
          },
          "message": {
            "nullable": true,
            "type": "string"
          },
          "offer": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/Offer"
              }
            ]
          },
          "requirements": {
            "nullable": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Requirement"
            }
          },
          "rejectionReason": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/RejectionReason"
              }
            ]
          },
          "cancellationReason": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/CancellationReason"
              }
            ]
          },
          "contract": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/ContractInfo"
              }
            ]
          },
          "disbursement": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/Disbursement"
              }
            ]
          },
          "termination": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/Termination"
              }
            ]
          }
        },
        "required": [
          "id",
          "applicationId",
          "applicationVersion",
          "status",
          "decidedAt",
          "receivedAt",
          "lenderReference",
          "message",
          "offer",
          "requirements",
          "rejectionReason",
          "cancellationReason",
          "contract",
          "disbursement",
          "termination"
        ],
        "description": "A decision as Finto stored it. Fields you did not send are `null`."
      },
      "DecisionList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Decision"
            }
          }
        },
        "required": [
          "data"
        ],
        "description": "Your decisions on one application, newest first."
      },
      "EventData": {
        "type": "object",
        "properties": {
          "applicationId": {
            "nullable": true,
            "description": "Application the event is about. `null` for `ping`.",
            "type": "string"
          },
          "reference": {
            "nullable": true,
            "description": "Human-readable application number. `null` for `ping`.",
            "type": "string"
          },
          "version": {
            "nullable": true,
            "description": "Your view's application version at the time of the event. `null` for `ping`.",
            "type": "integer",
            "minimum": 1
          },
          "changes": {
            "nullable": true,
            "description": "`application.updated` only: what changed.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationChange"
            }
          },
          "closedReason": {
            "nullable": true,
            "description": "`application.closed` only.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ClosedReason"
              }
            ]
          },
          "decisionId": {
            "nullable": true,
            "description": "`offer.selected` only: your decision whose offer was chosen.",
            "type": "string"
          }
        },
        "required": [
          "applicationId",
          "reference",
          "version",
          "changes",
          "closedReason",
          "decisionId"
        ],
        "description": "Identifiers only. Events never contain personal data: fetch the application to see what changed."
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Event id. Use it to ignore duplicates."
          },
          "sequence": {
            "type": "integer",
            "minimum": 1,
            "description": "Your event number: 1 for your first event, then one more for each next one, without gaps. Use it as the `after` cursor of `GET /v1/events`."
          },
          "type": {
            "$ref": "#/components/schemas/EventType"
          },
          "environment": {
            "$ref": "#/components/schemas/Environment"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the event happened."
          },
          "data": {
            "$ref": "#/components/schemas/EventData"
          }
        },
        "required": [
          "id",
          "sequence",
          "type",
          "environment",
          "createdAt",
          "data"
        ],
        "description": "Something happened that concerns you. Sent as a webhook and kept in the events feed for 30 days. Webhooks may arrive in any order; the feed is always in `sequence` order."
      },
      "EventList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            },
            "description": "Events after the cursor, in `sequence` order."
          },
          "hasMore": {
            "type": "boolean",
            "description": "Whether more events are waiting: call again right away with the new cursor."
          },
          "lastSequence": {
            "type": "integer",
            "minimum": 0,
            "description": "Store it and pass it as `after` next time. Equals `after` when `data` is empty."
          }
        },
        "required": [
          "data",
          "hasMore",
          "lastSequence"
        ],
        "description": "A page of the events feed."
      },
      "Me": {
        "type": "object",
        "properties": {
          "lender": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "Your lender id at Finto."
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "Your name as Finto shows it."
              },
              "companyCode": {
                "type": "string",
                "minLength": 1,
                "maxLength": 20,
                "description": "Your company registration code."
              }
            },
            "required": [
              "id",
              "name",
              "companyCode"
            ]
          },
          "environment": {
            "$ref": "#/components/schemas/Environment"
          },
          "apiKey": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "Key id."
              },
              "prefix": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32,
                "description": "First characters of the key, to tell keys apart."
              },
              "label": {
                "nullable": true,
                "description": "Label Finto gave the key.",
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time",
                "description": "When the key was created."
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time",
                "description": "When the key stops working: at most 12 months after it was created. Finto reminds you 30 days before."
              }
            },
            "required": [
              "id",
              "prefix",
              "label",
              "createdAt",
              "expiresAt"
            ]
          },
          "requestIp": {
            "type": "string",
            "minLength": 1,
            "maxLength": 45,
            "description": "Your IP address as Finto sees it. It must be in `allowedIps` (live environment)."
          },
          "allowedIps": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "IP addresses and ranges (CIDR) allowed for your keys."
          },
          "webhook": {
            "type": "object",
            "properties": {
              "url": {
                "nullable": true,
                "description": "Where Finto sends events. `null`: you only use the events feed.",
                "type": "string"
              },
              "enabled": {
                "type": "boolean"
              }
            },
            "required": [
              "url",
              "enabled"
            ]
          },
          "webhookSourceIps": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Addresses Finto sends webhooks from. Allow them in your firewall."
          },
          "continueUrlHosts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Hosts registered for your `offer.continueUrl`."
          }
        },
        "required": [
          "lender",
          "environment",
          "apiKey",
          "requestIp",
          "allowedIps",
          "webhook",
          "webhookSourceIps",
          "continueUrlHosts"
        ],
        "description": "Your connection as Finto sees it. Use it to check the key, your IP and your webhook settings."
      },
      "RevokedApiKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Key id."
          },
          "prefix": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "description": "First characters of the key."
          },
          "revokedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the key was revoked."
          }
        },
        "required": [
          "id",
          "prefix",
          "revokedAt"
        ],
        "description": "The key that was revoked. It no longer works."
      },
      "ProblemCode": {
        "type": "string",
        "description": "Machine-readable error code. Branch on it, not on `title` or `detail`. New codes may be added; treat an unknown one by its HTTP status. The errors guide explains each one.",
        "x-extensible-enum": [
          "bad_request",
          "unauthorized",
          "ip_not_allowed",
          "not_found",
          "idempotency_key_required",
          "idempotency_key_reused",
          "idempotency_key_in_progress",
          "invalid_transition",
          "decision_conflict",
          "application_closed",
          "application_withdrawn",
          "application_archived",
          "cursor_expired",
          "quota_exceeded",
          "payload_too_large",
          "unsupported_media_type",
          "validation_failed",
          "rate_limited",
          "internal_error",
          "service_unavailable"
        ]
      },
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "URI of the error description in the documentation."
          },
          "title": {
            "type": "string",
            "description": "Short summary, the same for every occurrence of the code."
          },
          "status": {
            "type": "integer",
            "minimum": 400,
            "maximum": 599,
            "description": "HTTP status code."
          },
          "code": {
            "$ref": "#/components/schemas/ProblemCode"
          },
          "detail": {
            "nullable": true,
            "description": "What went wrong in this request.",
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "description": "Quote it when you contact Finto. Same as the `Finto-Request-Id` header."
          },
          "errors": {
            "nullable": true,
            "description": "Field errors for `validation_failed`, otherwise `null`.",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "description": "Field path, for example `offer.aprc`."
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "path",
                "message"
              ]
            }
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "code",
          "detail",
          "requestId",
          "errors"
        ],
        "description": "Error response (RFC 9457 problem details), media type `application/problem+json`."
      },
      "SandboxApplicationCreate": {
        "type": "object",
        "properties": {
          "scenario": {
            "description": "Defaults to `standard`.",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/SandboxScenario"
              }
            ]
          },
          "product": {
            "description": "Overrides the scenario's product.",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/Product"
              }
            ]
          },
          "amount": {
            "nullable": true,
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 10000000,
            "description": "Overrides the requested amount, EUR."
          },
          "termMonths": {
            "description": "Overrides the requested term.",
            "nullable": true,
            "type": "integer",
            "minimum": 1,
            "maximum": 480
          }
        },
        "additionalProperties": false,
        "description": "Creates a signed test application addressed to you only. You get `application.submitted` as with a real one."
      },
      "SandboxSimulate": {
        "type": "object",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/SandboxAction"
          }
        },
        "required": [
          "action"
        ],
        "additionalProperties": false,
        "description": "Simulates the next step of the client or Finto."
      },
      "SandboxSimulateResult": {
        "type": "object",
        "properties": {
          "event": {
            "$ref": "#/components/schemas/Event"
          }
        },
        "required": [
          "event"
        ],
        "description": "The event the action produced. It is also delivered as a webhook and appears in the feed."
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key",
        "description": "`Authorization: Bearer fnt_test_...` in the sandbox, `fnt_live_...` in live. Keys are issued by Finto, shown once, and expire after at most 12 months. Requests must also come from an allowed IP address."
      }
    },
    "parameters": {
      "ApplicationId": {
        "name": "applicationId",
        "in": "path",
        "required": true,
        "description": "Application id from the event or the list.",
        "schema": {
          "type": "string"
        }
      },
      "IdempotencyKeyRequired": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "A unique value per intended change, ideally a UUID you store with the change and reuse on every retry of it. The same key with the same body returns the original result; with a different body or on another application it is rejected (`idempotency_key_reused`). See the conventions guide.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "IdempotencyKeyOptional": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "Optional. Same meaning as for decisions.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      }
    },
    "headers": {
      "RequestId": {
        "description": "Unique id of the request. Quote it when you contact Finto.",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Malformed request, or the `Idempotency-Key` header is missing (`bad_request`, `idempotency_key_required`).",
        "headers": {
          "Finto-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing, unknown, expired or revoked API key, or a key of the other environment (`unauthorized`).",
        "headers": {
          "Finto-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "IpNotAllowed": {
        "description": "The request came from an IP address that is not on your allow-list (`ip_not_allowed`).",
        "headers": {
          "Finto-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "NotFound": {
        "description": "No such resource for you (`not_found`). Applications and documents not sent to you also return `404`.",
        "headers": {
          "Finto-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Gone": {
        "description": "The client withdrew consent (`application_withdrawn`), the data access period ended (`application_archived`), or events after your cursor were deleted (`cursor_expired`).",
        "headers": {
          "Finto-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Conflict": {
        "description": "The change is not allowed now (`invalid_transition`, `application_closed`, `decision_conflict`, `idempotency_key_in_progress`).",
        "headers": {
          "Finto-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "PayloadTooLarge": {
        "description": "The body or file is too large (`payload_too_large`).",
        "headers": {
          "Finto-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "UnsupportedMediaType": {
        "description": "Wrong content type, or a file that is not a PDF (`unsupported_media_type`).",
        "headers": {
          "Finto-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "ValidationFailed": {
        "description": "The request did not pass validation (`validation_failed`, `idempotency_key_reused`, `quota_exceeded`). `errors` lists the fields.",
        "headers": {
          "Finto-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            },
            "example": {
              "type": "https://partners.finto.lt/docs/errors#validation_failed",
              "title": "Request validation failed",
              "status": 422,
              "code": "validation_failed",
              "detail": "2 fields are invalid.",
              "requestId": "req_8c1f0e6b2a",
              "errors": [
                {
                  "path": "offer.aprc",
                  "message": "Required"
                },
                {
                  "path": "offer.validUntil",
                  "message": "Must not be in the past"
                }
              ]
            }
          }
        }
      },
      "RateLimited": {
        "description": "More than 600 requests per minute with this key (`rate_limited`). Wait for `Retry-After` seconds.",
        "headers": {
          "Finto-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "Retry-After": {
            "description": "Seconds to wait.",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "InternalError": {
        "description": "Something failed on Finto's side (`internal_error`). Retry with backoff; repeating a `POST` with the same `Idempotency-Key` is safe.",
        "headers": {
          "Finto-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "Finto is briefly unavailable, for example during a deployment (`service_unavailable`). Retry with backoff.",
        "headers": {
          "Finto-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    }
  }
}
