openapi: 3.1.0
info:
  name: BaaS API documentation
  version: ''
  title: BaaS API documentation
  contact:
    email: contact@narvi.com
    url: https://narvi.com/contact-us
servers:
  - url: https://api.narvi.com
    description: Production API
tags:
  - name: Authorization
    description: |
      We use cryptographic signature to authorize API requests.<br> To configure your API keys for selected entity please login to our banking app [Developer Section](https://my.narvi.com/app/developers/config/api-keys).<br> You have to configure your whitelisted IPs and public key which will be used for request signature verification.<br> <b>Do not share your private key with anybody. We will never asks you for private key.</b><br>
      ## API HOSTNAME
      Please note that we use <b>api.narvi.com</b> fully qualified domain to interact with your integration. All your api requests should use this domain to communicate with our REST API.
      ## Request Authorization
      Each request needs to have the following headers:<br> - API-KEY-ID - api key id gathered from configured api key [Developer Section](https://my.narvi.com/app/developers/config/api-keys)<br> - API-REQUEST-ID - request ID, valid UUID, can't be duplicated across requests <br> - API-REQUEST-SIGNATURE - request signature<br>

      <b>API-REQUEST-ID</b> (Request ID)<br> - valid UUID, <br> - it can't be duplicated across requests<br>

      <b>API-REQUEST-SIGNATURE</b> (Request signature)</br> Request signature is the signature of sha256 of the concatenated following items (request descriptor)<br> - the absolute request url without query params (e.g. `http://api.narvi.com/rest/v1.0/transactions/create`)<br> - the uppercase request method (e.g. POST, GET, PUT, DELETE)<br> - request ID - valid UUID, can't be duplicated across requests<br> - query params encoded in JSON canonical form - RFC 7159 JSON (The order of JSON key-value pairs is very important. Please double-check that it is in the correct canonical form. All query parameters keys and values must have the string type. Use an empty string instead if there are no query parameters).<br> - payload encoded in JSON canonical form - RFC 7159 JSON (The order of JSON key-value pairs is very important. Please double-check that it is in the correct canonical form. Use an empty string instead if there is no payload)<br> - if payload contains file object use sha256 of the file content to create payload canonical form for request descriptor<br>

      <b>Signature example</b></br> For <b>GET</b> request `https://api.narvi.com/?account_pid=KFGKJ5L27ASGTZAO&kind=CREDIT` the signature should be created as follow:<br> - generate request uuid: e.g. da43520e-800b-41c5-a4a9-7287a64c87fa <br> - generate request descriptor: <code>https&#58;//api.narvi.com/rest/v1.0/transactions/listGETda43520e-800b-41c5-a4a9-7287a64c87fa{\"\account_pid\":\"KFGKJ5L27ASGTZAO\",\"kind\":\"CREDIT\"}</code><br> - generate sha256 of the request descriptor<br> - generate signature with hashing algorithm sha256 of the generated sha256 above<br> - encode the signature with base64<br>

      For <b>POST</b> request `https://api.narvi.com/rest/v1.0/transactions/create` with the payload </br> <code>{\"account_pid\": \"KFGKJ5L27ASGTZAO\" ,\"recipient\": {\"name\": \"John Doe\", \"number\": \"FI8379600186405354\" ,\"bic\": \"NARIFXX\", \"country\": \"FI\"}, \"currency\": \"EUR\",\"amount\": 100, \"remittance_information\":\{\"ustrd\": \"test transfer\"}}</code></br> the signature should be created as follow:<br> - generate request ID: e.g. da43520e-800b-41c5-a4a9-7287a64c87fa <br> - generate request descriptor: <code>https&#58;//api.narvi.com/rest/v1.0/transactions/createPOSTda43520e-800b-41c5-a4a9-7287a64c87fa{\"account_pid\":\"KFGKJ5L27ASGTZAO\",\"amount\":\"100\",\"currency\":\"EUR\",\"recipient\":{\"bic\":\"NARIFXX\",\"country\":\"FI\",\"name\":\"John Doe\",\"number\":\"FI8379600186405354\"},\"remittance_information\":{\"ustrd\":\"test transfer\"}}</code><br> - generate sha256 of the request descriptor <br> - generate signature with hashing algorithm sha256 of the generated sha256 above<br> - encode the signature with base64<br>
  - name: Webhooks
    description: |
      To enable webhooks, please login to [Developer Section](https://my.narvi.com/app/settings/update/webhook-create) and configure webhook endpoints for selected entity. After you enable them, we will push real-time event data to your application's webhook endpoint when events happen in your banking account. We use HTTPS to send webhook events to your app as a JSON payload that includes an Event object.<br>

      ## Webhooks IPs
      The full list of IP addresses that api.narvi.com may resolve to is:<br> <b>3.76.153.24</b>

      ## Delivery behaviours
      We attempt to deliver the event to your webhook endpoint for up to 3 days with an exponential back off. In the log section of the Dashboard, you can view when the next retry will occur. If your endpoint has been disabled or deleted when we attempt a retry, future retries are cancelled. <br>
      Your endpoint must quickly return a successful status code (2xx) prior to any complex logic that could cause a timeout. For example, you must return a 200 response before updating a customer’s balance.

      ## Delivery headers
      HTTP payloads that are delivered to your webhook's configured URL endpoint will contain several special headers:<br> - USER-AGENT - always equal 'webhook'<br> - WEBHOOK-REQUEST-TIMESTAMP - timestamp in millisecond when webhook action occured<br> - WEBHOOK-REQUEST-EVENT-TYPE - the event type<br> - WEBHOOK-REQUEST-EVENT-PID - event public id<br> - WEBHOOK-REQUEST-SIGNATURE - This is the sha256 hex digest of the request body and parameters<br>

      ## Webhook signature

      Webhook signature must be checked by integrated application before processing the webhook data. <br> Webhook signature is the sha256 hex digest of the concatenated following items (request descriptor)<br> - the absolute webhook endpoint without query params (e.g. `https://example.com/webhook/handler`)<br> - the uppercase request method (e.g. POST, GET, PUT, DELETE)<br> - current timestamp in microseconds (taken from request header WEBHOOK-REQUEST-TIMESTAMP)<br> - event type (taken from request header WEBHOOK-REQUEST-EVENT-TYPE)<br> - event public id (taken from request header WEBHOOK-REQUEST-EVENT-PID)<br> - query params encoded in JSON canonical form - RFC 7159 JSON (The order of JSON key-value pairs is very important. Please double-check that it is in the correct canonical form. All query parameters keys and values must have the string type. Use an empty string instead if there are no query parameters)<br> - payload encoded in JSON canonical form - RFC 7159 JSON (The order of JSON key-value pairs is very important. Please double-check that it is in the correct canonical form. Use an empty string instead if there is no payload)<br> - webhook secret taken from developer panel
  - name: Account API Account
    x-displayName: Accounts
  - name: Account API Transaction
    x-displayName: Transactions
  - name: Account API Webhooks
    x-displayName: Webhooks
  - name: BaaS API Files
    x-displayName: Files
  - name: BaaS API Privates
    x-displayName: Privates
  - name: BaaS API Businesses
    x-displayName: Businesses
  - name: Baas API Challenges
    x-displayName: Challenges
    description: |
      We store customer authorization data such as <b>email</b> and <b>phone number</b> in order to authenticate requests submitted by the partner's BaaS. Wherever the REST API returns a 2fa challenge object, the final client must confirm the requested action by entering the correct OTP code in the interface.
      To enable this, the BaaS partner must display an iframe to the end user as described in the [FORM ELEMENTS documentation](/docs/baas/web-elements).
      Challenge signature should be generated in the following way: <br> - concatenate challenge_pid, target (email or phone numer) and private public id<br> - signature is the encoded base64 signature of challenge descriptor <br>
      Example: <br> - BaaS partner received challenge object for the private with pid \"68156984\" and email address example@example.com<br> <code>{\"pid\": \"T83H6LH48MMYS497\", \"kind\": \"EMAIL\", \"number\": 5, \"added\": \"1720954148.018724\", \"target\": \"e******@example.com"\, \"expired\": \"1720954448.018724\", \"resent\": \"1720954148.018748\"}</code><br> - BaaS partner generates challenge descriptor as follow: <br> <code>T83H6LH48MMYS497example\@example.com68156984</code><br> - The secret is the base64 encoded signature of the following challenge descriptor.
  - name: Baas API Accounts
    x-displayName: Accounts
  - name: Baas API Transactions
    x-displayName: Transactions
  - name: BaaS API Webhooks
    x-displayName: Webhooks
x-tagGroups:
  - name: General
    tags:
      - Authorization
      - Webhooks
  - name: BaaS API
    tags:
      - BaaS API Privates
      - BaaS API Businesses
      - Baas API Accounts
      - Baas API Transactions
      - BaaS API Files
      - Baas API Challenges
      - BaaS API Webhooks
paths:
  /baas/v1.0/file/upload:
    post:
      operationId: Upload File
      description: ''
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileSchema'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/FileSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FileSchema'
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileSchema'
          description: ''
      tags:
        - BaaS API Files
  /baas/v1.0/file/{pid}/retrieve:
    get:
      operationId: Retrieve File Details
      description: ''
      parameters:
        - name: pid
          in: path
          required: true
          description: ''
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileSchema'
          description: ''
      tags:
        - BaaS API Files
  /baas/v1.0/file/{pid}/download:
    get:
      operationId: Download File
      description: ''
      parameters:
        - name: pid
          in: path
          required: true
          description: ''
          schema:
            type: string
      responses:
        '200':
          content:
            file:
              schema:
                type: string
                format: binary
      tags:
        - BaaS API Files
  /baas/v1.0/challenge/{pid}/retrieve:
    get:
      operationId: Retrieve challenge details.
      description: ''
      parameters:
        - name: pid
          in: path
          required: true
          description: Challenge public id
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChallengeSchema'
          description: ''
      tags:
        - Baas API Challenges
  /baas/v1.0/entity/private/create:
    post:
      operationId: Create Person Resource
      description: ''
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrivateEntityUpdateSchema'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PrivateEntityUpdateSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PrivateEntityUpdateSchema'
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrivateEntitySchema'
          description: ''
      tags:
        - BaaS API Privates
  /baas/v1.0/entity/private/{pid}/update:
    put:
      operationId: Update Person Resource
      description: Update a person resource (only when change request status is RETRY).
      parameters:
        - name: pid
          example: '50954001'
          in: path
          required: true
          description: Person public id
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrivateEntityUpdateSchema'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PrivateEntityUpdateSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PrivateEntityUpdateSchema'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrivateEntitySchema'
          description: ''
      tags:
        - BaaS API Privates
  /baas/v1.0/entity/private/{pid}/retrieve:
    get:
      operationId: Retrieve Person Resource
      description: ''
      parameters:
        - name: pid
          example: '50954001'
          in: path
          required: true
          description: Person public id
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrivateEntitySchema'
          description: ''
      tags:
        - BaaS API Privates
  /baas/v1.0/entity/private/list:
    get:
      operationId: List Person Resources
      description: ''
      parameters:
        - name: cursor
          required: false
          in: query
          description: The pagination cursor value.
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  next:
                    type: string
                    nullable: true
                  previous:
                    type: string
                    nullable: true
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/PrivateEntitySchema'
          description: ''
      tags:
        - BaaS API Privates
  /baas/v1.0/entity/private/settings/update/init:
    put:
      operationId: OTP Settings Update Init
      description: |
        Initiate challenge session for changing 2fa factors (email, phone). Before user change 2fa factors he must confirm via two challenges (EMAIL, SMS).
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserSettingsUpdateInitSchema'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserSettingsUpdateInitSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserSettingsUpdateInitSchema'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserSettingsUpdateInitSchema'
          description: ''
      tags:
        - BaaS API Privates
  /baas/v1.0/entity/private/settings/update/complete:
    put:
      operationId: OTP Settings Update Complete
      description: Request another challenge for challenge session.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserSettingsUpdateCompleteSchema'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserSettingsUpdateCompleteSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserSettingsUpdateCompleteSchema'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserSettingsUpdateCompleteSchema'
          description: ''
      tags:
        - BaaS API Privates
  /baas/v1.0/entity/private/settings/update/finish:
    put:
      operationId: OTP Settings Update Finish
      description: Request challenge for new email or phone.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserSettingsUpdateFinishSchema'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserSettingsUpdateFinishSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserSettingsUpdateFinishSchema'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserSettingsUpdateFinishSchema'
          description: ''
      tags:
        - BaaS API Privates
  /baas/v1.0/entity/business/create:
    post:
      operationId: Create Business Resource
      description: 'In order for the created business entity to be analyzed by the compliance team, it must have an administrator with a verified identity. See more about reusable KYC: https://api.narvi.com/docs/baas/reusable-kyc'
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessEntityUpdateSchema'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BusinessEntityUpdateSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BusinessEntityUpdateSchema'
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessEntitySchema'
          description: ''
      tags:
        - BaaS API Businesses
  /baas/v1.0/entity/business/{pid}/update:
    put:
      operationId: Update Business Resource
      description: Update business resource (only when change request status is RETRY).
      parameters:
        - name: pid
          in: path
          required: true
          description: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessEntityUpdateSchema'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BusinessEntityUpdateSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BusinessEntityUpdateSchema'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessEntitySchema'
          description: ''
      tags:
        - BaaS API Businesses
  /baas/v1.0/entity/business/{pid}/retrieve:
    get:
      operationId: Retrieve Business Resource
      description: ''
      parameters:
        - name: pid
          in: path
          required: true
          description: ''
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessEntitySchema'
          description: ''
      tags:
        - BaaS API Businesses
  /baas/v1.0/entity/business/list:
    get:
      operationId: List Business Resources
      description: ''
      parameters:
        - name: cursor
          required: false
          in: query
          description: The pagination cursor value.
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  next:
                    type: string
                    nullable: true
                  previous:
                    type: string
                    nullable: true
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/BusinessEntitySchema'
          description: ''
      tags:
        - BaaS API Businesses
  /baas/v1.0/entity/business/{pid}/admin/add:
    post:
      operationId: Add Business Admin
      description: ''
      parameters:
        - name: pid
          example: ZOSQ1ZE80VTBJ1TQ
          in: path
          required: true
          description: Business public id
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessAdminSchema'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BusinessAdminSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BusinessAdminSchema'
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessAdminSchema'
          description: ''
      tags:
        - BaaS API Businesses
  /baas/v1.0/entity/business/{pid}/admin/{admin_pid}/delete:
    delete:
      operationId: Remove Business Admin
      description: ''
      parameters:
        - name: pid
          example: ZOSQ1ZE80VTBJ1TQ
          in: path
          required: true
          description: Business public id
          schema:
            type: string
        - name: admin_pid
          in: path
          example: '54320209'
          required: true
          description: Admin public id
          schema:
            type: string
      responses:
        '204':
          description: ''
      tags:
        - BaaS API Businesses
  /baas/v1.0/entity/business/{pid}/admin/list:
    get:
      operationId: List Business Admins
      description: ''
      parameters:
        - name: pid
          example: ZOSQ1ZE80VTBJ1TQ
          in: path
          required: true
          description: Business public id
          schema:
            type: string
        - name: cursor
          required: false
          in: query
          description: The pagination cursor value.
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  next:
                    type: string
                    nullable: true
                  previous:
                    type: string
                    nullable: true
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/BusinessAdminSchema'
          description: ''
      tags:
        - BaaS API Businesses
  /baas/v1.0/account/create:
    post:
      operationId: Issue Account
      description: ''
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BaasAccountSchema'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BaasAccountSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BaasAccountSchema'
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaasAccountSchema'
          description: ''
      tags:
        - Baas API Accounts
  /baas/v1.0/account/{pid}/update:
    put:
      operationId: Update Account
      description: ''
      parameters:
        - name: pid
          in: path
          example: 0G1D7MQTAIXFHGU0
          required: true
          description: Account public id
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BaasUpdateAccountSchema'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BaasUpdateAccountSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BaasUpdateAccountSchema'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaasUpdateAccountSchema'
          description: ''
      tags:
        - Baas API Accounts
  /baas/v1.0/account/{pid}/retrieve:
    get:
      operationId: Retrieve Account
      description: 0G1D7MQTAIXFHGU0
      parameters:
        - name: pid
          in: path
          example: null
          required: true
          description: Account public id
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaasAccountSchema'
          description: ''
      tags:
        - Baas API Accounts
  /baas/v1.0/account/list:
    get:
      operationId: List Accounts
      description: ''
      parameters:
        - name: cursor
          required: false
          in: query
          description: The pagination cursor value.
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  next:
                    type: string
                    nullable: true
                  previous:
                    type: string
                    nullable: true
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/BaasAccountSchema'
          description: ''
      tags:
        - Baas API Accounts
  /baas/v1.0/account/{pid}/balance/{date}:
    get:
      operationId: Account balance
      description: Retrieve the account balance as of the end of [date]
      parameters:
        - name: pid
          in: path
          example: ''
          required: true
          description: Account public id
          schema:
            type: string
        - name: date
          in: path
          example: '2025-01-20'
          required: true
          description: ''
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaasAccountBalanceSchema'
          description: ''
      tags:
        - Baas API Accounts
  /baas/v1.0/transaction/create:
    post:
      operationId: Create Transaction
      description: ''
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BaaSTransactionCreateSchema'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BaaSTransactionCreateSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BaaSTransactionCreateSchema'
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaaSTransactionCreatedSchema'
          description: ''
      tags:
        - Baas API Transactions
  /baas/v1.0/transaction/{pid}/retrieve:
    get:
      operationId: Retrieve Transaction
      description: ''
      parameters:
        - name: pid
          in: path
          example: 71VA9S9RB6ACIWJY
          required: true
          description: Transaction public id
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseTransactionSchema'
          description: ''
      tags:
        - Baas API Transactions
  /baas/v1.0/transaction/list:
    get:
      operationId: List Transactions
      description: ''
      parameters:
        - name: cursor
          required: false
          in: query
          description: The pagination cursor value.
          schema:
            type: string
        - name: account_pid
          required: true
          example: 3PZ1CL75SIYEGQ0W
          in: query
          description: Account public id.
          schema:
            type: string
        - name: kind
          required: false
          in: query
          schema:
            type: string
            enum:
              - CREDIT
              - DEBIT
              - FEE
          example: CREDIT
          description: Transaction kind
        - name: added__lte
          required: false
          in: query
          schema:
            type: string
          description: Transaction added timestamp filter (in milliseconds).
        - name: added__gte
          required: false
          in: query
          schema:
            type: string
          description: Transaction added timestamp filter (in milliseconds).
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  next:
                    type: string
                    nullable: true
                  previous:
                    type: string
                    nullable: true
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/BaseTransactionSchema'
          description: ''
      tags:
        - Baas API Transactions
webhooks:
  transaction.created:
    post:
      tags:
        - Account API Webhooks
        - BaaS API Webhooks
      requestBody:
        summary: transaction.created
        description: Occurs when transaction is created in the system.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BaseTransactionSchema'
      responses:
        '200':
          description: Return a 200 status to indicate that the data was received successfully
  transaction.updated:
    post:
      tags:
        - Account API Webhooks
        - BaaS API Webhooks
      requestBody:
        summary: transaction.updated
        description: Occurs when a transaction status updated.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BaseTransactionSchema'
      responses:
        '200':
          description: Return a 200 status to indicate that the data was received successfully
  entity.updated:
    post:
      tags:
        - Account API Webhooks
        - BaaS API Webhooks
      requestBody:
        summary: transaction.updated
        description: Occurs when a private or business entity updated.
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/PrivateEntitySchema'
                - $ref: '#/components/schemas/BusinessEntitySchema'
      responses:
        '200':
          description: Return a 200 status to indicate that the data was received successfully
  change_request.updated:
    post:
      tags:
        - Account API Webhooks
        - BaaS API Webhooks
      requestBody:
        summary: transaction.updated
        description: Occurs when a change request updated [e.g. status is changed to resubmission].
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/PrivateChangeRequestSchema'
                - $ref: '#/components/schemas/BusinessChangeRequestSchema'
      responses:
        '200':
          description: Return a 200 status to indicate that the data was received successfully
components:
  schemas:
    BaseTransactionSchema:
      type: object
      properties:
        pid:
          type: string
          example: UXNZ6IWJ2JESLXP3
          readOnly: true
        account_pid:
          type: string
          example: KFGKJ5L27ASGTZAO
          description: Account public id.
        amount:
          type: integer
          example: 1485
          description: Transaction amount in cents.
          minimum: 0
        fee:
          type: integer
          example: 15
          readOnly: true
        currency:
          enum:
            - EUR
          example: EUR
          type: string
        added:
          type: string
          format: date-time
          example: '1698062541.845098'
          description: null
          readOnly: true
        sender:
          type: object
          nullable: true
          description: May be null for returned or fee transactions.
          properties:
            number:
              type: string
              example: PL69291000060000000000039586
              description: Account number.
              maxLength: 32
            name:
              type: string
              example: John Doe
              description: Counterparty name.
              maxLength: 120
            address:
              type: string
              example: Przylaszczkowa 148
              description: Counterparty address.
              maxLength: 120
            city:
              type: string
              example: Warsaw
              description: Counterparty city.
              maxLength: 320
            zip_code:
              type: string
              exmaple: 02-403
              description: Counterparty zip code.
              maxLength: 12
            country:
              allOf:
                - $ref: '#/components/schemas/CountrySchema'
                - example: PL
                - description: Counterparty country code.
          required:
            - number
            - name
        recipient:
          type: object
          nullable: true
          description: May be null for fee transactions.
          properties:
            number:
              type: string
              example: FI2279600000000000
              description: Account number.
              maxLength: 32
            name:
              type: string
              example: Sara Conor
              description: Counterparty name.
              maxLength: 120
            address:
              type: string
              example: ''
              description: Counterparty address.
              maxLength: 120
            city:
              type: string
              example: ''
              description: Counterparty city.
              maxLength: 320
            zip_code:
              type: string
              example: ''
              description: Counterparty zip code.
              maxLength: 12
            country:
              allOf:
                - $ref: '#/components/schemas/CountrySchema'
                - example: FI
                - description: Counterparty country code.
          required:
            - number
            - name
        remittance_information:
          type: object
          properties:
            ustrd:
              type: string
              example: INV202350
              description: Transaction title.
              maxLength: 256
          required:
            - ustrd
          description: Remittance information object.
        source:
          enum:
            - WEB
            - APP
            - ACCOUNT_API
            - BAAS_API
            - CARD
          example: WEB
          type: string
          readOnly: true
        kind:
          enum:
            - CREDIT
            - DEBIT
            - FEE
          example: CREDIT
          type: string
          readOnly: true
        status:
          enum:
            - PENDING
            - DONE
            - REJECTED
            - CANCELLED
          type: string
          example: DONE
          readOnly: true
        vop:
          type: object
          nullable: true
          description: Verification of Payee (VOP) check result. Null if VOP is not applicable.
          properties:
            match_type:
              type: string
              enum:
                - MTCH
                - NMTC
                - CMTC
                - NOAP
              description: 'VOP match status: MTCH (Match), NMTC (No Match), CMTC (Close Match), NOAP (Not Applicable).'
            recipient_matching_name:
              type: string
              description: Suggested recipient name in case of a close match (CMTC).
          required:
            - match_type
        orgnl_tx:
          type: object
          nullable: true
          description: Information about original transaction in case this is a returned/rejected transaction. Null if not applicable.
          properties:
            rjct_reason_cd:
              allOf:
                - $ref: '#/components/schemas/RejectReasonCodeSchema'
                - description: SEPA return reason code indicating why the original transaction was rejected.
              example: AC04
            rjct_reason:
              type: string
              description: Human-readable description of the rejection reason.
              example: Account number specified has been closed
            pid:
              type: string
              description: Public ID of the original transaction that was returned.
              example: UXNZ6IWJ2JESLXP3
          required:
            - rjct_reason_cd
            - rjct_reason
            - pid
      required:
        - pid
        - account_pid
        - amount
        - fee
        - currency
        - added
        - remittance_information
        - source
        - kind
        - status
    FileSchema:
      type: object
      properties:
        file:
          type: string
          format: binary
          description: File object
          writeOnly: true
        pid:
          type: string
          example: 4NRCPH7YMU0MJ5B6
          description: File public id
          readOnly: true
        name:
          type: string
          example: id-front.png
          readOnly: true
          description: Uploaded file name
        size:
          type: string
          example: 3939421
          description: File size in bytes
          readOnly: true
        mimetype:
          type: string
          example: image/png
          description: File MIME type
          readOnly: true
      required:
        - file
        - pid
        - name
        - size
        - mimetype
    PrivateEntityBaseSchema:
      type: object
      properties:
        pid:
          type: string
          example: '79003101'
          readOnly: true
          description: Person public id
        phone:
          type: string
          example: +3584573962XXX
          readOnly: true
          nullable: true
          description: Person phone number
        email:
          type: string
          example: e***@example.com
          format: email
          readOnly: true
          nullable: true
          description: Person email address
        first_name:
          type: string
          example: John
          readOnly: true
          description: Person first name
        last_name:
          type: string
          example: Doe
          readOnly: true
          description: Person last name
        birthdate:
          type: string
          example: '1980-02-19'
          format: date
          readOnly: true
          description: Person birthdate
        kind:
          enum:
            - PRIVATE
          example: PRIVATE
          type: string
          readOnly: true
        added:
          type: string
          format: date-time
          example: '1698062541.845098'
          description: null
          readOnly: true
        updated:
          type: string
          format: date-time
          example: '1698062541.845098'
          description: null
          readOnly: true
      required:
        - pid
        - phone
        - email
        - first_name
        - last_name
        - birthdate
        - kind
        - added
        - updated
    PrivateEntitySchema:
      allOf:
        - $ref: '#/components/schemas/PrivateEntityBaseSchema'
        - type: object
          properties:
            change_requests:
              type: array
              items:
                $ref: '#/components/schemas/PrivateChangeRequestSchema'
          required:
            - change_requests
    PrivateEntityUpdateSchema:
      allOf:
        - $ref: '#/components/schemas/PrivateEntityBaseSchema'
        - type: object
          properties:
            change_request:
              $ref: '#/components/schemas/PrivateChangeRequestSchema'
          required:
            - change_request
    PrivateChangeRequestSchema:
      type: object
      description: Person change request data
      properties:
        pid:
          type: string
          example: 0D2ZOJDVYT07TQKS
          readOnly: true
          description: Person change request public id
        status:
          enum:
            - INIT
            - RETRY
            - SUBMITTED
            - REJECTED
            - ACCEPTED
          type: string
          example: SUBMITTED
          readOnly: true
          description: Person change request status
        data:
          type: object
          description: Person change request data
          properties:
            sumsub_share_token:
              type: string
              description: |
                Token from SumSub (KYC provider) – required for create (POST /entity/private/create).
                Obtain via SumSub API: POST `https://api.sumsub.com/resources/accessTokens/shareToken`
                Use SumSub Sandbox for devapi.narvi.com, Production for api.narvi.com.
                Token is single-use and expires after ttlInSecs. forClientId – Narvi identifier in SumSub (obtain from Narvi).
              example: <TOKEN_FROM_SUMSUB>
            first_name:
              type: string
              example: John
              description: Person fist name
            last_name:
              type: string
              example: Doe
              description: Person last name
            birthdate:
              type: string
              example: '1980-02-19'
              format: date
              description: Person birthdate
            address:
              type: string
              example: Kangasmoisionkatu 97
              maxLength: 128
              description: Person residential street number, street number, home number
            zip_code:
              type: string
              example: '40400'
              maxLength: 12
              description: Person residential zip code
            city:
              type: string
              example: Raahe
              maxLength: 64
              description: Person residential city
            country:
              allOf:
                - $ref: '#/components/schemas/CountrySchema'
                - example: FI
                - description: Person residential country
            citizenship_countries:
              type: array
              items:
                $ref: '#/components/schemas/CountrySchema'
              example:
                - FI
                - DE
              description: Citizenship country
            birth_country:
              allOf:
                - $ref: '#/components/schemas/CountrySchema'
                - example: FI
                - description: Birth country
            tax_info:
              $ref: '#/components/schemas/PrivateTaxInfoSchema'
            identification_number:
              type: string
              example: '75121968629'
              description: National Identification Number
            wealth_source:
              type: array
              items:
                type: string
                enum:
                  - EMPLOYMENT
                  - SAVINGS
                  - INVESTMENTS
                  - LOAN
                  - OTHER
            wealth_source_others:
              type: string
              description: |
                <span style="color: #EB1478">Required if `wealth_source` is "OTHER"</span>
              nullable: true
            is_politically_exposed:
              type: boolean
              example: false
              description: Indicates whether the person has self-declared their status as a politically exposed person (PEP).
            opening_account_reason:
              type: array
              items:
                type: string
                enum:
                  - DAY_TO_DAY_EXPENSES
                  - INTERNATIONAL_TRANSFER
                  - RECEIVING_SALARY
                  - CURRENCY_EXCHANGE
                  - OTHER
            opening_account_reason_others:
              type: string
              description: |
                <span style="color: #EB1478">Required if `opening_account_reason` is "OTHER"</span>
              nullable: true
          required:
            - sumsub_share_token
            - first_name
            - last_name
            - birthdate
            - address
            - zip_code
            - city
            - country
            - citizenship_countries
            - birth_country
            - tax_info
            - identification_number
            - is_politically_exposed
            - opening_account_reason
            - wealth_source
        retry_reason:
          type: string
          example: Thank you for providing us with the requested documents. 1) Your AML policy mentions separate Customer On-boarding and Monitoring procedures. Could you kindly share these procedures with us as well? 2) Is there ETA at place regarding separation of MLRO?
          nullable: true
          readOnly: true
          description: Change request retry reason.
      required:
        - pid
        - status
        - retry_reason
        - data
    UserSettingsUpdateInitSchema:
      type: object
      properties:
        pid:
          type: string
          example: '68156984'
          description: Person public id
        challenge_session:
          type: object
          properties:
            pid:
              type: string
              example: T8GOKT054SCLYBZN
              readOnly: true
              description: Challenge session public id
            kind:
              enum:
                - CHANGE_EMAIL
                - CHANGE_PHONE
              example: CHANGE_PHONE
              type: string
              description: Challenge session purpose
            challenge:
              allOf:
                - $ref: '#/components/schemas/ChallengeSchema'
                - readOnly: true
          required:
            - pid
            - kind
            - challenge
      required:
        - pid
        - challenge_session
    UserSettingsUpdateCompleteSchema:
      type: object
      properties:
        pid:
          type: string
          example: '68156984'
          description: Person public id
        challenge_session:
          type: object
          properties:
            pid:
              type: string
              example: T8GOKT054SCLYBZN
              writeOnly: true
              description: Challenge session public id
            kind:
              enum:
                - CHANGE_EMAIL
                - CHANGE_PHONE
              example: CHANGE_PHONE
              type: string
              readOnly: true
              description: Challenge session purpose
            challenge:
              allOf:
                - $ref: '#/components/schemas/ChallengeSchema'
                - readOnly: true
          required:
            - pid
            - kind
            - challenge
      required:
        - pid
        - challenge_session
    UserSettingsUpdateFinishBaseSchema:
      type: object
      properties:
        pid:
          type: string
          example: '68156984'
          description: Person public id
        challenge:
          allOf:
            - $ref: '#/components/schemas/ChallengeSchema'
            - readOnly: true
        challenge_session:
          type: object
          description: Challenge session. Not required when 2fa factors was never set before
          properties:
            pid:
              type: string
              example: T8GOKT054SCLYBZN
              writeOnly: true
              description: Challenge session public id
            kind:
              enum:
                - CHANGE_EMAIL
                - CHANGE_PHONE
              type: string
              example: CHANGE_PHONE
              readOnly: true
              description: Challenge session purpose
          required:
            - kind
          writeOnly: true
      required:
        - pid
        - challenge
    UserSettingsUpdateEmailFinishSchema:
      allOf:
        - $ref: '#/components/schemas/UserSettingsUpdateFinishBaseSchema'
        - type: object
          properties:
            email:
              type: string
              format: email
              writeOnly: true
              description: New email address
          required:
            - pid
            - email
            - challenge
    UserSettingsUpdatePhoneFinishSchema:
      allOf:
        - $ref: '#/components/schemas/UserSettingsUpdateFinishBaseSchema'
        - type: object
          properties:
            phone:
              type: string
              writeOnly: true
              description: New phone number
          required:
            - pid
            - phone
            - challenge
    UserSettingsUpdateFinishSchema:
      oneOf:
        - $ref: '#/components/schemas/UserSettingsUpdateEmailFinishSchema'
        - $ref: '#/components/schemas/UserSettingsUpdatePhoneFinishSchema'
    BusinessEntityBaseSchema:
      type: object
      properties:
        pid:
          type: string
          example: 7EXD75VWXD7I3BO3
          readOnly: true
          description: Business public id
        name:
          type: string
          example: Acme Corp
          readOnly: true
          description: Business name
        kind:
          enum:
            - PRIVATE
            - BUSINESS
          type: string
          readOnly: true
        status:
          enum:
            - INIT
            - RETRY
            - SUBMITTED
            - REJECTED
            - ACCEPTED
          type: string
          readOnly: true
        added:
          type: string
          format: date-time
          example: '1698062541.845098'
          description: null
          readOnly: true
        updated:
          type: string
          format: date-time
          example: '1698062541.845098'
          description: null
          readOnly: true
      required:
        - pid
        - name
        - kind
        - status
        - added
        - updated
    BusinessEntitySchema:
      allOf:
        - $ref: '#/components/schemas/BusinessEntityBaseSchema'
        - type: object
        - properties:
            change_request:
              description: |
                Business schema — for all entity_types except SELF_EMPLOYED <br/>
                Self-Employed schema — only when entity_type is SELF_EMPLOYED
              oneOf:
                - title: Business schema
                  $ref: '#/components/schemas/BusinessChangeRequestSchema'
                - title: Self-Employed schema
                  $ref: '#/components/schemas/BusinessSelfEmployedChangeRequestSchema'
        - required:
            - pid
            - name
            - kind
            - status
            - added
            - updated
            - change_requests
    BusinessEntityUpdateSchema:
      allOf:
        - $ref: '#/components/schemas/BusinessEntityBaseSchema'
        - type: object
        - properties:
            admins:
              type: array
              description: List of business entity administrator PIDs
              items:
                type: object
                properties:
                  pid:
                    type: string
                required:
                  - pid
            change_request:
              description: |
                Business schema — for all entity_types except SELF_EMPLOYED <br/>
                Self-Employed schema — only when entity_type is SELF_EMPLOYED
              oneOf:
                - title: Business schema
                  $ref: '#/components/schemas/BusinessChangeRequestSchema'
                - title: Self-Employed schema
                  $ref: '#/components/schemas/BusinessSelfEmployedChangeRequestSchema'
        - required:
            - pid
            - name
            - kind
            - status
            - added
            - updated
            - change_request
    BusinessChangeRequestSchema:
      type: object
      properties:
        pid:
          type: string
          example: S7TLFSEZ12ON6MVW
          readOnly: true
          description: Business change request public id
        status:
          enum:
            - INIT
            - RETRY
            - SUBMITTED
            - REJECTED
            - ACCEPTED
          example: SUBMITTED
          readOnly: true
          type: string
          description: Business change request status
        data:
          type: object
          properties:
            details:
              type: object
              properties:
                legal_name:
                  type: string
                  example: Acme Corp
                  maxLength: 128
                  description: Legal name of the company
                trading_name:
                  type: string
                  example: Acme Corp
                  maxLength: 128
                  description: Trading name of the company
                incorporation_country:
                  allOf:
                    - $ref: '#/components/schemas/CountrySchema'
                    - example: FI
                    - description: Country of incorporation
                  type: string
                registration_number:
                  type: string
                  example: 3190214-6
                  maxLength: 32
                  description: Commercial registration number
                tax_info:
                  $ref: '#/components/schemas/TaxInfoSchema'
                entity_type:
                  type: string
                  enum:
                    - LIMITED
                    - LIMITED_LIABILITY_COMPANY
                    - LIMITED_LIABILITY_PARTNERSHIP
                    - JOINT_VENTURE
                    - GENERAL_PARTNERSHIP
                    - OTHER
                  example: LIMITED
                incorporation_date:
                  type: string
                  format: date
                  example: '2024-01-02'
                  description: Incorporation date
                registered_address:
                  type: string
                  example: Grzybowska 7/2
                  maxLength: 128
                  description: Business registered address
                registered_zip_code:
                  type: string
                  example: 02-409
                  maxLength: 12
                  description: Business registered address zip code
                registered_city:
                  type: string
                  example: Poznan
                  maxLength: 64
                  description: Business registered address zip city
                registered_country:
                  allOf:
                    - $ref: '#/components/schemas/CountrySchema'
                    - example: PL
                    - description: Business registered address country
                  type: string
                headquarter_address:
                  type: string
                  nullable: true
                  maxLength: 128
                headquarter_zip_code:
                  type: string
                  nullable: true
                  maxLength: 12
                headquarters_city:
                  type: string
                  nullable: true
                  maxLength: 64
                headquarters_country:
                  $ref: '#/components/schemas/CountrySchema'
                  nullable: true
                website_url:
                  type: string
                  nullable: true
                industries:
                  type: array
                  description: |
                    <br/>
                    Additional required fields depending on the selected industry:

                    For `FINANCE_AND_INSURANCE_SERVICES`: <br/>
                      - `industry_high_risk_customer_details`

                    For `VIRTUAL_CURRENCIES_AND_CRYPTO`: <br/>
                      - `industry_high_risk_customer_details`
                      - `industry_authorized_countries`
                      - `industry_offered_cryptocurrencies`
                  items:
                    type: string
                    enum:
                      - ACCOUNTANTS_AND_LEGAL_SERVICES
                      - ADMINISTRATION_AND_SUPPORT_SERVICES
                      - ADULT_ENTERTAINMENT
                      - AGRICULTURE_AND_FORESTRY_AND_FISHING
                      - AIRCRAFT_AND_DEFENSE_SECTOR
                      - ALCOHOL_AND_TOBACCO
                      - ATTENDANT_AND_MODELING_SERVICES
                      - AUTOMOTIVE_RELATED_SERVICES
                      - ARTS_AND_ENTERTAINMENT_AND_RECREATION
                      - BETTING
                      - CALL_CENTER_SERVICES
                      - COMPANY_ESTABLISHMENT_OR_FORMATION_SERVICES
                      - COMMUNICATION_AND_MARKETING
                      - CFD_AND_FUTURES_TRADING_AND_FOREX
                      - CBD_AND_MEDICAL_MARIHUANA
                      - CONSULTING_AND_BUSINESS_SERVICES
                      - CRYPTO_MINING
                      - DATING_SERVICES
                      - EDUCATIONAL_OR_LEARNING_SERVICES
                      - ELECTRICITY_AND_WATER_RELATED_SERVICES
                      - EMPLOYMENT_AGENCIES
                      - E_SPORT
                      - FASHION
                      - FINANCE_AND_INSURANCE_SERVICES
                      - FOOD_AND_BEVERAGES_SERVICES
                      - GAMBLING_OR_GAMING_ACTIVITIES
                      - HOLDING_COMPANIES
                      - INDUSTRIAL_CHEMICALS
                      - IT_AND_SOFTWARE_SERVICES
                      - INVESTMENT_SERVICES
                      - MANUFACTURING_AND_MACHINERY
                      - MINING_AND_QUARRYING
                      - NON_PROFIT_AND_CHARITY_OR_POLITICAL_ORGANIZATIONS
                      - OIL_AND_GAS_AND_MINERALS
                      - PHARMACEUTICALS_AND_HEALTHCARE
                      - PRIVATE_INVESTIGATORS_AND_MERCENARY_SERVICES
                      - PRECIOUS_METALS_AND_JEWELRY
                      - PSYCHIC_AND_SERVICES
                      - PAWNBROKERS_AND_PAWN_SHOPS
                      - PROCUREMENT_SERVICES
                      - REAL_ESTATE_AND_CONSTRUCTION
                      - SPORT_INDUSTRY
                      - LOAN_OR_LENDING_SERVICES
                      - TRANSPORTATION_AND_WAREHOUSING
                      - TRAVEL_AND_ACCOMMODATION_SERVICES
                      - VIRTUAL_CURRENCIES_AND_CRYPTO
                      - WEB_HOSTING_AND_WEB_DESIGN_SERVICES
                      - WHOLESALE_AND_RETAIL_TRADE
                      - OTHER_SERVICES
                industry_high_risk_customer_details:
                  type: string
                  example: '10.00'
                  description: Percentage of high-risk customers
                industry_authorized_countries:
                  type: array
                  items:
                    $ref: '#/components/schemas/CountrySchema'
                  nullable: true
                industry_offered_cryptocurrencies:
                  type: string
                  nullable: true
                  maxLength: 2048
                business_activities:
                  type: string
                  maxLength: 2048
                opening_account_reason:
                  type: string
                  enum:
                    - FUNDS_FROM_CORPORATE_CLIENTS
                    - FUNDS_FROM_INDIVIDUAL_CLIENTS
                    - PAYMENTS_TO_PROVIDERS
                    - INTRAGROUP_TRANSACTIONS
                    - MERCHANT_PROCESSING_SETTLEMENTS
                    - PAYROLL_PROCESSING
                    - OTHER
                opening_account_reason_others:
                  type: string
                  description: |
                    <span style="color: #EB1478">Required if `opening_account_reason` is "OTHER"</span>
                  nullable: true
                group_structure_documents:
                  type: array
                  items:
                    type: object
                    properties:
                      pid:
                        type: string
                      size:
                        type: integer
                        readOnly: true
                      mimetype:
                        type: string
                        readOnly: true
                      absolute_url:
                        type: string
                        format: uri
                        readOnly: true
                        pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                      name:
                        type: string
                        readOnly: true
                      added:
                        type: string
                        format: date-time
                        example: '1698062541.845098'
                        description: null
                        readOnly: true
                  nullable: true
                company_ownership_details:
                  type: string
                  nullable: true
                  maxLength: 2048
                stock_exchange_code:
                  type: string
                  nullable: true
                  maxLength: 16
              required:
                - legal_name
                - trading_name
                - incorporation_country
                - registration_number
                - tax_info
                - entity_type
                - incorporation_date
                - registered_address
                - registered_zip_code
                - registered_city
                - registered_country
                - headquarter_address
                - headquarter_zip_code
                - headquarters_city
                - headquarters_country
                - business_activities
                - opening_account_reason
                - industries
            activities:
              type: object
              properties:
                additional_products:
                  type: array
                  items:
                    enum:
                      - OTHER
                      - SAFEGUARDING_ACCOUNTS
                      - POOLED_ACCOUNTS
                    type: string
                additional_products_details:
                  type: string
                  description: |
                    <span style="color: #EB1478">Required if `additional_products` includes `OTHER`. Specifies the additional products.</span>
                monthly_incoming_payments_volume:
                  type: string
                  enum:
                    - VOLUME_0_50
                    - VOLUME_50_100
                    - VOLUME_100_200
                    - VOLUME_200_1000
                    - VOLUME_1000PLUS
                  description: |
                    VOLUME_0_50 - 0 - 50,000 EUR <br/>
                    VOLUME_50_100 - 51,000 - 100,000 EUR <br/>
                    VOLUME_100_200 - 101,000 - 200,000 EUR <br/>
                    VOLUME_200_1000 - 201,000 - 1,000,000 EUR <br/>
                    VOLUME_1000PLUS - Above 1,000,000 EUR <br/>
                monthly_incoming_payments_number:
                  type: string
                monthly_incoming_payments_volume_others:
                  type: string
                  description: |
                    <span style="color: #EB1478">Required if `monthly_incoming_payments_volume` is
                    "VOLUME_1000PLUS" (Above 1,000,000 EUR). Specifies the estimated amount.</span>
                  nullable: true
                monthly_outgoing_payments_volume:
                  type: string
                  enum:
                    - VOLUME_0_50
                    - VOLUME_50_100
                    - VOLUME_100_200
                    - VOLUME_200_1000
                    - VOLUME_1000PLUS
                  description: |
                    VOLUME_0_50 - 0 - 50,000 EUR <br/>
                    VOLUME_50_100 - 51,000 - 100,000 EUR <br/>
                    VOLUME_100_200 - 101,000 - 200,000 EUR <br/>
                    VOLUME_200_1000 - 201,000 - 1,000,000 EUR <br/>
                    VOLUME_1000PLUS - Above 1,000,000 EUR <br/>
                monthly_outgoing_payments_number:
                  type: string
                monthly_outgoing_payments_volume_others:
                  type: string
                  description: |
                    <span style="color: #EB1478">Required if `monthly_outgoing_payments_volume` is
                    "VOLUME_1000PLUS" (Above 1,000,000 EUR). Specifies the estimated amount.</span>
                  nullable: true
                last_year_turnover_eur:
                  type: string
                currencies_wishlist:
                  type: array
                  items:
                    type: string
                    enum:
                      - EUR
                      - USD
                      - GBP
                      - BGN
                      - CZK
                      - DKK
                      - HUF
                      - PLN
                      - RON
                      - SEK
                      - ISK
                      - CHF
                      - NOK
                  nullable: true
                cashflow_sources:
                  type: array
                  items:
                    type: string
                    description: |
                      <span style="color: #EB1478">Required for all entity_type except SELF_EMPLOYED</span>
                    enum:
                      - SISTER_OR_PARENT_COMPANY
                      - COMPANY_CLIENTS
                      - TRUST
                      - COMPANY_INVESTMENTS
                      - OTHER
                    nullable: true
                cashflow_sources_others:
                  type: string
                  description: |
                    <span style="color: #EB1478">Required if `cashflow_sources` is "OTHER"</span>
                  nullable: true
                beneficiaries_wealth_source:
                  type: array
                  items:
                    type: string
                    enum:
                      - EMPLOYMENT
                      - SAVINGS
                      - INVESTMENTS
                      - LOAN
                      - OTHER
                beneficiaries_wealth_source_others:
                  type: string
                  description: |
                    <span style="color: #EB1478">Required if `beneficiaries_wealth_source` is "OTHER"</span>
                  nullable: true
              required:
                - monthly_incoming_payments_volume
                - monthly_incoming_payments_number
                - monthly_outgoing_payments_volume
                - monthly_outgoing_payments_number
                - last_year_turnover_eur
                - currencies_wishlist
                - cashflow_sources
                - beneficiaries_wealth_source
            beneficiaries:
              type: array
              items:
                type: object
                properties:
                  first_name:
                    type: string
                  last_name:
                    type: string
                  birthdate:
                    type: string
                    format: date
                    example: '1698062541.845098'
                    description: null
                  ownership_percentage:
                    type: number
                  address:
                    type: string
                    maxLength: 128
                  zip_code:
                    type: string
                    maxLength: 12
                  city:
                    type: string
                    maxLength: 64
                  country:
                    allOf:
                      - $ref: '#/components/schemas/CountrySchema'
                  tax_info:
                    $ref: '#/components/schemas/PrivateTaxInfoSchema'
                  verification_source:
                    type: string
                    nullable: true
                  is_politically_exposed:
                    type: boolean
                  family_politically_exposed_persons:
                    type: array
                    items:
                      type: object
                      properties:
                        first_name:
                          type: string
                        last_name:
                          type: string
                      required:
                        - first_name
                        - last_name
                    nullable: true
                  other_politically_exposed_persons:
                    type: array
                    items:
                      type: object
                      properties:
                        first_name:
                          type: string
                        last_name:
                          type: string
                      required:
                        - first_name
                        - last_name
                    nullable: true
                  citizenship_countries:
                    type: array
                    items:
                      $ref: '#/components/schemas/CountrySchema'
                    description: Citizenship country
                  identity_files:
                    type: array
                    items:
                      type: object
                      properties:
                        pid:
                          type: string
                        size:
                          type: integer
                          readOnly: true
                        mimetype:
                          type: string
                          readOnly: true
                        absolute_url:
                          type: string
                          format: uri
                          readOnly: true
                          pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                        name:
                          type: string
                          readOnly: true
                        added:
                          type: string
                          format: date-time
                          example: '1698062541.845098'
                          description: null
                          readOnly: true
                required:
                  - first_name
                  - last_name
                  - birthdate
                  - ownership_percentage
                  - address
                  - zip_code
                  - city
                  - country
                  - citizenship_countries
                  - tax_info
                  - is_politically_exposed
                  - family_politically_exposed_persons
                  - other_politically_exposed_persons
                  - identity_files
            directors:
              type: array
              items:
                type: object
                properties:
                  first_name:
                    type: string
                  last_name:
                    type: string
                  birthdate:
                    type: string
                    format: date
                    example: '1698062541.845098'
                    description: null
                  address:
                    type: string
                    maxLength: 128
                  zip_code:
                    type: string
                    maxLength: 12
                  city:
                    type: string
                    maxLength: 64
                  country:
                    allOf:
                      - $ref: '#/components/schemas/CountrySchema'
                      - description: Country of residence
                  citizenship_countries:
                    type: array
                    items:
                      $ref: '#/components/schemas/CountrySchema'
                    example:
                      - FI
                      - DE
                    description: Citizenship country
                  identity_files:
                    type: array
                    items:
                      type: object
                      properties:
                        pid:
                          type: string
                        size:
                          type: integer
                          readOnly: true
                        mimetype:
                          type: string
                          readOnly: true
                        absolute_url:
                          type: string
                          format: uri
                          readOnly: true
                          pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                        name:
                          type: string
                          readOnly: true
                        added:
                          type: string
                          format: date-time
                          example: '1698062541.845098'
                          description: null
                          readOnly: true
                required:
                  - first_name
                  - last_name
                  - birthdate
                  - address
                  - zip_code
                  - city
                  - country
                  - citizenship_countries
                  - identity_files
            files:
              type: object
              properties:
                memorandum_files:
                  type: array
                  items:
                    type: object
                    properties:
                      pid:
                        type: string
                      size:
                        type: integer
                        readOnly: true
                      mimetype:
                        type: string
                        readOnly: true
                      absolute_url:
                        type: string
                        format: uri
                        readOnly: true
                        pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                      name:
                        type: string
                        readOnly: true
                      added:
                        type: string
                        format: date-time
                        example: '1698062541.845098'
                        description: null
                        readOnly: true
                incorporation_certificate_files:
                  type: array
                  items:
                    type: object
                    properties:
                      pid:
                        type: string
                      size:
                        type: integer
                        readOnly: true
                      mimetype:
                        type: string
                        readOnly: true
                      absolute_url:
                        type: string
                        format: uri
                        readOnly: true
                        pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                      name:
                        type: string
                        readOnly: true
                      added:
                        type: string
                        format: date-time
                        example: '1698062541.845098'
                        description: null
                        readOnly: true
                beneficiary_ownership_files:
                  type: array
                  items:
                    type: object
                    properties:
                      pid:
                        type: string
                      size:
                        type: integer
                        readOnly: true
                      mimetype:
                        type: string
                        readOnly: true
                      absolute_url:
                        type: string
                        format: uri
                        readOnly: true
                        pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                      name:
                        type: string
                        readOnly: true
                      added:
                        type: string
                        format: date-time
                        example: '1698062541.845098'
                        description: null
                        readOnly: true
                other_files:
                  type: array
                  items:
                    type: object
                    properties:
                      pid:
                        type: string
                      size:
                        type: integer
                        readOnly: true
                      mimetype:
                        type: string
                        readOnly: true
                      absolute_url:
                        type: string
                        format: uri
                        readOnly: true
                        pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                      name:
                        type: string
                        readOnly: true
                      added:
                        type: string
                        format: date-time
                        example: '1698062541.845098'
                        description: null
                        readOnly: true
                  nullable: true
                aml_policy_files:
                  type: array
                  description: |
                    Required depending on the selected industry:
                    - `FINANCE_AND_INSURANCE_SERVICES`
                    - `VIRTUAL_CURRENCIES_AND_CRYPTO`
                    - `GAMBLING_OR_GAMING_ACTIVITIES`
                    - `CFD_AND_FUTURES_TRADING_AND_FOREX`
                  items:
                    type: object
                    properties:
                      pid:
                        type: string
                      size:
                        type: integer
                        readOnly: true
                      mimetype:
                        type: string
                        readOnly: true
                      absolute_url:
                        type: string
                        format: uri
                        readOnly: true
                        pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                      name:
                        type: string
                        readOnly: true
                      added:
                        type: string
                        format: date-time
                        example: '1698062541.845098'
                        description: null
                        readOnly: true
                  nullable: true
                terms_and_conditions_files:
                  type: array
                  description: |
                    Required depending on the selected industry:
                    - `GAMBLING_OR_GAMING_ACTIVITIES`
                    - `CFD_AND_FUTURES_TRADING_AND_FOREX`
                  items:
                    type: object
                    properties:
                      pid:
                        type: string
                      size:
                        type: integer
                        readOnly: true
                      mimetype:
                        type: string
                        readOnly: true
                      absolute_url:
                        type: string
                        format: uri
                        readOnly: true
                        pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                      name:
                        type: string
                        readOnly: true
                      added:
                        type: string
                        format: date-time
                        example: '1698062541.845098'
                        description: null
                        readOnly: true
                  nullable: true
                risk_assessment_files:
                  type: array
                  description: |
                    Required depending on the selected industry:
                    - `FINANCE_AND_INSURANCE_SERVICES`
                    - `VIRTUAL_CURRENCIES_AND_CRYPTO`
                  items:
                    type: object
                    properties:
                      pid:
                        type: string
                      size:
                        type: integer
                        readOnly: true
                      mimetype:
                        type: string
                        readOnly: true
                      absolute_url:
                        type: string
                        format: uri
                        readOnly: true
                        pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                      name:
                        type: string
                        readOnly: true
                      added:
                        type: string
                        format: date-time
                        example: '1698062541.845098'
                        description: null
                        readOnly: true
                  nullable: true
                license_files:
                  type: array
                  items:
                    type: object
                    properties:
                      pid:
                        type: string
                      size:
                        type: integer
                        readOnly: true
                      mimetype:
                        type: string
                        readOnly: true
                      absolute_url:
                        type: string
                        format: uri
                        readOnly: true
                        pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                      name:
                        type: string
                        readOnly: true
                      added:
                        type: string
                        format: date-time
                        example: '1698062541.845098'
                        description: null
                        readOnly: true
                  nullable: true
                tax_beneficiaries_files:
                  type: array
                  items:
                    type: object
                    properties:
                      pid:
                        type: string
                      size:
                        type: integer
                        readOnly: true
                      mimetype:
                        type: string
                        readOnly: true
                      absolute_url:
                        type: string
                        format: uri
                        readOnly: true
                        pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                      name:
                        type: string
                        readOnly: true
                      added:
                        type: string
                        format: date-time
                        example: '1698062541.845098'
                        description: null
                        readOnly: true
                  nullable: true
                tax_company_files:
                  type: array
                  items:
                    type: object
                    properties:
                      pid:
                        type: string
                      size:
                        type: integer
                        readOnly: true
                      mimetype:
                        type: string
                        readOnly: true
                      absolute_url:
                        type: string
                        format: uri
                        readOnly: true
                        pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                      name:
                        type: string
                        readOnly: true
                      added:
                        type: string
                        format: date-time
                        example: '1698062541.845098'
                        description: null
                        readOnly: true
                  nullable: true
              required:
                - memorandum_files
                - incorporation_certificate_files
                - beneficiary_ownership_files
          required:
            - details
            - activities
            - beneficiaries
            - directors
            - files
        retry_reason:
          type: string
          readOnly: true
      required:
        - pid
        - status
        - data
    BusinessSelfEmployedChangeRequestSchema:
      type: object
      properties:
        pid:
          type: string
          example: S7TLFSEZ12ON6MVW
          readOnly: true
          description: Business change request public id
        status:
          enum:
            - INIT
            - RETRY
            - SUBMITTED
            - REJECTED
            - ACCEPTED
          example: SUBMITTED
          readOnly: true
          type: string
          description: Business change request status
        data:
          type: object
          properties:
            details:
              type: object
              properties:
                legal_name:
                  type: string
                  example: Acme Corp
                  maxLength: 128
                  description: Legal name of the company
                trading_name:
                  type: string
                  example: Acme Corp
                  maxLength: 128
                  description: Trading name of the company
                incorporation_country:
                  allOf:
                    - $ref: '#/components/schemas/CountrySchema'
                    - example: FI
                    - description: Country of incorporation
                  type: string
                registration_number:
                  type: string
                  example: 3190214-6
                  maxLength: 32
                  description: Commercial registration number
                tax_info:
                  $ref: '#/components/schemas/TaxInfoSchema'
                entity_type:
                  type: string
                  enum:
                    - SELF_EMPLOYED
                  example: SELF_EMPLOYED
                incorporation_date:
                  type: string
                  format: date
                  example: '2024-01-02'
                  description: Incorporation date
                registered_address:
                  type: string
                  example: Grzybowska 7/2
                  maxLength: 128
                  description: Business registered address
                registered_zip_code:
                  type: string
                  example: 02-409
                  maxLength: 12
                  description: Business registered address zip code
                registered_city:
                  type: string
                  example: Poznan
                  maxLength: 64
                  description: Business registered address zip city
                registered_country:
                  allOf:
                    - $ref: '#/components/schemas/CountrySchema'
                    - example: PL
                    - description: Business registered address country
                  type: string
                headquarter_address:
                  type: string
                  nullable: true
                  maxLength: 128
                headquarter_zip_code:
                  type: string
                  nullable: true
                  maxLength: 12
                headquarters_city:
                  type: string
                  nullable: true
                  maxLength: 64
                headquarters_country:
                  $ref: '#/components/schemas/CountrySchema'
                  nullable: true
                industries:
                  type: array
                  description: |
                    <br/>
                    Additional required fields depending on the selected industry:

                    For `FINANCE_AND_INSURANCE_SERVICES`: <br/>
                      - `industry_high_risk_customer_details`

                    For `VIRTUAL_CURRENCIES_AND_CRYPTO`: <br/>
                      - `industry_high_risk_customer_details`
                      - `industry_authorized_countries`
                      - `industry_offered_cryptocurrencies`
                  items:
                    type: string
                    enum:
                      - ACCOUNTANTS_AND_LEGAL_SERVICES
                      - ADMINISTRATION_AND_SUPPORT_SERVICES
                      - ADULT_ENTERTAINMENT
                      - AGRICULTURE_AND_FORESTRY_AND_FISHING
                      - AIRCRAFT_AND_DEFENSE_SECTOR
                      - ALCOHOL_AND_TOBACCO
                      - ATTENDANT_AND_MODELING_SERVICES
                      - AUTOMOTIVE_RELATED_SERVICES
                      - ARTS_AND_ENTERTAINMENT_AND_RECREATION
                      - BETTING
                      - CALL_CENTER_SERVICES
                      - COMPANY_ESTABLISHMENT_OR_FORMATION_SERVICES
                      - COMMUNICATION_AND_MARKETING
                      - CFD_AND_FUTURES_TRADING_AND_FOREX
                      - CBD_AND_MEDICAL_MARIHUANA
                      - CONSULTING_AND_BUSINESS_SERVICES
                      - CRYPTO_MINING
                      - DATING_SERVICES
                      - EDUCATIONAL_OR_LEARNING_SERVICES
                      - ELECTRICITY_AND_WATER_RELATED_SERVICES
                      - EMPLOYMENT_AGENCIES
                      - E_SPORT
                      - FASHION
                      - FINANCE_AND_INSURANCE_SERVICES
                      - FOOD_AND_BEVERAGES_SERVICES
                      - GAMBLING_OR_GAMING_ACTIVITIES
                      - HOLDING_COMPANIES
                      - INDUSTRIAL_CHEMICALS
                      - IT_AND_SOFTWARE_SERVICES
                      - INVESTMENT_SERVICES
                      - MANUFACTURING_AND_MACHINERY
                      - MINING_AND_QUARRYING
                      - NON_PROFIT_AND_CHARITY_OR_POLITICAL_ORGANIZATIONS
                      - OIL_AND_GAS_AND_MINERALS
                      - PHARMACEUTICALS_AND_HEALTHCARE
                      - PRIVATE_INVESTIGATORS_AND_MERCENARY_SERVICES
                      - PRECIOUS_METALS_AND_JEWELRY
                      - PSYCHIC_AND_SERVICES
                      - PAWNBROKERS_AND_PAWN_SHOPS
                      - PROCUREMENT_SERVICES
                      - REAL_ESTATE_AND_CONSTRUCTION
                      - SPORT_INDUSTRY
                      - LOAN_OR_LENDING_SERVICES
                      - TRANSPORTATION_AND_WAREHOUSING
                      - TRAVEL_AND_ACCOMMODATION_SERVICES
                      - VIRTUAL_CURRENCIES_AND_CRYPTO
                      - WEB_HOSTING_AND_WEB_DESIGN_SERVICES
                      - WHOLESALE_AND_RETAIL_TRADE
                      - OTHER_SERVICES
                industry_high_risk_customer_details:
                  type: string
                  example: '10.00'
                  description: Percentage of high-risk customers
                industry_authorized_countries:
                  type: array
                  items:
                    $ref: '#/components/schemas/CountrySchema'
                  nullable: true
                industry_offered_cryptocurrencies:
                  type: string
                  nullable: true
                  maxLength: 2048
                business_activities:
                  type: string
                  maxLength: 2048
                opening_account_reason:
                  type: string
                  enum:
                    - FUNDS_FROM_CORPORATE_CLIENTS
                    - FUNDS_FROM_INDIVIDUAL_CLIENTS
                    - PAYMENTS_TO_PROVIDERS
                    - INTRAGROUP_TRANSACTIONS
                    - MERCHANT_PROCESSING_SETTLEMENTS
                    - PAYROLL_PROCESSING
                    - OTHER
                opening_account_reason_others:
                  type: string
                  description: |
                    <span style="color: #EB1478">Required if `opening_account_reason` is "OTHER"</span>
                  nullable: true
              required:
                - legal_name
                - trading_name
                - incorporation_country
                - registration_number
                - tax_info
                - entity_type
                - incorporation_date
                - registered_address
                - registered_zip_code
                - registered_city
                - registered_country
                - headquarter_address
                - headquarter_zip_code
                - headquarters_city
                - headquarters_country
                - business_activities
                - opening_account_reason
                - industries
            activities:
              type: object
              properties:
                additional_products:
                  type: array
                  items:
                    enum:
                      - OTHER
                      - SAFEGUARDING_ACCOUNTS
                      - POOLED_ACCOUNTS
                    type: string
                additional_products_details:
                  type: string
                  description: |
                    <span style="color: #EB1478">Required if `additional_products` includes `OTHER`. Specifies the additional products.</span>
                monthly_incoming_payments_volume:
                  type: string
                  enum:
                    - VOLUME_0_50
                    - VOLUME_50_100
                    - VOLUME_100_200
                    - VOLUME_200_1000
                    - VOLUME_1000PLUS
                  description: |
                    VOLUME_0_50 - 0 - 50,000 EUR <br/>
                    VOLUME_50_100 - 51,000 - 100,000 EUR <br/>
                    VOLUME_100_200 - 101,000 - 200,000 EUR <br/>
                    VOLUME_200_1000 - 201,000 - 1,000,000 EUR <br/>
                    VOLUME_1000PLUS - Above 1,000,000 EUR <br/>
                monthly_incoming_payments_number:
                  type: string
                monthly_incoming_payments_volume_others:
                  type: string
                  description: |
                    <span style="color: #EB1478">Required if `monthly_incoming_payments_volume` is
                    "VOLUME_1000PLUS" (Above 1,000,000 EUR). Specifies the estimated amount.</span>
                  nullable: true
                monthly_outgoing_payments_volume:
                  type: string
                  enum:
                    - VOLUME_0_50
                    - VOLUME_50_100
                    - VOLUME_100_200
                    - VOLUME_200_1000
                    - VOLUME_1000PLUS
                  description: |
                    VOLUME_0_50 - 0 - 50,000 EUR <br/>
                    VOLUME_50_100 - 51,000 - 100,000 EUR <br/>
                    VOLUME_100_200 - 101,000 - 200,000 EUR <br/>
                    VOLUME_200_1000 - 201,000 - 1,000,000 EUR <br/>
                    VOLUME_1000PLUS - Above 1,000,000 EUR <br/>
                monthly_outgoing_payments_number:
                  type: string
                monthly_outgoing_payments_volume_others:
                  type: string
                  description: |
                    <span style="color: #EB1478">Required if `monthly_outgoing_payments_volume` is
                    "VOLUME_1000PLUS" (Above 1,000,000 EUR). Specifies the estimated amount.</span>
                  nullable: true
                last_year_turnover_eur:
                  type: string
                currencies_wishlist:
                  type: array
                  items:
                    type: string
                    enum:
                      - EUR
                      - USD
                      - GBP
                      - BGN
                      - CZK
                      - DKK
                      - HUF
                      - PLN
                      - RON
                      - SEK
                      - ISK
                      - CHF
                      - NOK
                    nullable: true
                beneficiaries_wealth_source:
                  type: array
                  items:
                    type: string
                    enum:
                      - EMPLOYMENT
                      - SAVINGS
                      - INVESTMENTS
                      - LOAN
                      - OTHER
                beneficiaries_wealth_source_others:
                  type: string
                  description: |
                    <span style="color: #EB1478">Required if `beneficiaries_wealth_source` is "OTHER"</span>
                  nullable: true
              required:
                - monthly_incoming_payments_volume
                - monthly_incoming_payments_number
                - monthly_outgoing_payments_volume
                - monthly_outgoing_payments_number
                - last_year_turnover_eur
                - currencies_wishlist
                - beneficiaries_wealth_source
            beneficiaries:
              type: array
              items:
                type: object
                properties:
                  first_name:
                    type: string
                  last_name:
                    type: string
                  birthdate:
                    type: string
                    format: date
                    example: '1698062541.845098'
                    description: null
                  ownership_percentage:
                    type: number
                    description: Expected values is 100% for self-employed
                  address:
                    type: string
                    maxLength: 128
                  zip_code:
                    type: string
                    maxLength: 12
                  city:
                    type: string
                    maxLength: 64
                  country:
                    allOf:
                      - $ref: '#/components/schemas/CountrySchema'
                  tax_info:
                    $ref: '#/components/schemas/PrivateTaxInfoSchema'
                  verification_source:
                    type: string
                    nullable: true
                  is_politically_exposed:
                    type: boolean
                  family_politically_exposed_persons:
                    type: array
                    items:
                      type: object
                      properties:
                        first_name:
                          type: string
                        last_name:
                          type: string
                      required:
                        - first_name
                        - last_name
                    nullable: true
                  other_politically_exposed_persons:
                    type: array
                    items:
                      type: object
                      properties:
                        first_name:
                          type: string
                        last_name:
                          type: string
                      required:
                        - first_name
                        - last_name
                    nullable: true
                  citizenship_countries:
                    type: array
                    items:
                      $ref: '#/components/schemas/CountrySchema'
                    description: Citizenship country
                  identity_files:
                    type: array
                    items:
                      type: object
                      properties:
                        pid:
                          type: string
                        size:
                          type: integer
                          readOnly: true
                        mimetype:
                          type: string
                          readOnly: true
                        absolute_url:
                          type: string
                          format: uri
                          readOnly: true
                          pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                        name:
                          type: string
                          readOnly: true
                        added:
                          type: string
                          format: date-time
                          example: '1698062541.845098'
                          description: null
                          readOnly: true
                required:
                  - first_name
                  - last_name
                  - birthdate
                  - ownership_percentage
                  - address
                  - zip_code
                  - city
                  - country
                  - citizenship_countries
                  - tax_info
                  - is_politically_exposed
                  - family_politically_exposed_persons
                  - other_politically_exposed_persons
                  - identity_files
            files:
              type: object
              properties:
                incorporation_certificate_files:
                  type: array
                  items:
                    type: object
                    properties:
                      pid:
                        type: string
                      size:
                        type: integer
                        readOnly: true
                      mimetype:
                        type: string
                        readOnly: true
                      absolute_url:
                        type: string
                        format: uri
                        readOnly: true
                        pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                      name:
                        type: string
                        readOnly: true
                      added:
                        type: string
                        format: date-time
                        example: '1698062541.845098'
                        description: null
                        readOnly: true
                other_files:
                  type: array
                  items:
                    type: object
                    properties:
                      pid:
                        type: string
                      size:
                        type: integer
                        readOnly: true
                      mimetype:
                        type: string
                        readOnly: true
                      absolute_url:
                        type: string
                        format: uri
                        readOnly: true
                        pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                      name:
                        type: string
                        readOnly: true
                      added:
                        type: string
                        format: date-time
                        example: '1698062541.845098'
                        description: null
                        readOnly: true
                  nullable: true
                tax_beneficiaries_files:
                  type: array
                  items:
                    type: object
                    properties:
                      pid:
                        type: string
                      size:
                        type: integer
                        readOnly: true
                      mimetype:
                        type: string
                        readOnly: true
                      absolute_url:
                        type: string
                        format: uri
                        readOnly: true
                        pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                      name:
                        type: string
                        readOnly: true
                      added:
                        type: string
                        format: date-time
                        example: '1698062541.845098'
                        description: null
                        readOnly: true
                  nullable: true
                tax_company_files:
                  type: array
                  items:
                    type: object
                    properties:
                      pid:
                        type: string
                      size:
                        type: integer
                        readOnly: true
                      mimetype:
                        type: string
                        readOnly: true
                      absolute_url:
                        type: string
                        format: uri
                        readOnly: true
                        pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                      name:
                        type: string
                        readOnly: true
                      added:
                        type: string
                        format: date-time
                        example: '1698062541.845098'
                        description: null
                        readOnly: true
                  nullable: true
              required:
                - incorporation_certificate_files
          required:
            - details
            - activities
            - beneficiaries
            - files
        retry_reason:
          type: string
          readOnly: true
      required:
        - pid
        - status
        - data
    BusinessAdminSchema:
      type: object
      properties:
        phone:
          type: string
          example: '+481291288777'
          readOnly: true
          nullable: true
          description: Admin phone number
        email:
          type: string
          example: t****@example.com
          format: email
          readOnly: true
          nullable: true
          description: Admin email address
        first_name:
          type: string
          example: John
          readOnly: true
          description: Admin first name
        last_name:
          type: string
          example: Doe
          readOnly: true
          description: Admin last name
        birthdate:
          type: string
          format: date
          example: '1923-02-19'
          readOnly: true
          nullable: true
          description: Admin birthdate
        kind:
          enum:
            - PRIVATE
          example: PRIVATE
          type: string
          readOnly: true
        added:
          type: string
          format: date-time
          example: '1698062541.845098'
          description: null
          readOnly: true
        updated:
          type: string
          format: date-time
          example: '1698062541.845098'
          description: null
          readOnly: true
        pid:
          type: string
          example: '54320209'
          description: Admin pid
      required:
        - pid
        - phone
        - email
        - first_name
        - last_name
        - birthdate
        - kind
        - added
        - updated
        - pid
    BaasAccountBalanceSchema:
      type: object
      properties:
        pid:
          type: string
          example: 0G1D7MQTAIXFHGU0
          readOnly: true
          description: Account public id
        balance:
          type: integer
          example: 0
          readOnly: true
          description: Account balance in cents
        currency:
          enum:
            - EUR
          example: EUR
          type: string
          default: EUR
          description: Account currency
      required:
        - pid
        - balance
        - currency
    BaasAccountBaseSchema:
      type: object
      properties:
        pid:
          type: string
          example: 0G1D7MQTAIXFHGU0
          readOnly: true
          description: Account public id
        currency:
          enum:
            - EUR
          example: EUR
          type: string
          default: EUR
          description: Account currency
        balance:
          type: integer
          example: 0
          readOnly: true
          description: Account balance in cents
        number:
          type: string
          example: FI1879600189480939
          readOnly: true
          description: Account IBAN
        bic:
          type: string
          example: NARYFIH2
          readOnly: true
          description: Account BIC
        closed:
          type: string
          format: date-time
          example: '1698062541.845098'
          description: null
          readOnly: true
        added:
          type: string
          format: date-time
          example: '1698062541.845098'
          description: null
          readOnly: true
        updated:
          type: string
          format: date-time
          example: '1698062541.845098'
          description: null
          readOnly: true
      required:
        - pid
        - currency
        - balance
        - number
        - bic
        - closed
        - added
        - updated
    BaasAccountSchema:
      allOf:
        - $ref: '#/components/schemas/BaasAccountBaseSchema'
        - type: object
          properties:
            owner_kind:
              enum:
                - PRIVATE
                - BUSINESS
              type: string
              example: PRIVATE
              description: Owner kind
            owner_pid:
              type: string
              example: '54320209'
              description: Owner public id
            status:
              enum:
                - ACTIVE
                - BLOCKED
                - CLOSED
                - SUSPENDED
              example: ACTIVE
              type: string
              readOnly: true
              description: Account status
          required:
            - status
            - owner_kind
            - owner_pid
    BaasUpdateAccountSchema:
      allOf:
        - $ref: '#/components/schemas/BaasAccountBaseSchema'
        - type: object
          properties:
            owner_kind:
              enum:
                - PRIVATE
                - BUSINESS
              type: string
              example: PRIVATE
              readOnly: true
              description: Owner kind
            owner_pid:
              type: string
              example: '54320209'
              readOnly: true
              description: Owner public id
            status:
              enum:
                - ACTIVE
                - BLOCKED
                - CLOSED
              example: ACTIVE
              type: string
              description: Account status
          required:
            - status
            - owner_kind
            - owner_pid
    BaaSTransactionCreateBaseSchema:
      type: object
      properties:
        account_pid:
          type: string
          example: 3PZ1CL75SIYEGQ0W
          description: Account public id.
        currency:
          enum:
            - EUR
          type: string
          example: EUR
          description: Transaction currency
        remittance_information:
          type: object
          properties:
            ustrd:
              type: string
              example: Invoice no 1212/24
              description: Transaction title.
              maxLength: 256
          required:
            - ustrd
          description: Remittance information object.
      required:
        - account_pid
        - currency
        - remittance_information
    BaaSTransactionCreateDebitSchema:
      allOf:
        - $ref: '#/components/schemas/BaaSTransactionCreateBaseSchema'
        - type: object
          properties:
            amount:
              type: integer
              example: 99928
              description: Transaction amount in cents.
              minimum: 0
            kind:
              enum:
                - DEBIT
              example: DEBIT
              type: string
            added_by:
              type: object
              properties:
                pid:
                  type: string
                  description: Admin public id
              required:
                - pid
            recipient:
              type: object
              properties:
                number:
                  type: string
                  example: null
                  description: Account number.
                  maxLength: 32
                name:
                  type: string
                  description: Counterparty name.
                  maxLength: 120
                address:
                  type: string
                  description: Counterparty address.
                  maxLength: 120
                city:
                  type: string
                  description: Counterparty city.
                  maxLength: 320
                zip_code:
                  type: string
                  description: Counterparty zip code.
                  maxLength: 12
                country:
                  allOf:
                    - $ref: '#/components/schemas/CountrySchema'
                    - description: Counterparty country code.
              required:
                - number
                - name
          required:
            - amount
            - kind
            - recipient
            - added_by
            - challenge
    BaaSTransactionCreateFeeSchema:
      allOf:
        - $ref: '#/components/schemas/BaaSTransactionCreateBaseSchema'
        - type: object
          properties:
            fee:
              type: integer
              example: 0
              description: Transaction fee amount in cents
            kind:
              enum:
                - FEE
              example: FEE
              type: string
          required:
            - fee
            - kind
    BaaSTransactionCreateSchema:
      oneOf:
        - $ref: '#/components/schemas/BaaSTransactionCreateDebitSchema'
        - $ref: '#/components/schemas/BaaSTransactionCreateFeeSchema'
      discriminator:
        propertyName: kind
        mapping:
          DEBIT: '#/components/schemas/BaaSTransactionCreateDebitSchema'
          FEE: '#/components/schemas/BaaSTransactionCreateFeeSchema'
    BaaSTransactionCreatedDebitSchema:
      allOf:
        - $ref: '#/components/schemas/BaseTransactionSchema'
        - type: object
          properties:
            challenge:
              $ref: '#/components/schemas/ChallengeSchema'
          required:
            - challenge
            - sender
            - recipient
    BaaSTransactionCreatedSchema:
      oneOf:
        - $ref: '#/components/schemas/BaaSTransactionCreatedDebitSchema'
        - $ref: '#/components/schemas/BaseTransactionSchema'
      discriminator:
        propertyName: kind
        mapping:
          DEBIT: '#/components/schemas/BaaSTransactionCreatedDebitSchema'
          FEE: '#/components/schemas/BaseTransactionSchema'
    ChallengeSchema:
      type: object
      properties:
        pid:
          type: string
          example: T83H6LH48MMYS497
          readOnly: true
          description: Challenge public id
        kind:
          enum:
            - EMAIL
            - SMS
          example: EMAIL
          readOnly: true
        target:
          type: string
          readOnly: true
          example: e***@example.com
          description: Tokenized phone number or email address.
        number:
          type: integer
          example: 5
          description: Indicates the ordinal challenge number sent that day.
        added:
          type: string
          format: date-time
          example: '1698062541.845098'
          description: null
          readOnly: true
        expired:
          type: string
          format: date-time
          example: '1698062541.845098'
          description: null
        resent:
          type: string
          format: date-time
          example: '1698062541.845098'
          description: null
          readOnly: true
      required:
        - pid
        - kind
        - target
        - number
        - added
        - expired
        - resent
    TaxInfoSchema:
      type: array
      items:
        type: object
        properties:
          country:
            allOf:
              - $ref: '#/components/schemas/CountrySchema'
              - example: FI
              - description: Country of residence for tax purposes
          is_main:
            type: boolean
            example: true
            default: false
            description: Indicate selected country is main country for tax purposes
          tin:
            type: string
            example: 0765432-1
            nullable: true
            description: |
              Tax identification number. Optional. <span style="color: #EB1478">If provided, `tin_files` must also be provided.</span>
              <span style="color: #EB1478">One of the following combinations is required: `tin` + `tin_files` or `vatin` + `vatin_files`</span>
          tin_files:
            type: array
            items:
              type: object
              properties:
                pid:
                  type: string
                size:
                  type: integer
                  readOnly: true
                mimetype:
                  type: string
                  readOnly: true
                absolute_url:
                  type: string
                  format: uri
                  readOnly: true
                  pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                name:
                  type: string
                  readOnly: true
                added:
                  type: string
                  format: date-time
                  example: '1698062541.845098'
                  description: null
                  readOnly: true
              required:
                - pid
              description: |
                Tax identification number document file.
                <span style="color: #EB1478">Required only if `tin` is provided.</span>
          vatin:
            type: string
            example: null
            nullable: true
            description: |
              VAT identification number. Optional. <span style="color: #EB1478">If provided, `vatin_files` must also be provided.</span>
          vatin_files:
            type: array
            items:
              type: object
              properties:
                pid:
                  type: string
                size:
                  type: integer
                  readOnly: true
                mimetype:
                  type: string
                  readOnly: true
                absolute_url:
                  type: string
                  format: uri
                  readOnly: true
                  pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                name:
                  type: string
                  readOnly: true
                added:
                  type: string
                  format: date-time
                  example: '1698062541.845098'
                  description: null
                  readOnly: true
              required:
                - pid
              description: |
                VAT identification number document file.
                <span style="color: #EB1478">Required only if `vatin` is provided.</span>
        required:
          - country
          - is_main
    RejectReasonCodeSchema:
      type: string
      enum:
        - AB05
        - AB06
        - AB07
        - AB08
        - AB09
        - AB10
        - AC01
        - AC03
        - AC04
        - AC06
        - AG01
        - AG02
        - AG09
        - AG10
        - AG11
        - AM02
        - AM04
        - AM05
        - AM09
        - AM23
        - ARDT
        - BE04
        - CUST
        - CERI
        - CNOR
        - DNOR
        - DS14
        - DUPL
        - E001
        - E002
        - E003
        - E004
        - E005
        - E006
        - E007
        - E008
        - E009
        - FOCR
        - FRAD
        - LEGL
        - MD07
        - MS01
        - MS02
        - MS03
        - NOAS
        - NOOR
        - PY01
        - PY03
        - RC01
        - RR01
        - RR02
        - RR03
        - RR04
        - TBL1
        - TBL2
        - TECH
        - TM01
        - XD19
        - XD20
        - XD21
        - XD22
        - XT04
        - XT05
        - XT06
        - XT10
        - XT13
        - XT33
        - XT73
        - XT74
        - XT75
        - XT77
        - XT79
        - XT80
        - XT81
        - XT83
        - XT85
        - XT86
        - XT87
        - XT90
        - XT91
        - XT92
        - ED05
        - ERIN
        - FF01
        - NERI
        - DT01
        - CANC
        - RCLL
        - VALIDATION-BLOCK
        - RECALL
      description: |
        SEPA return codes:
        - `AB05`: Clearing process aborted due to timeout at the Beneficiary PSP (Creditor Agent)
        - `AB06`: Clearing process aborted due to timeout at Intermediary PSP or CSM (the Instructed Agent). Rejected by the CSM to Originator Bank upon Timeout condition
        - `AB07`: Agent of message is not online/available. Generic usage if it cannot be determined who exactly is unavailable
        - `AB08`: Beneficiary PSP (Creditor Agent) is not online/available
        - `AB09`: Clearing process aborted due to error at the Beneficiary PSP (Creditor Agent).
        - `AB10`: Clearing process aborted due to error at the Intermediary PSP or CSM (the Instructed Agent)
        - `AC01`: Incorrect account number
        - `AC03`: Wrong IBAN
        - `AC04`: Closed account number
        - `AC06`: Blocked account
        - `AG01`: Credit transfer forbidden on this account
        - `AG02`: Invalid bank operation code
        - `AG09`: Original payment never received
        - `AG10`: Agent of message is suspended from the Real Time Payment system. Generic usage if it cannot be determined who exactly is suspended
        - `AG11`: Beneficiary PSP (Creditor Agent) of message is suspended from the Real Time Payment system
        - `AM02`: Not Allowed Amount
        - `AM04`: Insufficient fund
        - `AM05`: Duplication
        - `AM09`: Wrong Amount
        - `AM23`: Transaction amount exceeds settlement limit
        - `ARDT`: Already Returned Transaction
        - `BE04`: Missing creditor address
        - `CUST`: Requested By Customer
        - `CERI`: The credit transfer is not tagged as an Extended Remittance Information (ERI) transaction but contains ERI
        - `CNOR`: Creditor bank is not registered
        - `DNOR`: Debtor Bank is not registered
        - `DS14`: Invalid user (technical)
        - `DUPL`: Duplicate Payment
        - `E001`: Duplication in identity ID is not allowed
        - `E002`: Overlap of un-availability periods not allowed for same BIC
        - `E003`: Unknown BIC
        - `E004`: Wrong Time
        - `E005`: Un-availability too far
        - `E006`: Daily threshold passed
        - `E007`: No matching available
        - `E008`: Cancel not allowed in the past
        - `E009`: Invalid value
        - `FOCR`: Following Cancellation Request
        - `FRAD`: Fraudulent Original SCT (INST) Transaction
        - `LEGL`: Legal Decision
        - `MD07`: Beneficiary deceased
        - `MS01`: Not specified reason
        - `MS02`: By order of the Beneficiary
        - `MS03`: Not Specified Reason Agent Generated
        - `NOAS`: No Answer From Customer
        - `NOOR`: Original Credit Transfer Never Received
        - `PY01`: Unknown BIC in routing table
        - `PY03`: Unknown BIC in TIPS directory
        - `RC01`: Bank identifier incorrect
        - `RR01`: Missing debtor account or identification
        - `RR02`: Missing debtor's name or address
        - `RR03`: Missing creditor's name or address
        - `RR04`: Regulatory reason
        - `TBL1`: Account blocked, Debtor side
        - `TBL2`: Account blocked, Creditor side
        - `TECH`: Technical problem
        - `TM01`: Invalid Cut Off Time. Rejected by the CSM to Beneficiary Bank upon Timeout condition
        - `XD19`: Invalid IBAN format
        - `XD20`: Invalid Account Number
        - `XD21`: Invalid Account Owner
        - `XD22`: Invalid settlement method for either Debtor Agent or Creditor Agent
        - `XT04`: Insufficient liquidity for processing the transaction on the System
        - `XT05`: Resubmitted to a subsequent settlement cycle
        - `XT06`: Invalid AccptTime, Rejected by CSM to Originator Banku pon exceeding tolerance period for the Acceptance Date&Time
        - `XT10`: Transaction inflight
        - `XT13`: Unsupported XML field
        - `XT33`: Invalid Data Format
        - `XT73`: Invalid Country Code
        - `XT74`: Invalid original transaction status, action required
        - `XT75`: Invalid Original Transaction Status, action not required
        - `XT77`: Original Amount Mismatch
        - `XT79`: The Debtor Agent is not allowed to send IP (pacs.008) and consequently to send Investigation (pacs.028) and Recalls (camt.056). It is also not allowed to receive NRR and PRR
        - `XT80`: The Creditor Agent is not allowed to receive IP (pacs.008) and consequently to receive Investigation (pacs.028) and Recalls (camt.056). It is also not allowed to send NRR and PRR
        - `XT81`: Field not permitted in SCT service
        - `XT83`: Participant not allowed to use the Product Id specified
        - `XT85`: Invalid Settlement Cycle
        - `XT86`: Expired Time limit for PCR
        - `XT87`: Inconsistent Instructing Agent
        - `XT90`: Invalid use of a Technical BIC
        - `XT91`: Not Allowed in SEPACOM
        - `XT92`: Instructed Agent not allowed for Non-Target Day AOS
        - `ED05`: Settlement failed
        - `ERIN`: ERI option not supported
        - `FF01`: Invalid file format
        - `NERI`: The SEPA Credit Transfer is tagged as an Extended Remittance Information (ERI) transaction but does not contain ERI
        - `DT01`: Invalid Date
        - `CANC`: Used in PCF file. The PCR was processed before the beginning of the settlement process of the original Credit Transfer. The original CT was not settled
        - `RCLL`: The PCR was processed after the settlement of the original Credit Transfer. The CT has been settled/cancelled by the ESM and the Recall Request was forwarded to the Beneficiary Bank of the original CT
        - `VALIDATION-BLOCK`: Rejected by intermediary bank
        - `RECALL`: Accepted SEPA transaction recall
    CountrySchema:
      enum:
        - AF
        - AX
        - AL
        - DZ
        - AS
        - AD
        - AO
        - AI
        - AQ
        - AG
        - AR
        - AM
        - AW
        - AU
        - AT
        - AZ
        - BS
        - BH
        - BD
        - BB
        - BY
        - BE
        - BZ
        - BJ
        - BM
        - BT
        - BO
        - BQ
        - BA
        - BW
        - BV
        - BR
        - IO
        - BN
        - BG
        - BF
        - BI
        - CV
        - KH
        - CM
        - CA
        - KY
        - CF
        - TD
        - CL
        - CN
        - CX
        - CC
        - CO
        - KM
        - CG
        - CD
        - CK
        - CR
        - CI
        - HR
        - CU
        - CW
        - CY
        - CZ
        - DK
        - DJ
        - DM
        - DO
        - EC
        - EG
        - SV
        - GQ
        - ER
        - EE
        - SZ
        - ET
        - FK
        - FO
        - FJ
        - FI
        - FR
        - GF
        - PF
        - TF
        - GA
        - GM
        - GE
        - DE
        - GH
        - GI
        - GR
        - GL
        - GD
        - GP
        - GU
        - GT
        - GG
        - GN
        - GW
        - GY
        - HT
        - HM
        - VA
        - HN
        - HK
        - HU
        - IS
        - IN
        - ID
        - IR
        - IQ
        - IE
        - IM
        - IL
        - IT
        - JM
        - JP
        - JE
        - JO
        - KZ
        - KE
        - KI
        - KW
        - KG
        - LA
        - LV
        - LB
        - LS
        - LR
        - LY
        - LI
        - LT
        - LU
        - MO
        - MG
        - MW
        - MY
        - MV
        - ML
        - MT
        - MH
        - MQ
        - MR
        - MU
        - YT
        - MX
        - FM
        - MD
        - MC
        - MN
        - ME
        - MS
        - MA
        - MZ
        - MM
        - NA
        - NR
        - NP
        - NL
        - NC
        - NZ
        - NI
        - NE
        - NG
        - NU
        - NF
        - KP
        - MK
        - MP
        - 'NO'
        - OM
        - PK
        - PW
        - PS
        - PA
        - PG
        - PY
        - PE
        - PH
        - PN
        - PL
        - PT
        - PR
        - QA
        - RE
        - RO
        - RU
        - RW
        - BL
        - SH
        - KN
        - LC
        - MF
        - PM
        - VC
        - WS
        - SM
        - ST
        - SA
        - SN
        - RS
        - SC
        - SL
        - SG
        - SX
        - SK
        - SI
        - SB
        - SO
        - ZA
        - GS
        - KR
        - SS
        - ES
        - LK
        - SD
        - SR
        - SJ
        - SE
        - CH
        - SY
        - TW
        - TJ
        - TZ
        - TH
        - TL
        - TG
        - TK
        - TO
        - TT
        - TN
        - TR
        - TM
        - TC
        - TV
        - UG
        - UA
        - AE
        - GB
        - UM
        - US
        - UY
        - UZ
        - VU
        - VE
        - VN
        - VG
        - VI
        - WF
        - EH
        - YE
        - ZM
        - ZW
      type: string
      example: FI
    PrivateTaxInfoSchema:
      type: array
      items:
        type: object
        properties:
          country:
            allOf:
              - $ref: '#/components/schemas/CountrySchema'
              - example: FI
              - description: Country of residence for tax purposes
          is_main:
            type: boolean
            example: true
            default: false
            description: Indicate selected country is main country for tax purposes
          tin:
            type: string
            example: 0765432-1
            nullable: true
          tin_files:
            type: array
            items:
              type: object
              properties:
                pid:
                  type: string
                size:
                  type: integer
                  readOnly: true
                mimetype:
                  type: string
                  readOnly: true
                absolute_url:
                  type: string
                  format: uri
                  readOnly: true
                  pattern: "^(?:[a-z0-9.+-]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\\[[0-9a-f:.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?<!-))*\\.(?!-)(?:[a-z¡-\uFFFF-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\\s]*)?\\z"
                name:
                  type: string
                  readOnly: true
                added:
                  type: string
                  format: date-time
                  example: '1698062541.845098'
                  description: null
                  readOnly: true
              required:
                - pid
              description: |
                Tax identification number document file.
                <span style="color: #EB1478">Required only if `tin` is provided.</span>
        required:
          - country
          - is_main
          - tin
          - tin_files
