openapi: 3.0.3
info:
  description: |
    # Overview

    This API is intended for registered partners in agreement with Fondo.

    The API is subject to change.
  version: 2.0.0
  title: Fondo Partner API
  license:
    name: Proprietary
    url: https://fondo.se/legal
  contact:
    email: tech@fondo.se
  x-logo:
    url: >-
      data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4MiA4MiI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiMxODU5ZmY7fS5jbHMtMntmaWxsOiNmZGZkZmM7fTwvc3R5bGU+PC9kZWZzPjx0aXRsZT5Gb25kbyAtIE1haWwgZm9vdGVyIC0gbnkgYnJhbmRpbmc8L3RpdGxlPjxnIGlkPSJMYWdlcl8xIiBkYXRhLW5hbWU9IkxhZ2VyIDEiPjxyZWN0IGNsYXNzPSJjbHMtMSIgd2lkdGg9IjgyIiBoZWlnaHQ9IjgyIi8+PC9nPjxnIGlkPSJMYWdlcl8yIiBkYXRhLW5hbWU9IkxhZ2VyIDIiPjxwYXRoIGNsYXNzPSJjbHMtMiIgZD0iTTIzLjc0LDM2LjA4YTUuNTgsNS41OCwwLDEsMCw1LjU3LDUuNThBNS41OCw1LjU4LDAsMCwwLDIzLjc0LDM2LjA4Wm0wLDguMTZhMi4zNCwyLjM0LDAsMCwxLTIuNDEtMi41NSwyLjQxLDIuNDEsMCwxLDEsNC44MSwwQTIuMzMsMi4zMywwLDAsMSwyMy43NCw0NC4yNFoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiLz48cmVjdCBjbGFzcz0iY2xzLTIiIHg9IjEwLjc5IiB5PSIzMy4zIiB3aWR0aD0iMTAuMDEiIGhlaWdodD0iMy41OCIvPjxyZWN0IGNsYXNzPSJjbHMtMiIgeD0iMTAuNzkiIHk9IjQ0LjM0IiB3aWR0aD0iMy41OCIgaGVpZ2h0PSIzLjU4Ii8+PHJlY3QgY2xhc3M9ImNscy0yIiB4PSIxMC43OSIgeT0iMzguODIiIHdpZHRoPSI2LjQzIiBoZWlnaHQ9IjMuNTgiLz48cGF0aCBjbGFzcz0iY2xzLTIiIGQ9Ik02MC42LDM2LjA4YTUuNTgsNS41OCwwLDEsMCw1LjU4LDUuNThBNS41OCw1LjU4LDAsMCwwLDYwLjYsMzYuMDhabTAsOC4xNmEyLjM0LDIuMzQsMCwwLDEtMi40MS0yLjU1LDIuNDEsMi40MSwwLDEsMSwyLjQxLDIuNTVaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIi8+PHJlY3QgY2xhc3M9ImNscy0yIiB4PSI2OC4zMiIgeT0iNDQuMzQiIHdpZHRoPSIzLjU4IiBoZWlnaHQ9IjMuNTgiLz48cGF0aCBjbGFzcz0iY2xzLTIiIGQ9Ik0zNy4wOSwzNi4wOEEzLjY2LDMuNjYsMCwwLDAsMzQsMzcuN1YzNi40NGgtMy4yVjQ2LjkySDM0VjQxLjM3YzAtMS42Mi43LTIuMjYsMS44NS0yLjI2czEuODIuNywxLjgyLDIuMzJ2NS40OWgzLjJ2LTYuMkM0MC44NSwzNy41OCwzOSwzNi4wOCwzNy4wOSwzNi4wOFoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiLz48cGF0aCBjbGFzcz0iY2xzLTIiIGQ9Ik01MC4zLDM3LjE4YTQuMTIsNC4xMiwwLDAsMC0yLjgyLTEuMDcsNS4zOCw1LjM4LDAsMCwwLTUuMTYsNS41OCw1LjM2LDUuMzYsMCwwLDAsNS4xLDUuNTgsMy45MywzLjkzLDAsMCwwLDIuODgtMS4xOHYuODVoMy4yVjMyLjNINTAuM1pNNDgsNDQuMjRhMi41NSwyLjU1LDAsMCwxLDAtNS4xLDIuMzQsMi4zNCwwLDAsMSwyLjQzLDIuNTVBMi4zNCwyLjM0LDAsMCwxLDQ4LDQ0LjI0WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMSAxKSIvPjwvZz48L3N2Zz4=
    backgroundColor: transparent
tags:
  - name: Authorization
    x-displayName: Authorization
    description: >
      Obtain and manage access tokens via **OAuth 2.0 Client Credentials**.

      Send `grant_type=client_credentials` with your `client_id` and
      `client_secret`.

      Use the returned `access_token` in `Authorization: Bearer <token>`.

      Tokens are short-lived—reuse during validity and renew on expiry.
  - name: Account
    x-displayName: Accounts
    description: >
      **Accounts** hold investor positions, balances, and cash movements under a
      client.

      Endpoints let you **list accounts**, **fetch details**, and **close
      accounts**.

      Responses include status, owner info, currency, linked bank accounts,
      positions, and timestamps.
  - name: Agreement
    x-displayName: Agreements
    description: >
      Retrieve account agreements and generate PDF documents for account-related
      contracts.
  - name: AllocationPlan
    description: |
      Allocation plans
  - name: Client
    x-displayName: Clients
    description: >
      A **client** is your legal entity (B2B) or grouping for end-investor
      accounts.

      Use these endpoints to **list, create, read, and update** clients, manage
      bank

      accounts and service types, and fetch client-specific resources
      (instruments, custodians).
  - name: Custodian
    x-displayName: Custodians
    description: >
      Fetch **custodians** linked to a client—useful for transfer instructions
      and operational routing.

      Returns identifiers and names for display and validation.
  - name: Journey
    x-displayName: Journeys (Hosted Flows)
    description: >
      **Journeys** are secure, hosted web flows for customer interactions:
      account opening (e-sign),

      KYC/KYB questionnaires, fund transfers, and allocation plan setup.

      Create a Journey via API, redirect customers to the time-limited URL, and
      poll/callback for results.
  - name: Instrument
    x-displayName: Instruments
    description: >
      The **instrument universe** consists of mutual funds available for a given
      client or globally.

      Retrieve instrument metadata: identifiers (e.g., ISIN), currency, latest
      price, **KIID** links,

      tradability flags, unit decimals, minimums, and cost/fee breakdowns.
  - name: Instruction
    x-displayName: Payment Instructions
    description: >
      **Payment instructions** (e.g., autogiro) batch one or more payments to
      accounts.

      Create instructions, then track the **payments** under each instruction
      (amounts, status, and references).
  - name: Order
    x-displayName: Orders
    description: >
      **Fund orders** (subscription/redemption) drive the trading lifecycle.

      Create, read, list, and cancel orders; track status from `received` →
      `sent` → `confirmed` → `settled`.

      Orders reference **accounts** and **instruments**, and map to cash/fund
      transactions on settlement.
  - name: Transaction
    x-displayName: Transactions
    description: |
      **Transactions** record movements of money and units.
       - **Cash transactions (CT):** deposits, withdrawals, cash legs of fund orders (with settlement dates).
       - **Fund transactions (FT):** unit movements from subscriptions/redemptions (trade & settlement dates).
      Use these endpoints to reconcile ledgers and statements.
  - name: Subscription
    x-displayName: Subscriptions (WebSocket & Webhooks)
    description: >
      Receive **real-time updates** from Fondo without polling.

      - **WebSocket:** open a persistent stream for `.create`, `.update`,
      `.delete`, and `heartbeat` events.

      - **Webhooks:** register a callback URL to get signed POSTs with
      `current`/`previous` payloads.

      Include replay/retry handling in your consumers.
  - name: System
    description: API Service functions
paths:
  /ping:
    get:
      description: >
        Simple health-check endpoint that replies with a { "pong": ... } JSON
        object. Use it to verify that the Fondo API is reachable and responsive
        before making production calls.
      tags:
        - System
      operationId: ping
      summary: Ping service
      security: []
      responses:
        '200':
          $ref: '#/components/responses/pong'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/auth/token:
    post:
      tags:
        - Authorization
      operationId: authToken
      summary: Obtain access token
      security: []
      description: >
        Issues a short-lived bearer token using OAuth 2.0 Client Credentials.
        Send grant_type=client_credentials with your client_id and client_secret
        (optionally scope, state). Use the returned access_token in the
        Authorization: Bearer header on subsequent requests. The response also
        includes expires_in (seconds) and echoes state when provided.
      requestBody:
        $ref: '#/components/requestBodies/authTokenRequest'
      responses:
        '200':
          $ref: '#/components/responses/authTokenResponse'
        '400':
          $ref: '#/components/responses/authTokenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/subscribe:
    get:
      tags:
        - Subscription
      security:
        - oAuth: []
      operationId: getWebsocket
      summary: Get WebSocket connection
      description: >
        Opens a persistent WebSocket channel for the specified client_id and
        streams real-time events defined in the event schema.


        Event types:


        > .create – includes a current property with the newly created object.

        > 

        > .update – includes a current property with the updated object and a
        previous property with the object's prior state.

        > 

        > .delete – includes a previous property with the deleted object.

        > 

        > heartbeat – sent at intervals to keep the connection alive.

        > 


        Use this endpoint to receive live updates (for example on orders,
        transactions, or journeys) without polling the REST API.


        A `heartbeat` event is sent regularly to keep the connection alive.
      parameters:
        - $ref: '#/components/parameters/clientId'
      responses:
        '204':
          $ref: '#/components/responses/websocket'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/account:
    get:
      tags:
        - Account
      operationId: getAccounts
      summary: List client's accounts
      description: >
        Returns every investment account linked to client_id, including
        identifiers, type, status, balances, positions, linked bank accounts,
        currency, and timestamps. Use this to display or manage the client's
        full account set.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/start'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/modifiedFrom'
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/accountSsn'
      responses:
        '200':
          $ref: '#/components/responses/accounts'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/kycstatus/account/{account_id}:
    get:
      tags:
        - Account
      operationId: getKycStatusByAccount
      summary: Get kyc status
      description: Get status of kyc
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/clientId'
      responses:
        '200':
          $ref: '#/components/responses/kycstatus'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '404':
          $ref: '#/components/responses/notFoundError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/account/{account_id}:
    get:
      tags:
        - Account
      operationId: getAccountById
      summary: Get account
      description: >
        Returns the full record for account_id under client_id, including
        identifiers, status, account and service type, owner details, balances
        and cumulative amounts, current positions, linked bank accounts,
        currency, and timestamps. Use this to display or verify a single
        investment account and its latest state.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/clientId'
      responses:
        '200':
          $ref: '#/components/responses/account'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '404':
          $ref: '#/components/responses/notFoundError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
    delete:
      tags:
        - Account
      operationId: deleteAccount
      summary: Close client account
      description: >
        Marks the account account_id (under client_id) as closed so no new
        activity can occur. The response echoes the account record including
        deleted/closed state. Historical data remains available for
        regulatory/reporting needs.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/clientId'
      responses:
        '200':
          $ref: '#/components/responses/account'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '404':
          $ref: '#/components/responses/notFoundError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/account/{account_id}/transaction/cash:
    get:
      tags:
        - Account
      operationId: getAccountCashTransactions
      summary: List cash transactions
      description: >
        Returns the cash ledger for account_id (under client_id), including
        transaction type (e.g., deposit/withdrawal/settlement/fee), references,
        accounts debited/credited, amount/currency, dates (createdDate,
        modifiedDate, settlementDate), and optional client/executor references.
        Use for cash reconciliation and statements.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/start'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/modifiedFrom'
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/accountId'
      responses:
        '200':
          $ref: '#/components/responses/cashTransactions'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/account/{account_id}/transaction/fund:
    get:
      tags:
        - Account
      operationId: getAccountFundTransactions
      summary: List fund transactions
      description: >
        Returns fund activity for account_id (under client_id) such as
        subscriptions/redemptions with instrument identifiers, units, price,
        currency, references, and key dates (tradeDate, settlementDate). Use to
        build position histories and confirm settled/unspecified units.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/start'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/modifiedFrom'
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/accountId'
      responses:
        '200':
          $ref: '#/components/responses/fundTransactions'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/account/{account_id}/withdrawal:
    post:
      tags:
        - Account
      operationId: createWithdrawal
      summary: Create withdrawal
      description: >
        Initiates a payout from account_id (under client_id). Provide withdrawal
        details (e.g., withdrawalType, target bankAccount) in the request body.
        The response returns the created transaction with identifiers, amounts,
        and settlement metadata for tracking.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/accountId'
      requestBody:
        $ref: '#/components/requestBodies/withdrawal'
      responses:
        '200':
          $ref: '#/components/responses/cashTransaction'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/account/{account_id}/agreement-types:
    get:
      tags:
        - Agreement
      operationId: getAccountAgreementTypes
      summary: Get agreement types
      description: Get available agreement types for an account.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/accountId'
      responses:
        '200':
          $ref: '#/components/responses/agreementTypes'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/account/{account_id}/agreement/{agreement_type_key}:
    get:
      tags:
        - Agreement
      operationId: getAccountAgreementPdf
      summary: Get agreement PDF
      description: Get agreement document in PDF format.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/agreementTypeKey'
      responses:
        '200':
          $ref: '#/components/responses/agreementPdf'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '404':
          $ref: '#/components/responses/notFoundError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/allocationplan:
    get:
      tags:
        - AllocationPlan
      operationId: getAllocationPlans
      summary: Get allocation plans
      description: Get allocation plans for client
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
      responses:
        '200':
          $ref: '#/components/responses/allocationPlans'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/allocationplan/{allocation_plan_id}:
    get:
      tags:
        - AllocationPlan
      operationId: getAllocationPlanById
      summary: Get allocation plan
      description: Get allocation plan by client and allocation plan ID
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/allocationPlanId'
      responses:
        '200':
          $ref: '#/components/responses/allocationPlan'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
    patch:
      tags:
        - AllocationPlan
      operationId: patchAllocationPlan
      summary: Update allocation plan
      description: Update allocation plan by client and allocation plan ID
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/allocationPlanId'
      requestBody:
        $ref: '#/components/requestBodies/patchAllocationPlan'
      responses:
        '200':
          $ref: '#/components/responses/allocationPlan'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/allocationplan/account/{account_id}:
    get:
      tags:
        - AllocationPlan
      operationId: getAllocationPlanByAccountId
      summary: Get allocation plan by account ID
      description: Get allocation plan by client and account ID
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/accountId'
      responses:
        '200':
          $ref: '#/components/responses/allocationPlan'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/deposit/swish/{swish_id}:
    get:
      tags:
        - Account
      operationId: pollSwishDeposit
      summary: Get Swish deposit status
      description: >
        Returns the current status of a previously initiated Swish deposit
        session. Use to confirm whether the deposit is pending or successfully
        paid; errorCode provides additional context if applicable.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/swishId'
      responses:
        '200':
          $ref: '#/components/responses/swishPollResponse'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/account/{account_id}/deposit/swish:
    post:
      tags:
        - Account
      operationId: createSwishDeposit
      summary: Create Swish deposit
      description: >
        Starts a new Swish payment session for account_id (under client_id).
        Send details like type (e.g., same_device), amount, and optional
        qrFormat. The response includes a session id, token, optional qrImage,
        and a paymentId to track the flow through status checks.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/accountId'
      requestBody:
        $ref: '#/components/requestBodies/createSwishDeposit'
      responses:
        '200':
          $ref: '#/components/responses/swishDepositResponse'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/transaction/cash:
    get:
      tags:
        - Transaction
      operationId: getCashTransactions
      summary: List cash transactions
      description: >
        Returns every cash movement across all accounts belonging to the
        specified client_id. Each transaction includes its id, transactionType
        (e.g. deposit, withdrawal, or cash leg of a fund order), linked
        references (ref, refType, clientRef, executorRef), debit and credit
        accounts, monetary details (amount, currency), and full lifecycle
        timestamps (createdDate, modifiedDate, settlementDate). Use this
        endpoint to audit or reconcile every cash inflow and outflow associated
        with the client.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/start'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/modifiedFrom'
        - $ref: '#/components/parameters/transactionRef'
        - $ref: '#/components/parameters/transactionRefType'
        - $ref: '#/components/parameters/clientId'
      responses:
        '200':
          $ref: '#/components/responses/cashTransactions'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/transaction/cash/{transaction_id}:
    get:
      tags:
        - Transaction
      operationId: getCashTransactionById
      summary: Get cash transaction
      description: >
        Returns the full record of a single cash movement identified by
        transaction_id for the given client_id. The response provides all key
        properties—transactionType (deposit, withdrawal, or cash leg of a fund
        order), linked references (ref, refType, clientRef, executorRef), debit
        and credit accounts, amount, currency, optional free text, and full
        lifecycle timestamps (createdDate, modifiedDate, settlementDate). Use
        this endpoint to inspect or audit an individual cash transaction in
        detail.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/transactionId'
      responses:
        '200':
          $ref: '#/components/responses/cashTransaction'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/transaction/fund:
    get:
      tags:
        - Transaction
      operationId: getFundTransactions
      summary: List fund transactions
      description: >
        Returns every fund‐unit movement across the accounts of the specified
        client_id, including both subscriptions and redemptions. Each
        transaction details its transactionType (e.g. subscription, redemption),
        linked references (ref, refType, clientRef, executorRef), target
        account, instrument identifiers, number of units, executed price,
        currency, and full lifecycle timestamps (createdDate, modifiedDate,
        tradeDate, settlementDate). Use this endpoint to audit or reconcile all
        fund‐unit inflows and outflows associated with the client.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/start'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/modifiedFrom'
        - $ref: '#/components/parameters/transactionRef'
        - $ref: '#/components/parameters/transactionRefType'
        - $ref: '#/components/parameters/clientId'
      responses:
        '200':
          $ref: '#/components/responses/fundTransactions'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/transaction/fund/{transaction_id}:
    get:
      tags:
        - Transaction
      operationId: getFundTransactionById
      summary: Get fund transaction
      description: >
        Returns the complete record of a single fund‐unit movement identified by
        transaction_id for the given client_id. The response includes the
        transactionType (subscription or redemption), related references (ref,
        refType, clientRef, executorRef), account and instrument identifiers,
        number of units, executed price, currency, and full lifecycle timestamps
        (createdDate, modifiedDate, tradeDate, settlementDate). Use this
        endpoint to inspect or audit an individual subscription or redemption
        transaction.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/transactionId'
      responses:
        '200':
          $ref: '#/components/responses/fundTransaction'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/order/withdrawal:
    post:
      tags:
        - Order
      operationId: createOrderWithdrawal
      summary: Create order withdrawal
      description: Sell fund units and withdraw the resulting amount
      security:
        - oAuth: []
      parameters:
        - name: validate-only
          required: false
          in: query
          allowEmptyValue: true
          example: 'true'
          schema:
            type: string
          description: |
            Only validate the order, do not create it.
        - $ref: '#/components/parameters/clientId'
      requestBody:
        $ref: '#/components/requestBodies/orderWithdrawal'
      responses:
        '204':
          $ref: '#/components/responses/order'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/order:
    get:
      tags:
        - Order
      operationId: getOrders
      summary: List orders
      description: >
        Returns every order placed under client_id, including both subscriptions
        and redemptions.

        Each order object provides its id, orderType, current status (e.g.,
        received, sent, confirmed, settled), associated account, references
        (clientRef, executorRef), the targeted instrument, requested units or
        amount, and full lifecycle timestamps (createdDate, modifiedDate,
        canceledDate).

        Use this endpoint to monitor all fund orders and their progress from
        initiation through settlement.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/start'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/modifiedFrom'
        - $ref: '#/components/parameters/clientId'
      responses:
        '200':
          $ref: '#/components/responses/orders'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
    post:
      tags:
        - Order
      operationId: createOrder
      summary: Create order
      description: >
        Creates a new fund order (subscription or redemption) on the account
        specified by account under the given client_id.

        Provide details such as orderType, instrument, amount or units, and
        optional references (clientRef, executorRef) to help track the order.

        The response includes the generated order id, its initial status
        (typically received), and full order details for monitoring as it moves
        through execution and settlement.
      security:
        - oAuth: []
      parameters:
        - name: validate-only
          required: false
          in: query
          allowEmptyValue: true
          example: 'true'
          schema:
            type: string
          description: |
            Only validate the order, do not create it.
        - $ref: '#/components/parameters/clientId'
      requestBody:
        $ref: '#/components/requestBodies/order'
      responses:
        '204':
          $ref: '#/components/responses/order'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/order/{order_id}:
    get:
      tags:
        - Order
      operationId: getOrderById
      summary: Get order
      description: >
        Returns the full details of a single order identified by order_id under
        the given client_id.

        The response includes the order's status (for example received, sent,
        confirmed, settled), orderType (subscription or redemption), associated
        account, instrument details, requested amount or units, and lifecycle
        timestamps (createdDate, modifiedDate, canceledDate).

        Use this endpoint to track an individual order's progress from
        initiation through settlement or cancellation.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/orderId'
      responses:
        '200':
          $ref: '#/components/responses/order'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
    delete:
      tags:
        - Order
      operationId: cancelOrder
      summary: Cancel order
      description: >
        Cancels the order identified by order_id for the given client_id.

        Use this endpoint to stop an order that has been created but not yet
        fully executed or settled.

        The response returns the complete order object with its status updated
        to canceled (if the cancellation succeeded), including all key fields
        such as orderType, instrument, and lifecycle timestamps.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/orderId'
      responses:
        '200':
          $ref: '#/components/responses/order'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/instrument:
    get:
      tags:
        - Instrument
      operationId: getInstruments
      summary: List instruments
      description: >
        Returns all mutual fund instruments available on the platform, including
        identifiers, currency, latest prices and dates, KIID links, tradability
        flags, costs/fees, rebates, and instrument rules (unit decimals,
        minimums). Use for global discovery, search, or to pre-filter a client's
        instrument set.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/start'
        - $ref: '#/components/parameters/limit'
      responses:
        '200':
          $ref: '#/components/responses/instruments'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/instrument/{instrument_id}:
    get:
      tags:
        - Instrument
      operationId: getIstrumentById
      summary: Get instrument
      description: >
        Returns the full instrument record for instrument_id, including
        identifiers (id, isincode), name, currency, latest pricing, KIID links,
        tradability flags, cost breakdowns, rebates, and unit/amount
        constraints. Use to power instrument detail pages and to validate order
        tickets.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/instrumentId'
      responses:
        '200':
          $ref: '#/components/responses/instrument'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/instruction/payment:
    post:
      tags:
        - Instruction
      operationId: createPaymentInstruction
      summary: Create payment instruction
      description: >
        Creates a new payment instruction of the specified type (for example
        autogiro) for the client identified by client_id.

        Provide an array of payments with details such as amount, destination
        account, and a unique clientRef.

        The response returns the instruction id, the list of created payments, a
        bankTransferRef if available, and the initial status (for example new)
        so you can track subsequent processing and settlements.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
      requestBody:
        $ref: '#/components/requestBodies/paymentInstruction'
      responses:
        '200':
          $ref: '#/components/responses/paymentInstruction'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/instruction/{instruction_id}/payment:
    get:
      tags:
        - Instruction
      operationId: getInstructionPayment
      summary: Get payments by instruction
      description: >
        Returns the list of individual payments linked to an instruction
        identified by instruction_id under the given client_id.

        Each payment record includes its id, destination account, amount,
        optional clientRef, current status (such as new or completed), and any
        explanatory reason or reasonCode. Use this endpoint to monitor execution
        and settlement of all payments created within a given payment
        instruction.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/instructionId'
      responses:
        '200':
          $ref: '#/components/responses/payments'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/instruction/{instruction_id}:
    get:
      tags:
        - Instruction
      operationId: getPaymentInstruction
      summary: Get payment instruction
      description: >
        Returns the full payment instruction identified by instruction_id under
        the given client_id. The response includes the instruction id, a list of
        scheduled payments (each with amount, target account, and optional
        clientRef), any bankTransferRef provided by the payment system, and the
        current status (such as new, processing, or completed). Use this
        endpoint to track the overall lifecycle and settlement state of a
        particular payment instruction.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/instructionId'
      responses:
        '200':
          $ref: '#/components/responses/paymentInstruction'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/custodian:
    get:
      tags:
        - Custodian
      operationId: getCustodians
      summary: List client custodians
      description: >
        Returns the set of custodians associated with client_id (e.g., for
        transfers), including identifiers and display names. Use this to
        populate custodian selectors or to validate transfer instructions.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
      responses:
        '200':
          $ref: '#/components/responses/custodians'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client:
    get:
      tags:
        - Client
      operationId: getClients
      summary: List clients
      description: >
        Returns all clients associated with the authenticated partner, including
        IDs, display names, bank account info for fees/settlements, service
        types, registration/country details, and timestamps. Use to show or
        manage your client portfolio.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/start'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/modifiedFrom'
      responses:
        '200':
          $ref: '#/components/responses/clients'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
    post:
      tags:
        - Client
      operationId: createClient
      summary: Create client
      description: >
        Creates a client record (company or individual) with identifiers (name,
        displayName, optional id), regulatory and operational details (crn,
        country), optional bank accounts for fee handling, and service types.
        The response returns the full persisted client including sortedId and
        timestamps.
      security:
        - oAuth: []
      requestBody:
        $ref: '#/components/requestBodies/postClient'
      responses:
        '204':
          $ref: '#/components/responses/client'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}:
    get:
      tags:
        - Client
      operationId: getClientById
      summary: Get client
      description: >
        Returns the full client object for client_id, including names, service
        types (with any assigned codes), bank accounts, and timestamps. Use to
        display or verify a single client's profile.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
      responses:
        '200':
          $ref: '#/components/responses/client'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
    patch:
      tags:
        - Client
      operationId: updateClient
      summary: Update client
      description: >
        Partially updates the client identified by client_id. Provide only the
        fields to change (e.g., displayName, bank accounts, service types,
        country). The response returns the updated client with refreshed
        timestamps.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
      requestBody:
        $ref: '#/components/requestBodies/patchClient'
      responses:
        '200':
          $ref: '#/components/responses/client'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /v2/partner/client/{client_id}/journey/{journey_id}:
    get:
      tags:
        - Journey
      operationId: getJourney
      summary: Get journey
      description: >
        Returns the current state, configuration, and outcome of a web journey
        identified by journey_id under client_id (e.g., createAccount). Includes
        journey URL, expiry, callback/redirect URLs, context/scope, and any
        produced results (such as created account, bank account, transfer
        instructions, allocation plan). Use it to monitor progress and fetch
        results after end-customer completion.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/journeyId'
      responses:
        '200':
          $ref: '#/components/responses/journey'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
      callbacks:
        onResourceEvent:
          '{$request.body#/callbackUrl}':
            post:
              summary: Journey callback
              security: []
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/journey_callback'
              responses:
                '200':
                  description: Callback successfully recieved.
                '400':
                  description: Bad request
  /v2/partner/client/{client_id}/journey:
    post:
      tags:
        - Journey
      operationId: postJourney
      summary: Create journey
      description: >
        Initiates a new web journey (e.g., createAccount) for the specified
        client_id. Provide journey configuration (account types, service type,
        optional allocation plan, KYC questions, transfer instructions) plus
        callback/redirect URLs. The response returns a journey id, a launchable
        url, status, and metadata you can track until completion.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
      requestBody:
        $ref: '#/components/requestBodies/postJourney'
      responses:
        '200':
          $ref: '#/components/responses/journey'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
      callbacks:
        onResourceEvent:
          '{$request.body#/callbackUrl}':
            post:
              summary: Journey callback
              security: []
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/journey_callback'
              responses:
                '200':
                  description: Callback successfully recieved.
                '400':
                  description: Bad request
  /v2/partner/client/{client_id}/instrument:
    get:
      tags:
        - Client
      operationId: getClientInstrumentUniverse
      summary: List client's instrument universe
      description: >
        Returns instruments available for the given client_id, including
        identifiers (id, isincode), name, currency, latest price (closePrice,
        priceDate), KIID links, trade flags (isBuyable, isSellable, isTradable),
        cost breakdowns, rebates, and rules (unit decimals, minimum investment).
        Use to power search, eligibility checks, and order tickets for that
        client.
      security:
        - oAuth: []
      parameters:
        - $ref: '#/components/parameters/clientId'
      responses:
        '200':
          $ref: '#/components/responses/instruments'
        '400':
          $ref: '#/components/responses/invalidRequestError'
        '401':
          $ref: '#/components/responses/unauthorizedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/serverError'
        '503':
          $ref: '#/components/responses/serviceUnavailableError'
  /fondo/webhooks/callback:
    post:
      summary: Webhook callback
      security: []
      tags:
        - Subscription
      description: >
        Your endpoint that Fondo calls whenever an event occurs. The POST body
        matches one of the event types defined in the event schema:


        > .create – current contains the newly created object.

        > 

        > .update – current contains the updated object, and previous shows the
        object's state before the change.

        > 

        > .delete – previous contains the deleted object.

        > 


        Fondo sends these requests to the callback URL you register, allowing
        your system to react immediately to updates such as account changes,
        order executions, or transaction settlements. (This API doc shows it as
        a POST to Fondo for illustration; in practice, the call is made from
        Fondo to your server.)


        Note that this documentation system does not yet support OpenAPI 3.1
        Webhooks spec and the callback

        is described as a POST to Fondos API. The URL and host is an endpoint on
        your system.
      operationId: webhookCallback
      requestBody:
        description: Call back to your server with updates
        content:
          application/json:
            schema:
              oneOf:
                - title: account.create
                  description: Account created
                  properties:
                    current:
                      $ref: '#/components/schemas/account'
                - title: account.delete
                  description: Account deleted
                  properties:
                    previous:
                      $ref: '#/components/schemas/account'
                - type: object
                  title: account.update
                  description: Account updated
                  properties:
                    current:
                      $ref: '#/components/schemas/account'
                    previous:
                      $ref: '#/components/schemas/account'
                - title: order.create
                  description: Order created
                  properties:
                    current:
                      $ref: '#/components/schemas/order'
                - title: order.delete
                  description: Order canceled
                  properties:
                    previous:
                      $ref: '#/components/schemas/order'
                - type: object
                  title: order.update
                  description: Order updated
                  properties:
                    current:
                      $ref: '#/components/schemas/order'
                    previous:
                      $ref: '#/components/schemas/order'
                - title: cashTransaction.create
                  description: Cash transaction created
                  properties:
                    current:
                      $ref: '#/components/schemas/order'
                - title: fundTransaction.create
                  description: Cash transaction created
                  properties:
                    current:
                      $ref: '#/components/schemas/order'
                - type: object
                  title: journey.delete
                  description: journey canceled
                  properties:
                    previous:
                      $ref: '#/components/schemas/journey_base'
                - type: object
                  title: journey.update
                  description: journey updated
                  properties:
                    current:
                      $ref: '#/components/schemas/journey_base'
                    previous:
                      $ref: '#/components/schemas/journey_base'
      responses:
        '200':
          description: >-
            Return a 200 status to indicate that the data was received
            successfully
        '400':
          description: Bad request
components:
  securitySchemes:
    oAuth:
      type: http
      scheme: bearer
      bearerFormat: Token
      description: >
        You authenticate by using `client_id` and `client_secret` as

        parameters in the _authorization_ request. This creates an
        `access_token`

        you will use in request for users resources. The token is valid for a
        set time.

        More detaids in in auth request
  parameters:
    start:
      name: start
      in: query
      allowEmptyValue: true
      schema:
        type: string
        example: 20240101abcdef
      description: |
        The `sortedId` to start from. Use for pagination.
    modifiedFrom:
      name: modifiedFrom
      in: query
      allowEmptyValue: true
      schema:
        type: string
        format: date-time
        example: '2024-01-01T00:00:01.000Z'
      description: |
        The `modifiedDate` to start from. Use for reconciliation.
    limit:
      name: limit
      in: query
      allowEmptyValue: true
      schema:
        type: number
        example: 100
      description: |
        Limit results. Default is none
    transactionRef:
      name: ref
      in: query
      allowEmptyValue: true
      schema:
        type: string
        example: de9b6d5e-bda0-44f6-9193-f241014f18d5
      description: |
        Match transactions to this `ref`
    transactionRefType:
      name: reftype
      in: query
      allowEmptyValue: true
      schema:
        type: string
        example: subscription
      description: |
        Match transactions `refType` to this `reftype`
    clientId:
      required: true
      name: client_id
      in: path
      allowEmptyValue: false
      schema:
        $ref: '#/components/schemas/id'
      description: |
        The ID of requested client.
    instructionId:
      required: true
      name: instruction_id
      in: path
      allowEmptyValue: false
      schema:
        $ref: '#/components/schemas/id'
      description: |
        The ID of requested instruction.
    journeyId:
      required: true
      name: journey_id
      in: path
      allowEmptyValue: false
      schema:
        $ref: '#/components/schemas/id'
      description: |
        The ID of requested journey.
    swishId:
      required: true
      name: swish_id
      in: path
      allowEmptyValue: false
      schema:
        $ref: '#/components/schemas/id'
      description: |
        The swish ID returned from swish deposit session
    allocationPlanId:
      required: true
      name: allocation_plan_id
      in: path
      allowEmptyValue: false
      schema:
        $ref: '#/components/schemas/id'
      description: |
        The ID of requested allocation plan.
    accountSsn:
      name: ssn
      allowEmptyValue: false
      in: query
      schema:
        type: string
        pattern: (19|20)[0-9]{2}[0-9]{2}[0-9]{4}
      description: |
        The social security number of account owner
    accountId:
      required: true
      name: account_id
      in: path
      allowEmptyValue: false
      schema:
        $ref: '#/components/schemas/id'
      description: |
        The ID of requested account.
    agreementTypeKey:
      required: true
      name: agreement_type_key
      in: path
      allowEmptyValue: false
      schema:
        type: string
      description: |
        The key of the requested agreement type.
      example: account
    transactionId:
      required: true
      name: transaction_id
      in: path
      allowEmptyValue: false
      schema:
        $ref: '#/components/schemas/id'
      description: |
        The ID of requested transaction.
    orderId:
      required: true
      name: order_id
      in: path
      allowEmptyValue: false
      schema:
        $ref: '#/components/schemas/id'
      description: |
        The ID of requested order.
    instrumentId:
      required: true
      name: instrument_id
      in: path
      allowEmptyValue: false
      schema:
        $ref: '#/components/schemas/id'
      description: |
        The ID of requested instrument.
  requestBodies:
    patchAllocationPlan:
      description: Patch allocation plan request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/allocation_plan_patch'
    authTokenRequest:
      description: An AUTH token request
      content:
        application/x-www-form-urlencoded:
          schema:
            $ref: '#/components/schemas/token_request'
    order:
      description: An order request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/order_request'
    orderWithdrawal:
      description: An order request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/order_withdrawal'
    patchClient:
      description: Modify client request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/patch_client'
    postClient:
      description: Create client request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/post_client'
    paymentInstruction:
      description: Create instruction of payments
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/payment_instruction_post'
    postJourney:
      description: Create journey request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/journey_post'
    withdrawal:
      description: Withdrawal request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/withdrawal_request'
    createSwishDeposit:
      description: Swish deposit
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/post_swish_deposit'
  responses:
    kycstatus:
      description: Status of kyc
      content:
        application/json:
          schema:
            type: object
            properties:
              order:
                type: boolean
                description: |
                  are all expected kycs completed for orders to be allowed?
              withdrawal:
                type: boolean
                description: |
                  are all expected kycs completed for withdrawals to be allowed?
    websocket:
      description: Websocket upgrade
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/event'
    pong:
      description: Pong response
      content:
        application/json:
          schema:
            type: object
            properties:
              pong:
                type: string
                format: date-time
                description: Time request received at server
                example: '2019-11-10T01:20:00.000Z'
    authTokenError:
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                oneOf:
                  - type: string
                    title: invalid_request
                    enum:
                      - invalid_request
                    example: invalid_request
                    description: |
                      The request is missing a required parameter, includes an
                      unsupported parameter value (other than grant type),
                      repeats a parameter, includes multiple credentials,
                      utilizes more than one mechanism for authenticating the
                      client, or is otherwise malformed.
                  - type: string
                    enum:
                      - invalid_client
                    title: invalid_client
                    example: invalid_client
                    description: |
                      Client authentication failed (e.g., unknown client, no
                      client authentication included, or unsupported
                      authentication method)
                  - type: string
                    enum:
                      - invalid_grant
                    title: invalid_grant
                    example: invalid_grant
                    description: |
                      The provided authorization grant (e.g., authorization
                      code, resource owner credentials) is
                      invalid, expired, revoked, does not match the redirection
                      URI used in the authorization request, or was issued to
                      another client.
                  - type: string
                    enum:
                      - unauthorized_client
                    title: unauthorized_client
                    example: unauthorized_client
                    description: |
                      The authenticated client is not authorized to use this
                      authorization grant type.
                  - type: string
                    enum:
                      - unsupported_grant_type
                    title: unsupported_grant_type
                    example: unsupported_grant_type
                    description: |
                      The authorization grant type is not supported by the
                      authorization server.
                  - type: string
                    enum:
                      - invalid_scope
                    title: invalid_scope
                    example: invalid_scope
                    description: |
                      The requested scope is invalid, unknown, malformed, or
                      exceeds the scope granted by the resource owner.
              error_description:
                type: string
                title: error_description
                description: Description of error
                example: This is an error description
    serverError:
      description: Server Error
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                type: string
                enum:
                  - server_error
                description: Error code
              error_description:
                type: string
                description: Description of error
    serviceUnavailableError:
      description: Service Unavailable Error
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                type: string
                enum:
                  - service_unavailable
                description: Error code
              error_description:
                type: string
                description: Description of error
    unauthorizedError:
      description: Unauthorized Error
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                type: string
                enum:
                  - unauthorized
                description: Error code
              error_description:
                type: string
                description: Description of error
    forbiddenError:
      description: Forbidden Error (Not in scope)
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                type: string
                enum:
                  - forbidden
                description: Error code
              error_description:
                type: string
                description: Description of error
    authTokenResponse:
      description: Auth token response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/token_response'
    invalidRequestError:
      description: Invalid request or paramaters
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                type: string
                enum:
                  - invalid_request
                description: Error code
              error_description:
                type: string
                description: Description of error
    notFoundError:
      description: Resource not Found
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                type: string
                enum:
                  - not_found
                description: Error code
              error_description:
                type: string
                description: Description of error
    accounts:
      description: Array of accounts
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/account'
    agreementTypes:
      description: Agreement types
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/agreement_type'
            example:
              - key: account
                swe: Kontoavtal
              - key: power_of_attorney
                swe: Fullmakt
    agreementPdf:
      description: Agreement document in PDF format
      content:
        application/pdf:
          schema:
            type: string
            format: binary
    account:
      description: Account
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/account'
    allocationPlan:
      description: Allocation plan
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/allocation_plan'
    allocationPlans:
      description: Allocation plans
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/allocation_plan'
    cashTransactions:
      description: Array of cash transactions
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/cash_transaction'
    cashTransaction:
      description: Cash transaction
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/cash_transaction'
    fundTransactions:
      description: Array of fund transactions
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/fund_transaction'
    fundTransaction:
      description: Fund transaction
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/fund_transaction'
    orders:
      description: Array of orders
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/order'
    order:
      description: Order
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/order'
    instruments:
      description: Array of instruments
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/instrument'
    instrument:
      description: Instrument
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/instrument'
    paymentInstruction:
      description: Instruction of payments
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/payment_instruction'
    payments:
      description: Array of payments
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/payment'
    swishDepositResponse:
      description: Swish deposit session information
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/swish_deposit_response'
    swishPollResponse:
      description: Swish deposit session status
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/swish_poll_response'
    clients:
      description: Array of clients
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/post_client'
    client:
      description: client
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/post_client'
    custodians:
      description: Array of custodians
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/custodian_base'
    journey:
      description: journey
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/journey_base'
  schemas:
    client:
      $ref: '#/components/schemas/post_client'
    patchClient:
      $ref: '#/components/schemas/patch_client'
    account:
      title: account
      type: object
      required:
        - name
        - accountType
        - serviceType
        - deleted
        - currency
        - clientId
      additionalProperties: false
      properties:
        id:
          $ref: '#/components/schemas/id'
        sortedId:
          $ref: '#/components/schemas/ulid'
        ref:
          type: string
          maxLength: 128
          description: |
            ref is a unique account number, based on
            epoch, length and Luhn. OCR /w length digit compliant.
          example: '160367146695159'
        name:
          type: string
          description: Name of account
          example: Spar
        status:
          type: string
          description: Status of account
          enum:
            - pending
            - active
            - rejected
            - confirm
        accountType:
          description: Account type
          oneOf:
            - type: string
              description: ISK, investeringssparkonto
              enum:
                - isk
              title: isk
            - type: string
              description: Depot, fonddepå
              enum:
                - depot
              title: depot
            - type: string
              description: Insurance, kapitalförsäkring
              enum:
                - insurance
              title: insurance
        serviceType:
          description: Account service type
          title: accountServiceType
          oneOf:
            - type: string
              description: Portfolio management
              enum:
                - portfolioManagement
              title: portfolioManagement
            - type: string
              description: Investment Advice
              enum:
                - investmentAdvise
              title: investmentAdvise
            - type: string
              description: Execution Only
              enum:
                - executionOnly
              title: executionOnly
        owner:
          type: object
          properties:
            firstName:
              type: string
              description: First name of account holder
              example: Ben
            lastName:
              type: string
              description: Last name of account holder
              example: Rangel
            fullName:
              type: string
              description: Full name of account holder
              example: Ben Rangel
            ssn:
              type: string
              description: Social security number of account holder
              pattern: (19|20)[0-9]{2}[0-9]{2}[0-9]{4}
              example: '197001010003'
        balance:
          type: number
          description: Snapshot of cash amount on account
          example: 100
        amounts:
          type: object
          description: Amounts on account
          properties:
            deposited:
              type: number
              description: Amount deposited to account
              example: 123.45
            withdrawn:
              type: number
              description: Amount withdrawn from account
              example: 123.45
        positions:
          type: array
          description: List of positions held
          items:
            type: object
            properties:
              instrument:
                type: string
                description: Instrument identifier
              units:
                type: number
                description: Number of units
              unitsSettled:
                type: number
                description: Number of units settled
              value:
                type: number
                nullable: true
                description: The total value of the position
              closePrice:
                type: number
                nullable: true
                description: Last closing price
              gav:
                type: number
                description: Average aquisition value (Genomsnittligt Anskaffningsvärde)
        deleted:
          type: boolean
          description: Is account deleted?
        clientId:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - description: The ID of the client managing this account
        bankAccounts:
          type: array
          items:
            $ref: '#/components/schemas/payment_account'
        currency:
          type: string
          description: Three letter ISO currency code
          pattern: ^[A-Z]{3}$
          example: SEK
        createdDate:
          type: string
          format: date-time
          description: Date when acocunt was created
          example: '2018-12-13T23:59:00.001Z'
          readOnly: true
        modifiedDate:
          type: string
          format: date-time
          description: Date when last modified
          example: '2018-12-13T23:59:00.001Z'
          readOnly: true
        deletedDate:
          type: string
          format: date-time
          description: Date when flagged as deleted
          example: '2018-12-13T23:59:00.001Z'
          readOnly: true
    agreementType:
      $ref: '#/components/schemas/agreement_type'
    cashTransaction:
      $ref: '#/components/schemas/cash_transaction'
    fundTransaction:
      $ref: '#/components/schemas/fund_transaction'
    custodian:
      $ref: '#/components/schemas/custodian_base'
    order:
      type: object
      title: order
      description: order
      allOf:
        - properties:
            id:
              $ref: '#/components/schemas/uuid'
            status:
              title: order status
              description: Order status
              oneOf:
                - type: string
                  enum:
                    - received
                  title: received
                  description: Received by the system.
                - type: string
                  enum:
                    - pending
                  title: pending
                  description: Order is pending cut-off time
                - type: string
                  enum:
                    - sent
                  title: sent
                  description: Order sent to external party / exchange
                - type: string
                  enum:
                    - settled
                  title: settled
                  description: Order is settled and completed
                - type: string
                  enum:
                    - canceled
                  title: canceled
                  description: Order is canceled
                - type: string
                  enum:
                    - hold
                  title: hold
                  description: Order is put on hold
        - $ref: '#/components/schemas/order_base'
        - properties:
            createdDate:
              type: string
              format: date-time
              description: date when created
              example: '2018-12-13T23:59:00.001Z'
              readOnly: true
            modifiedDate:
              type: string
              format: date-time
              description: Date when last modified
              example: '2018-12-13T23:59:00.001Z'
              readOnly: true
            canceledDate:
              type: string
              default: null
              format: date-time
              description: Date when canceled
              example: '2018-12-13T23:59:00.001Z'
              readOnly: true
    paymentInstruction:
      $ref: '#/components/schemas/payment_instruction'
    orderWithdrawal:
      $ref: '#/components/schemas/order_withdrawal'
    allocationPlan:
      $ref: '#/components/schemas/allocation_plan'
    instrument:
      oneOf:
        - $ref: '#/components/schemas/fund'
    journey:
      $ref: '#/components/schemas/journey_base'
    journeyCallback:
      $ref: '#/components/schemas/journey_callback'
    event:
      description: Event subscription object
      title: event
      oneOf:
        - type: object
          title: heartbeat
          properties:
            eventType:
              type: string
              enum:
                - heartbeat
              title: heartbeat
              description: Heartbeat to keep connection alive
        - type: object
          title: account.create
          properties:
            eventType:
              type: string
              enum:
                - account.create
              title: account.create
              description: Account created
            payload:
              type: object
              properties:
                current:
                  $ref: '#/components/schemas/account'
        - type: object
          title: account.update
          properties:
            eventType:
              type: string
              enum:
                - account.update
              title: account.update
              description: Account updated
            payload:
              type: object
              properties:
                current:
                  $ref: '#/components/schemas/account'
                previous:
                  $ref: '#/components/schemas/account'
        - type: object
          title: account.delete
          properties:
            eventType:
              type: string
              enum:
                - account.delete
              title: account.delete
              description: Account deleted
            payload:
              type: object
              properties:
                previous:
                  $ref: '#/components/schemas/account'
        - type: object
          title: client.update
          properties:
            eventType:
              type: string
              enum:
                - client.update
              title: client.update
              description: client updated
            payload:
              type: object
              properties:
                current:
                  $ref: '#/components/schemas/client_base'
                previous:
                  $ref: '#/components/schemas/client_base'
        - type: object
          title: client.delete
          properties:
            eventType:
              type: string
              enum:
                - client.delete
              title: client.delete
              description: client deleted
            payload:
              type: object
              properties:
                previous:
                  $ref: '#/components/schemas/client_base'
        - type: object
          title: cashTransaction.create
          properties:
            eventType:
              type: string
              enum:
                - cashTransaction.create
              title: cashTransaction.create
              description: Cash transaction created
            payload:
              type: object
              properties:
                current:
                  $ref: '#/components/schemas/cash_transaction'
        - type: object
          title: cashTransaction.update
          properties:
            eventType:
              type: string
              enum:
                - cashTransaction.update
              title: cashTransaction.update
              description: Cash transaction updated
            payload:
              type: object
              properties:
                current:
                  $ref: '#/components/schemas/cash_transaction'
                previous:
                  $ref: '#/components/schemas/cash_transaction'
        - type: object
          title: cashTransaction.delete
          properties:
            eventType:
              type: string
              enum:
                - cashTransaction.delete
              title: cashTransaction.delete
              description: Cash transaction deleted
            payload:
              type: object
              properties:
                previous:
                  $ref: '#/components/schemas/cash_transaction'
        - type: object
          title: fundTransaction.create
          properties:
            eventType:
              type: string
              enum:
                - fundTransaction.create
              title: fundTransaction.create
              description: Fund transaction created
            payload:
              type: object
              properties:
                current:
                  $ref: '#/components/schemas/fund_transaction'
        - type: object
          title: fundTransaction.update
          properties:
            eventType:
              type: string
              enum:
                - fundTransaction.update
              title: fundTransaction.update
              description: Fund transaction updated
            payload:
              type: object
              properties:
                current:
                  $ref: '#/components/schemas/fund_transaction'
                previous:
                  $ref: '#/components/schemas/fund_transaction'
        - type: object
          title: fundTransaction.delete
          properties:
            eventType:
              type: string
              enum:
                - fundTransaction.delete
              title: fundTransaction.delete
              description: Fund transaction deleted
            payload:
              type: object
              properties:
                previous:
                  $ref: '#/components/schemas/fund_transaction'
        - type: object
          title: order.create
          properties:
            eventType:
              type: string
              enum:
                - order.create
              title: order.create
              description: order created
            payload:
              type: object
              properties:
                current:
                  $ref: '#/components/schemas/order'
        - type: object
          title: order.update
          properties:
            eventType:
              type: string
              enum:
                - order.update
              title: order.update
              description: order updated
            payload:
              type: object
              properties:
                current:
                  $ref: '#/components/schemas/order'
                previous:
                  $ref: '#/components/schemas/order'
        - type: object
          title: order.delete
          properties:
            eventType:
              type: string
              enum:
                - order.delete
              title: order.delete
              description: order canceled (order status set to `canceled`)
            payload:
              type: object
              properties:
                previous:
                  $ref: '#/components/schemas/order'
        - type: object
          title: instrument.reloaded
          properties:
            eventType:
              type: string
              enum:
                - instrument.reloaded
              title: instrument.reloaded
              description: Funds updated
            payload:
              type: object
              properties:
                reloaded:
                  type: boolean
                  enum:
                    - true
                  title: reloaded
        - type: object
          title: journey.delete
          properties:
            eventType:
              type: string
              enum:
                - journey.delete
              title: journey.delete
              description: journey deleted
            payload:
              type: object
              properties:
                previous:
                  $ref: '#/components/schemas/journey_base'
        - type: object
          title: journey.update
          properties:
            eventType:
              type: string
              enum:
                - journey.update
              title: journey.update
              description: journey updated
            payload:
              type: object
              properties:
                current:
                  $ref: '#/components/schemas/journey_base'
                previous:
                  $ref: '#/components/schemas/journey_base'
    token_request:
      title: Auth Token Request
      type: object
      required:
        - grant_type
        - client_id
        - client_secret
      properties:
        grant_type:
          type: string
          enum:
            - client_credentials
        client_id:
          type: string
          description: The Client ID provided by Fondo
        client_secret:
          type: string
          description: The Client Secret provided by Fondo
        scope:
          type: string
          description: |
            Comma separated list of scopes.
          example: |
            `account:read, account:write`
        state:
          type: string
          description: |
            Client state. For example a base64 encoded string of state data.
          example: >-
            VGhpcyBpcyBteSBzdGF0ZS4gVGhlcmUgYXJlIG1hbnkgbGlrZSBpdCwgYnV0IHRoaXMgaXMgb25lIG1pbmUu
    token_response:
      title: Auth Token Request
      type: object
      required:
        - access_token
        - expires_in
      properties:
        access_token:
          type: string
          description: access_token to use for subsequent requests
          example: ffe74ba1-99a8-46e3-9ba2-9c0ef72e13c1
        expires_in:
          type: number
          description: >-
            The lifetime in seconds of the access token. Default is 432000 (5
            days)
          example: 432000
        state:
          type: string
          description: |
            Client state. For example a base64 encoded string of state data.
          example: >-
            VGhpcyBpcyBteSBzdGF0ZS4gVGhlcmUgYXJlIG1hbnkgbGlrZSBpdCwgYnV0IHRoaXMgaXMgb25lIG1pbmUu
    uuid:
      title: UUID
      type: string
      description: UUID (Universally Unique Identifier)
      example: 49ad7378-121c-4a53-9894-dfd14a7b4877
      pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
    id:
      allOf:
        - $ref: '#/components/schemas/uuid'
        - title: id
          description: ID (UUID) of object
          readOnly: true
    ulid:
      title: ULID
      type: string
      description: ULID (Universally Unique Lexicographically Sortable Identifier)
      example: 01ARZ3NDEKTSV4RRFFQ69G5FAV
      pattern: ^[0-9a-zA-Z]{26}$
      readOnly: true
    payment_account:
      title: paymentAccount
      type: object
      required:
        - iban
        - name
        - bank
      additionalProperties: false
      properties:
        id:
          $ref: '#/components/schemas/id'
        iban:
          type: string
          description: IBAN (ISO 13616, International Bank Account Number)
          example: SE7280000810340009783242
        bban:
          type: string
          description: Local bank account number
          example: 666 666 666
        bank:
          type: string
          description: Bank name
          example: Buy n' Large
        name:
          type: string
          description: Name of account
          example: Lönekonto
        createdDate:
          type: string
          format: date-time
          description: Date when acocunt was created
          example: '2018-12-13T23:59:00.001Z'
        modifiedDate:
          type: string
          format: date-time
          description: Date when last modified
          example: '2018-12-13T23:59:00.001Z'
        deletedDate:
          type: string
          format: date-time
          description: Date when and if deleted
          example: '2018-12-13T23:59:00.001Z'
        validated:
          type: boolean
          description: |
            Whether the bank account is validated by account check service.
            Required for withdrawals
          example: true
    fee_types:
      title: feeType
      description: Fee type
      type: string
      oneOf:
        - type: string
          enum:
            - client_fee_oneoff
          title: client_fee_oneoff
          description: One off fee
        - type: string
          enum:
            - client_fee_ongoing
          title: client_fee_ongoing
          description: Ongoing fee
        - type: string
          enum:
            - client_fee_transaction
          title: client_fee_transaction
          description: Transactional fee
        - type: string
          enum:
            - client_fee_performance
          title: client_fee_performance
          description: Performance fee
        - type: string
          enum:
            - client_fee_other
          title: client_fee_other
          description: Other fee
    bank_account:
      title: bankAccount
      type: object
      description: Bank account defintion based on fee type
      required:
        - feeType
        - iban
      additionalProperties: false
      properties:
        feeType:
          $ref: '#/components/schemas/fee_types'
        iban:
          type: string
          description: IBAN (ISO 13616, International Bank Account Number)
          example: SE7280000810340009783242
    serviceType:
      description: Account service type
      title: accountServiceType
      oneOf:
        - type: string
          description: Portfolio management
          enum:
            - portfolioManagement
          title: portfolioManagement
        - type: string
          description: Investment Advice
          enum:
            - investmentAdvise
          title: investmentAdvise
        - type: string
          description: Execution Only
          enum:
            - executionOnly
          title: executionOnly
    service_type:
      title: serviceType
      type: object
      description: Supported Service Type
      required:
        - accountServiceType
      additionalProperties: false
      properties:
        accountServiceType:
          $ref: '#/components/schemas/serviceType'
        code:
          readOnly: true
          type: string
          description: client activation code. 6 digits
          example: '123456'
          pattern: ^[0-9]{6}$
    client_base:
      title: client
      type: object
      properties:
        id:
          $ref: '#/components/schemas/id'
        sortedId:
          $ref: '#/components/schemas/ulid'
        name:
          type: string
          description: Name of client
          example: Advise AB
        displayName:
          type: string
          description: Name of client as displayed in journeys
          example: Advise
        bankAccounts:
          type: array
          description: >-
            Bank account defintions based on fee type. No duplicate feeTypes
            allowed
          uniqueItems: true
          items:
            $ref: '#/components/schemas/bank_account'
        serviceTypes:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/service_type'
        createdDate:
          type: string
          format: date-time
          description: Date when acocunt was created
          example: '2018-12-13T23:59:00.001Z'
          readOnly: true
        modifiedDate:
          type: string
          format: date-time
          description: Date when last modified
          example: '2018-12-13T23:59:00.001Z'
          readOnly: true
        crn:
          type: string
          description: Company registration number
          example: '1034567891'
        country:
          type: string
          description: Two-letter country code
          pattern: ^[A-Z][A-Z]$
          example: SE
      additionalProperties: false
    executor_ref:
      type: string
      title: executor reference
      description: >
        Id or reference to the client placing the order, authorized by power of
        attorney.


        Reference should be SSN of the individual client
      example: '197001010003'
    client_ref:
      type: string
      title: client reference
      description: Client applied ref
      example: my_order_123
    cash_transaction:
      type: object
      title: cashTransaction
      description: Cash Transaction
      required:
        - transactionType
        - amount
        - currency
      additionalProperties: false
      properties:
        id:
          $ref: '#/components/schemas/id'
        sortedId:
          $ref: '#/components/schemas/ulid'
        transactionType:
          type: string
          description: Account type
          oneOf:
            - type: string
              title: deposit
              enum:
                - deposit
              description: Deposit of cash to account
            - type: string
              title: fxFee
              enum:
                - fxFee
              description: Deposit of fxFee
            - type: string
              title: withdrawal
              enum:
                - withdrawal
              description: Withdrawal of cash from account
            - type: string
              title: transfer_in
              enum:
                - transfer_in
              description: Transfer of cash to account
            - type: string
              title: transfer_out
              enum:
                - transfer_out
              description: Transfer of cash from account
            - type: string
              title: subscription
              enum:
                - subscription
              description: Subscription order
            - type: string
              title: redemption
              enum:
                - redemption
              description: Redemption order
            - type: string
              title: retrocession
              enum:
                - retrocession
              description: Retrocession cash amount
        aborted:
          description: Transaction has been aborted.
          type: boolean
          default: false
        abortedReason:
          type: string
          description: Error code or freetext explaining abort
          example: referenced_order_canceled
        ref:
          type: string
          description: Transaction reference. External id. 255 chars.
          maxLength: 255
        refType:
          description: The type of reference. Text or object Id
          oneOf:
            - type: string
              enum:
                - text
              title: text
              description: Text reference
            - type: string
              enum:
                - order
              title: order
              description: Reference is an ID of an `order` object
            - type: string
              enum:
                - payment
              title: payment
              description: Reference is an ID of a `payment` object
            - type: string
              enum:
                - ca
              title: ca
              description: Reference is an ID of a `ca` (corporate action) object
            - type: string
              enum:
                - internal
              title: internal
              description: Transaction between internal accounts
            - type: string
              enum:
                - external
              title: external
              description: Transaction between external accounts
            - type: string
              enum:
                - client_fee_oneoff
              title: client_fee_oneoff
              description: One off fee
            - type: string
              enum:
                - client_fee_ongoing
              title: client_fee_ongoing
              description: Ongoing fee
            - type: string
              enum:
                - client_fee_transaction
              title: client_fee_transaction
              description: Transactional fee
            - type: string
              enum:
                - client_fee_performance
              title: client_fee_performance
              description: Performance fee
            - type: string
              enum:
                - client_fee_other
              title: client_fee_other
              description: Other fee
        creditAccount:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - description: UUID of credited (receiving) account
        debitAccount:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - description: UUID of debited (charged) account
        amount:
          type: number
          description: Transaction amount as a number
          example: 1.2
        currency:
          type: string
          description: Three letter ISO currency code
          pattern: ^[A-Z]{3}$
          example: SEK
          enum:
            - SEK
          default: SEK
        executorRef:
          $ref: '#/components/schemas/executor_ref'
        clientRef:
          $ref: '#/components/schemas/client_ref'
        freetext:
          type: string
          description: Free text of transaction
          example: Hello world
        instrument:
          type: string
          description: >-
            Id of instrument if it is a transaction related to a specific
            instrument but not an order, ie retrocession
          example: SE0012193019SEK
        startDate:
          type: string
          format: date
          description: If a transaction is regarding a period of time
        endDate:
          type: string
          format: date
          description: If a transaction is regarding a period of time
        createdDate:
          type: string
          format: date-time
          description: Date when transaction was created
          example: 2018-12-13t23:59:00.001z
          readOnly: true
        modifiedDate:
          type: string
          format: date-time
          description: Date when last modified
          example: 2018-12-13t23:59:00.001z
          readOnly: true
        settlementDate:
          type: string
          format: date-time
          description: Date when transaction was settled, null if not settled
          example: 2018-12-13t23:59:00.001z
          readOnly: true
    fund_transaction:
      type: object
      title: fundTransaction
      description: An object representing a fund transaction
      required:
        - transactionType
        - currency
        - account
        - units
        - identifier
        - instrument
      additionalProperties: false
      properties:
        id:
          $ref: '#/components/schemas/id'
        sortedId:
          $ref: '#/components/schemas/ulid'
        transactionType:
          type: string
          description: Fund transaction type
          oneOf:
            - type: string
              title: redemption
              enum:
                - redemption
              description: Units of a redemption order
            - type: string
              title: subscription
              enum:
                - subscription
              description: Units of subscription order
            - type: string
              title: transfer_in
              enum:
                - transfer_in
              description: Units transferred to account
            - type: string
              title: transfer_out
              enum:
                - transfer_out
              description: Units transferred out of account
        aborted:
          description: Transaction has been aborted.
          type: boolean
          default: false
        abortedReason:
          type: string
          description: Error code or freetext explaining abort
          example: referenced_order_canceled
        ref:
          type: string
          description: >-
            Reference ID of the object that caused the transaction (order, ca
            etc)
        refType:
          type: string
          description: Type that caused the transaction
          enum:
            - order
            - ca
            - internal
            - external
            - gift
            - compensations
            - inheritance
            - dividend
            - endowment_101
        account:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - description: UUID of account of transaction
        instrument:
          type: string
          description: Fondo instrument ID
          example: SE0012193019SEK
        identifier:
          description: ISIN code of fund instrument
          type: string
          example: SE0012193019
        units:
          type: number
          description: Transaction fund units
        price:
          type: number
          description: Transaction price per unit (NAV)
        currency:
          type: string
          description: Three letter ISO currency code of transaction
          pattern: ^[A-Z]{3}$
          example: SEK
        freetext:
          type: string
          description: Free text of transaction
          example: Hello world
        executorRef:
          $ref: '#/components/schemas/executor_ref'
        clientRef:
          $ref: '#/components/schemas/client_ref'
        createdDate:
          type: string
          format: date-time
          description: date when created
          example: '2018-12-13T23:59:00.001Z'
          readOnly: true
        modifiedDate:
          type: string
          format: date-time
          description: Date when last modified
          example: '2018-12-13T23:59:00.001Z'
          readOnly: true
        settlementDate:
          type: string
          format: date-time
          description: Date when transaction was settled, null if not settled
          example: '2018-12-13T23:59:00.001Z'
          nullable: true
          readOnly: true
        tradeDate:
          type: string
          format: date-time
          description: Trade date (date of pricing)
          example: '2018-12-13T23:59:00.001Z'
          nullable: true
          readOnly: true
    order_base:
      type: object
      title: order
      description: order
      required:
        - account
        - instrument
        - orderType
        - amount
        - units
      allOf:
        - properties:
            sortedId:
              $ref: '#/components/schemas/ulid'
            orderType:
              enum:
                - subscription
                - redemption
            account:
              allOf:
                - $ref: '#/components/schemas/uuid'
                - description: Account number
            clientRef:
              $ref: '#/components/schemas/client_ref'
            executorRef:
              $ref: '#/components/schemas/executor_ref'
            instrument:
              type: string
              example: US64110L1061USD
              description: Fondo instrument ID
            units:
              type: number
              example: 1000
              description: Number of units. 7 decimals. Required for redemption orders.
            amount:
              type: number
              example: 100
              description: >
                For a subscription order, this is the amount to subscribe for.
                For a redemption order this will be calculated on confirmation.
    status:
      type: string
      description: Status of account
      enum:
        - pending
        - active
        - rejected
        - confirm
    accountType:
      description: Account type
      oneOf:
        - type: string
          description: ISK, investeringssparkonto
          enum:
            - isk
          title: isk
        - type: string
          description: Depot, fonddepå
          enum:
            - depot
          title: depot
        - type: string
          description: Insurance, kapitalförsäkring
          enum:
            - insurance
          title: insurance
    properties-status:
      description: is the payment account verified?
      oneOf:
        - description: Pending
          type: string
          enum:
            - pending
          title: pending
        - description: Rejected
          type: string
          enum:
            - rejected
          title: rejected
        - description: Active, ready for withdrawals
          type: string
          enum:
            - active
          title: active
    journey_base:
      title: journey
      type: object
      additionalProperties: false
      description: >
        A `Journey` is a web journey for interacting with Fondo functionality,
        such as setting up an account.

        The callback at the partner will be called with status of the journey,
        such as when it is completed or aborted due to end-user decision or
        error.

        The callback information will also be sent over websocket if active.


        The scope parameter can be any value and used to keep state on partners
        end.


        The callback will be retried for any other status code than `200`.


        To ensure it is Fondo calling the callback URL, use the `scope`
        parameter to match.

        Fondo will also provide the IP address used from Fondos side.
      required:
        - journey
        - callbackUrl
        - scope
      properties:
        status:
          readOnly: true
          description: The partner/client has to follow the progress
          oneOf:
            - description: New, journey not yet activated
              type: string
              readOnly: true
              enum:
                - new
              title: new
            - description: Pending, journey in progress
              type: string
              readOnly: true
              enum:
                - pending
              title: pending
            - description: Canceled, end-user aborted
              type: string
              readOnly: true
              enum:
                - canceled
              title: canceled
            - description: Error, an error occured during the journey
              type: string
              readOnly: true
              enum:
                - error
              title: error
            - description: Complete, journey is completed
              type: string
              readOnly: true
              enum:
                - complete
              title: complete
            - description: Expired, journey is expired
              type: string
              readOnly: true
              enum:
                - expired
              title: expired
        id:
          description: The ID of web journey.
          allOf:
            - $ref: '#/components/schemas/uuid'
            - readOnly: true
        clientId:
          description: The ID of requested client.
          allOf:
            - $ref: '#/components/schemas/uuid'
            - readOnly: true
        url:
          readOnly: true
          type: string
          description: journey url
          example: >-
            https://webbo.fondo.se/dT7KlfoMrjOspMBvyAq2bvD8cSSAVZg50bAh8G8U6z4nNPRHAy
        expiryDate:
          readOnly: true
          type: string
          format: date-time
          description: Date when journey token is considered stale
          example: '2018-12-13T23:59:00.001Z'
        journey:
          type: object
          required:
            - accountServiceType
            - journeyType
            - accountTypes
          oneOf:
            - title: createAccount
              required:
                - accountTypes
                - accountServiceType
              additionalProperties: false
              properties:
                journeyType:
                  type: string
                  title: createAccount
                  enum:
                    - createAccount
                accountName:
                  type: string
                  maxLength: 500
                  description: >-
                    If not provided, the end-user will be asked to select
                    accountName. If provided, the accountName will not be
                    visible to the customer in this journey.
                email:
                  type: string
                  format: email
                  description: end user email address
                  example: enduser@endUserDomain.com
                  nullable: true
                accountTypes:
                  type: array
                  description: Allowed account types
                  items:
                    enum:
                      - isk
                      - depot
                      - insurance
                accountServiceType:
                  description: Account service type
                  type: string
                  title: accountServiceType
                  enum:
                    - portfolioManagement
                    - investmentAdvise
                    - executionOnly
                allocationPlan:
                  description: >
                    Setup an allocation plan for the account. Deposits will
                    allocate based on this plan.

                    If `null` the view will not be shown
                  nullable: true
                  type: object
                  required:
                    - instruments
                  properties:
                    paymentAccount:
                      type: object
                      description: >-
                        The details of the bank account to charge from
                        (autogiro)
                      properties:
                        iban:
                          type: string
                          description: IBAN (ISO 13616, International Bank Account Number)
                          example: SE7280000810340009783242
                    instruments:
                      description: >-
                        Instrument allocations. The sum of all allocations must
                        be exactly 100.
                      type: array
                      example:
                        - instrument: SE0000810798SEK
                          allocation: 100
                      items:
                        type: object
                        required:
                          - instrument
                          - allocation
                        properties:
                          instrument:
                            description: Instrument ID
                            type: string
                            example: SE0000810798SEK
                          allocation:
                            type: number
                            example: 100
                            description: Allocation in percent for this instrument
                kycs:
                  nullable: true
                  description: >-
                    Valid Know Your Customer answers used to prefill the options
                    in the journey.
                  type: array
                  items:
                    type: object
                    required:
                      - qid
                      - answer
                    properties:
                      qid:
                        description: Fondo ID of the question
                        example: money_origin
                        type: string
                      answer:
                        description: Answer
                        example: lön/pension
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                          - type: array
                          - type: object
                transfer:
                  description: >
                    If defined, the view with options to instruct Fondo to
                    initate transfers

                    from other custodians will be shown.

                    If `null` the view will not be shown.
                  nullable: true
                  type: object
                  properties:
                    forced:
                      type: boolean
                      description: >
                        If set to true, a transfer journey is implied and the
                        welcome screen will reflect this.

                        If the instruction set contains only one instruction and
                        it contains both `institutionId` and `account` the
                        selection view will not be displayed.
                    instructions:
                      description: Transfer instructions to be sent to other custodians
                      type: array
                      additionalProperties: false
                      items:
                        type: object
                        additionalProperties: false
                        required:
                          - custodian
                          - type
                        properties:
                          type:
                            type: string
                            enum:
                              - cash
                            description: Type of transfer
                          custodian:
                            allOf:
                              - $ref: '#/components/schemas/uuid'
                              - description: ID matching an custodian
                          account:
                            type: string
                            description: Account number or reference at custodian
                            example: '1223456789'
            - title: addBankAccount
              required:
                - account
                - autogiro
              additionalProperties: false
              description: |
                Let end user connect bank account that will be
                validated (usable for withdrawals).
                Optionally: ask for autogiro-mandate.
                Mandates have a lead time for at least one bank day
              properties:
                account:
                  allOf:
                    - $ref: '#/components/schemas/uuid'
                    - description: Fondo account
                autogiro:
                  type: object
                  required:
                    - enforce
                  properties:
                    enforce:
                      oneOf:
                        - type: string
                          enum:
                            - required
                          title: required
                          description: End-user MUST sign autogiro mandate
                        - type: string
                          enum:
                            - optional
                          title: optional
                          description: End-user may choose to sign autogiro mandate
                        - type: string
                          enum:
                            - none
                          title: none
                          description: End-user have no option to sign autogiro mandate.
                    forceNewBankAccount:
                      type: boolean
                      description: >
                        Defaults to false.

                        If *set to false* and autogiro enforce is set to
                        required or optional,

                        the end-user may select an existing account to connect
                        to autogiro

                        instead of connecting a new account.


                        If *set to true* and autogiro enforce is set to required
                        or

                        optional, force the end-user to connect a new
                        bankAccount

                        irrespective of if old accounts exists.
                journeyType:
                  type: string
                  title: addBankAccount
                  enum:
                    - addBankAccount
            - title: kycRenewal
              required:
                - account
              additionalProperties: false
              properties:
                account:
                  allOf:
                    - $ref: '#/components/schemas/uuid'
                    - description: Fondo account
                journeyType:
                  type: string
                  title: kycRenewal
                  enum:
                    - kycRenewal
            - title: updateAllocationPlan
              required:
                - account
              additionalProperties: false
              properties:
                journeyType:
                  type: string
                  title: updateAllocationPlan
                  enum:
                    - updateAllocationPlan
                account:
                  allOf:
                    - $ref: '#/components/schemas/uuid'
                    - description: Fondo account
                paymentAccount:
                  type: object
                  description: The details of the bank account to charge from (autogiro)
                  properties:
                    iban:
                      type: string
                      description: IBAN (ISO 13616, International Bank Account Number)
                      example: SE7280000810340009783242
        sortedId:
          allOf:
            - $ref: '#/components/schemas/ulid'
            - readOnly: true
        createdDate:
          type: string
          format: date-time
          description: Date when acocunt was created
          example: '2018-12-13T23:59:00.001Z'
          readOnly: true
        modifiedDate:
          type: string
          format: date-time
          description: Date when last modified
          example: '2018-12-13T23:59:00.001Z'
          readOnly: true
        deleted:
          description: True if the journey is deleted
          type: boolean
          readOnly: true
        deletedDate:
          readOnly: true
          nullable: true
          type: string
          format: date-time
          description: Date when last modified
          example: '2018-12-13T23:59:00.001Z'
        callbackUrl:
          type: string
          description: Url for partner callback
          example: https://api.habibisfonder.se/v1/fondo/callback
        redirectUrl:
          nullable: true
          type: string
          description: Redirect URL when leaving the Fondo Journey (BankID etc)
          example: customerApp:///
        errorCode:
          nullable: true
          readOnly: true
          type: string
          description: Any errors occurring during journey
        context:
          nullable: true
          readOnly: true
          type: string
          description: >-
            Where end-user exited the journey. On error on cancel, if
            applicable.
          example: createaccountsign
        scope:
          nullable: true
          maxLength: 500
          type: string
          description: >-
            BASE64 encoded partner specific data attached to the journey, such
            as encrypted data containing session information. It will be passed
            back to callback.
        result:
          nullable: true
          type: object
          description: Result of journey
          oneOf:
            - title: kycRenewal
              additionalProperties: false
              properties:
                journeyType:
                  type: string
                  title: kycRenewal
                  enum:
                    - kycRenewal
            - title: updateAllocationPlan
              additionalProperties: false
              properties:
                journeyType:
                  type: string
                  title: updateAllocationPlan
                  enum:
                    - updateAllocationPlan
                allocationPlan:
                  type: object
                  properties:
                    account:
                      allOf:
                        - $ref: '#/components/schemas/uuid'
                        - description: Fondo account
                    paymentAccount:
                      type: object
                      description: >-
                        The details of the bank account to charge from
                        (autogiro)
                      properties:
                        id:
                          allOf:
                            - $ref: '#/components/schemas/uuid'
                            - description: id of payment account
            - title: createAccount result
              properties:
                journeyType:
                  enum:
                    - createAccount
                account:
                  description: account created in journey
                  type: object
                  additionalProperties: false
                  properties:
                    id:
                      allOf:
                        - $ref: '#/components/schemas/uuid'
                        - description: id of account
                    status:
                      $ref: '#/components/schemas/status'
                    accountType:
                      $ref: '#/components/schemas/accountType'
                    serviceType:
                      $ref: '#/components/schemas/serviceType'
                bankAccounts:
                  description: accounts registered with allocation plan or for withdrawal
                  type: object
                  additionalProperties: false
                  properties:
                    id:
                      allOf:
                        - $ref: '#/components/schemas/uuid'
                        - description: id of payment account
                    status:
                      $ref: '#/components/schemas/properties-status'
                    iban:
                      type: string
                      description: IBAN (ISO 13616, International Bank Account Number)
                      example: SE7280000810340009783242
                transfers:
                  description: >-
                    If transfers from other custodian was created, the results
                    are provded here. One item per account.
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - cash
                        description: Type of transfer
                      custodian:
                        allOf:
                          - $ref: '#/components/schemas/uuid'
                          - description: ID matching an institution.
                      account:
                        type: string
                        description: Account number at institution
                        example: '1223456789'
                allocationPlan:
                  description: >
                    If an allocationPlan was created. The results are provided
                    here
                  type: object
                  properties:
                    id:
                      allOf:
                        - $ref: '#/components/schemas/uuid'
                        - description: id of allocation plan
                    paymentAccount:
                      type: object
                      description: >-
                        The details of the bank account to charge from
                        (autogiro)
                      properties:
                        iban:
                          type: string
                          description: IBAN (ISO 13616, International Bank Account Number)
                          example: SE7280000810340009783242
                        id:
                          allOf:
                            - $ref: '#/components/schemas/uuid'
                            - description: id of bank account
                    instruments:
                      description: >-
                        Instrument allocations. The sum of all allocations must
                        be exactly 100.
                      type: array
                      example:
                        - instrument: SE0000810798SEK
                          amount: 100
                      items:
                        type: object
                        properties:
                          instrument:
                            description: Instrument ID
                            type: string
                            example: SE0000810798SEK
                          allocation:
                            type: number
                            example: 100
                            description: Allocation in percent for this instrument
    withdrawal_request:
      type: object
      title: withdrawal
      description: Withdrawal
      required:
        - amount
        - executorRef
        - withdrawalType
      properties:
        clientRef:
          $ref: '#/components/schemas/client_ref'
        executorRef:
          $ref: '#/components/schemas/executor_ref'
        amount:
          type: number
          description: Transaction amount
      oneOf:
        - type: object
          title: bank_payout
          description: Payout to customers bank account
          required:
            - bankAccount
          properties:
            withdrawalType:
              type: string
              enum:
                - bank_payout
              title: bank_payout
              description: Payout to customers bank account
            bankAccount:
              allOf:
                - $ref: '#/components/schemas/uuid'
                - description: ID of bank account from `account` schema
        - type: object
          title: fee_charge
          description: Charge of fee to customers account
          required:
            - feeType
          properties:
            withdrawalType:
              type: string
              enum:
                - fee_charge
              title: fee_charge
              description: Charge of fee to customers account
            feeType:
              $ref: '#/components/schemas/fee_types'
    agreement_type:
      title: agreementType
      type: object
      required:
        - key
        - swe
      properties:
        key:
          type: string
          description: Agreement type identifier
          example: account
        swe:
          type: string
          description: Swedish name for the agreement type
          example: Kontoavtal
    allocation_plan_instrument:
      title: allocationPlanInstrument
      type: object
      required:
        - instrument
        - allocation
      properties:
        instrument:
          description: ID of instrument
          type: string
          example: SE0000810798SEK
        allocation:
          type: number
          example: 100
          description: Allocation in percent for this instrument
    allocation_plan:
      title: allocationPlan
      type: object
      required:
        - id
        - account
        - bankAccount
        - instruments
      additionalProperties: false
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - description: ID of allocation plan
        account:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - description: ID of account
        bankAccount:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - description: ID of bank account
        instruments:
          description: >-
            Instrument allocations. The sum of all allocations must be exactly
            100.
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/allocation_plan_instrument'
    allocation_plan_patch:
      title: patchAllocationPlan
      type: object
      additionalProperties: false
      minProperties: 1
      properties:
        bankAccount:
          description: ID of bank account with autogiro mandate
          type: string
          format: uuid
          nullable: true
    swish_poll_response:
      type: object
      properties:
        status:
          type: string
          description: status from swish
          example: PAID
        errorCode:
          type: string
          nullable: true
          description: error code from swish
          example: AM02
    post_swish_deposit:
      type: object
      discriminator:
        propertyName: type
      oneOf:
        - title: SwishDepositSameDevice
          type: object
          required:
            - type
            - amount
          properties:
            type:
              type: string
              enum:
                - same_device
              description: type of swish signature
            clientRef:
              type: string
              description: Client reference for tracking the payment
            amount:
              type: number
              description: Amount
        - title: SwishDepositQr
          type: object
          required:
            - type
            - amount
            - qrFormat
          properties:
            type:
              type: string
              enum:
                - qr
              description: type of swish signature
            clientRef:
              type: string
              description: Client reference for tracking the payment
            amount:
              type: number
              description: Amount
            qrFormat:
              type: object
              required:
                - format
              description: >-
                qr format in accordance to to swish Mcom to Qcom qr v1
                https://developer.swish.nu/api/qr-codes/v1
              properties:
                format:
                  type: string
                  enum:
                    - jpg
                    - svg
                    - png
                size:
                  type: number
                  description: >-
                    Size of the QR code. The code is a square, so width and
                    height are the same. Not required if the format is svg.
                border:
                  type: number
                  description: Width of the border.
                transparent:
                  type: boolean
                  description: Transparent background color. Does not work with jpg format.
    swish_deposit_response:
      type: object
      properties:
        id:
          type: string
          description: id of swish payment. Use to get status of signature
        token:
          type: string
          description: swish token. Used to start bankid app on same devie
        qrImage:
          type: string
          description: swish qr image. Provided only if type set to qr
        paymentId:
          description: id of corresponding payment object
          allOf:
            - $ref: '#/components/schemas/uuid'
            - readOnly: true
    order_withdrawal:
      type: object
      description: redemption order with withdrawal
      title: redemption order for withdrawal
      allOf:
        - required:
            - account
            - instrument
            - units
            - executorRef
            - orderType
            - bankAccount
      properties:
        orderType:
          enum:
            - redemption
        account:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - description: Account ID
        clientRef:
          type: string
          description: Client applied ref
          example: my_order_123
        executorRef:
          $ref: '#/components/schemas/executor_ref'
        instrument:
          type: string
          example: US64110L1061USD
          description: Fondo instrument ID
        units:
          type: number
          example: 1000
          description: Number of units. 7 decimals
        paymentAccount:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - description: >-
                Payment account ID to create bank payout for. **Deprecated: Use
                bankAccount instead.**
              deprecated: true
        bankAccount:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - description: Bank account ID to create bank payout for
    order_subscription:
      type: object
      description: subscription order
      title: subscription order
      required:
        - account
        - instrument
        - orderType
        - amount
        - executorRef
      properties:
        orderType:
          enum:
            - subscription
        account:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - description: Account ID
        clientRef:
          type: string
          description: Client applied ref
          example: my_order_123
        executorRef:
          $ref: '#/components/schemas/executor_ref'
        instrument:
          type: string
          example: US64110L1061USD
          description: Fondo instrument ID
        amount:
          type: number
          example: 100
          description: |
            The amount to subscribe for.
    order_redemption:
      type: object
      description: redemption order
      title: redemption order
      required:
        - account
        - instrument
        - orderType
        - units
        - executorRef
      properties:
        orderType:
          enum:
            - redemption
        account:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - description: Account ID
        clientRef:
          type: string
          description: Client applied ref
          example: my_order_123
        executorRef:
          $ref: '#/components/schemas/executor_ref'
        instrument:
          type: string
          example: US64110L1061USD
          description: Fondo instrument ID
        units:
          type: number
          example: 1000
          description: Number of units. 7 decimals
    order_request:
      oneOf:
        - $ref: '#/components/schemas/order_subscription'
        - $ref: '#/components/schemas/order_redemption'
    instrument_id:
      title: instrumentId
      type: string
      description: |
        Fondo instrument ID
      example: SE0012193019SEK
      pattern: ^[A-Z]{2}[A-Z0-9]{9}[0-9](SEK|USD|EUR|NOK)$
    fund:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/instrument_id'
        isincode:
          type: string
          example: SE0001862426
        name:
          type: string
          example: Adrigo Hedge
          description: Name of fund
        currency:
          type: string
          pattern: ^[a-zA-Z]{3}$
          description: Currency code of fund
          example: NOK
        closePrice:
          type: number
          description: Last closing price
        priceDate:
          type: string
          format: date-time
          description: Date when price was updated
          example: '2018-12-13T23:59:00.001Z'
        kiid:
          type: array
          items:
            type: object
            properties:
              href:
                type: string
                description: HTTP URL link to document
                example: >-
                  https://doc.morningstar.com/document/dE423E4e4d2D4ED4d4e.msdoc/?clientId=fondo&key=key
              format:
                type: string
                description: File format of doucment.
                example: PDF
              id:
                type: string
        decimalsUnits:
          nullable: true
          type: number
          description: Number of decimals used for fund units
        minInvestmentAmountSEK:
          nullable: true
          type: number
          description: |
            Minimum amount for subscription orders.
            Synonymous with minInitialAmountSek
          deprecated: true
        minInitialAmountSek:
          nullable: true
          type: number
          description: Minimum amount for **first** subscription order on the account.
        minSubsequentAmountSek:
          nullable: true
          type: number
          description: |
            Minimum amount for subscription orders placed 
            when an account already holds a position.
        isComplex:
          type: boolean
          description: >
            Whether the instrument is deemed **complex**.

            If `true`, retail clients must complete additional appropriateness
            checks before investing.
        isBuyable:
          type: boolean
          description: Is fund buyable
        isSellable:
          type: boolean
          description: Is fund sellable
        isTradable:
          type: boolean
          description: Is fund tradeable, i.e. either buyable or sellable
        cost:
          type: object
          properties:
            total:
              type: number
            fx:
              type: number
            transactionFeeActual:
              type: number
            ongoingActual:
              type: number
            managementFee:
              type: number
            managementFeeActual:
              type: number
            performanceFeeActual:
              type: number
            transactionFeeEstimated:
              type: number
            ongoingEstimated:
              type: number
            managementFeeEstimated:
              type: number
            performanceFeeEstimated:
              type: number
        rebate:
          type: number
          description: The rebate for this fund in bips
          example: 96
    payment_instruction_post:
      type: object
      additionalProperties: false
      properties:
        type:
          description: The type of payment
          enum:
            - autogiro
        payments:
          description: Array of payment instructions
          type: array
          items:
            type: object
            required:
              - amount
              - account
              - clientRef
            properties:
              amount:
                description: The amount of the payment
                type: number
                example: 110
              account:
                $ref: '#/components/schemas/id'
              clientRef:
                description: |
                  Client specified reference for keeping track of payment.
                  Value is copied to the `clientRef` of transactions
                example: instruction_id_29384
                type: string
    payment_instruction:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/id'
        type:
          description: The type of instruction
          type: string
          example: autogiro
        instructions:
          description: Array of payment instructions
          type: array
          items:
            type: object
            additionalProperties: false
            required:
              - amount
              - account
              - clientRef
            properties:
              amount:
                description: The amount of the payment
                type: number
                example: 110
              account:
                $ref: '#/components/schemas/id'
              clientRef:
                description: |
                  Client specified reference for keeping track of payment.
                  Value is copied to the `clientRef` of transactions
                type: string
        bankTransferRef:
          description: The text to use in a bank transfer. Not applicable for `autogiro`
          type: string
          example: REF-12345
          nullable: true
        status:
          type: string
          description: instruction status
          oneOf:
            - type: string
              title: new
              description: instruction created
              enum:
                - new
            - type: string
              title: executing
              description: Payments are being created
              enum:
                - executing
            - type: string
              title: processed
              description: Payments have been created
              enum:
                - processed
            - type: string
              title: error
              enum:
                - error
              description: Payment creation failed
            - type: string
              title: canceled
              enum:
                - canceled
              description: The instruction was canceled
    payment:
      title: payment
      type: object
      additionalProperties: false
      properties:
        id:
          $ref: '#/components/schemas/id'
        sortedId:
          type: string
          description: Sortable ID for ordering payments chronologically
        account:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - description: UUID of account
        amount:
          type: number
          description: Payment amount
        clientRef:
          $ref: '#/components/schemas/client_ref'
        status:
          type: string
          description: Payment status
          oneOf:
            - description: Payment created
              type: string
              title: new
              enum:
                - new
            - description: Payment is pending
              title: pending
              enum:
                - pending
            - description: Payment is completed and transaction is processing
              type: string
              title: complete
              enum:
                - complete
            - description: Payment failed
              type: string
              title: failed
              enum:
                - failed
            - description: Payment is settled and transaction has been created
              type: string
              title: settled
              enum:
                - settled
            - description: Payment is canceled
              type: string
              title: canceled
              enum:
                - canceled
            - description: Payment is refunded
              type: string
              title: refunded
              enum:
                - refunded
        reason:
          type: string
          nullable: true
          description: Reason of failure
        reasonCode:
          type: string
          nullable: true
          description: Bankgiro error code
    custodian_base:
      type: object
      additionalProperties: false
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - description: UUID of custodian.
        name:
          type: string
          description: Name of custodian
    post_client:
      title: client
      type: object
      required:
        - name
        - displayName
        - crn
        - serviceTypes
        - country
      allOf:
        - $ref: '#/components/schemas/client_base'
    patch_client:
      title: client
      type: object
      minProperties: 1
      allOf:
        - $ref: '#/components/schemas/client_base'
    journey_callback:
      title: Journey callback
      type: object
      description: >
        The callback at the partner will be called with status of the journey,
        such as when it is completed or aborted due to end-user decision or
        error.

        The callback information will also be sent over websocket if active.


        The scope parameter can be any value, BASE64 encoded, and used to keep
        state on partners end.


        The callback will be retried 10 times for any other status code than
        `200`.


        To ensure it is Fondo calling the callback URL, use the `scope`
        parameter to match.

        Fondo will also provide the Fondo source IP address.
      oneOf:
        - title: error
          properties:
            id:
              allOf:
                - description: The ID of web journey.
                - $ref: '#/components/schemas/uuid'
            context:
              type: string
              description: >-
                Where user exited the journey. On error on cancel, if
                applicable.
              example: createaccountsign
              nullable: true
            status:
              enum:
                - error
            error:
              type: object
              oneOf:
                - title: createAccount
                  properties:
                    code:
                      oneOf:
                        - description: End-user related process aborted the journey
                          type: string
                          enum:
                            - USER_ERROR
                          title: USER_ERROR
                        - description: End-user could not be authenticated.
                          type: string
                          enum:
                            - AUTH_ERROR
                          title: AUTH_ERROR
                        - description: KnowYourCustomer related process aborted the journey
                          type: string
                          enum:
                            - KYC_ERROR
                          title: KYC_ERROR
                        - description: An error occurred
                          type: string
                          enum:
                            - OTHER_ERROR
                          title: OTHER_ERROR
                        - description: >-
                            Transfer of fund units or cash had an error. Account
                            is rejected.
                          type: string
                          enum:
                            - TRANSFER_ERROR
                          title: TRANSFER_ERROR
                        - description: Error during sign
                          type: string
                          enum:
                            - SIGN_ERROR
                          title: SIGN_ERROR
                    journeyType:
                      type: string
                      title: createAccount
                      enum:
                        - createAccount
              description: Any errors occurring during journey
            scope:
              nullable: true
              maxLength: 500
              type: string
              description: >-
                BASE64 encoded partner specific data attached to the journey,
                such as encrypted data containing session information. It will
                be passed back to callback.
        - title: canceled
          properties:
            id:
              allOf:
                - description: The ID of web journey.
                - $ref: '#/components/schemas/uuid'
            context:
              type: string
              description: >-
                Where user exited the journey. On error on cancel, if
                applicable.
              example: createaccountsign
              nullable: true
            status:
              type: string
              title: canceled
              enum:
                - canceled
            scope:
              nullable: true
              maxLength: 500
              type: string
              description: >-
                BASE64 encoded partner specific data attached to the journey,
                such as encrypted data containing session information. It will
                be passed back to callback.
        - title: pending
          properties:
            id:
              allOf:
                - description: The ID of web journey.
                - $ref: '#/components/schemas/uuid'
            status:
              type: string
              title: pending
              enum:
                - pending
            scope:
              nullable: true
              maxLength: 500
              type: string
              description: >-
                BASE64 encoded partner specific data attached to the journey,
                such as encrypted data containing session information. It will
                be passed back to callback.
        - title: expired
          properties:
            id:
              allOf:
                - description: The ID of web journey.
                - $ref: '#/components/schemas/uuid'
            status:
              type: string
              title: expired
              enum:
                - expired
            scope:
              nullable: true
              maxLength: 500
              type: string
              description: >-
                BASE64 encoded partner specific data attached to the journey,
                such as encrypted data containing session information. It will
                be passed back to callback.
        - title: complete
          properties:
            id:
              allOf:
                - description: The ID of web journey.
                - $ref: '#/components/schemas/uuid'
            status:
              type: string
              title: complete
              enum:
                - complete
            scope:
              nullable: true
              maxLength: 500
              type: string
              description: >-
                BASE64 encoded partner specific data attached to the journey,
                such as encrypted data containing session information. It will
                be passed back to callback.
            result:
              type: object
              description: Result of journey
              oneOf:
                - title: createAccount result
                  properties:
                    journeyType:
                      enum:
                        - createAccount
                    account:
                      description: account created in journey
                      type: object
                      additionalProperties: false
                      properties:
                        id:
                          allOf:
                            - $ref: '#/components/schemas/uuid'
                            - description: id of account
                        status:
                          $ref: '#/components/schemas/status'
                        accountType:
                          $ref: '#/components/schemas/accountType'
                        serviceType:
                          $ref: '#/components/schemas/serviceType'
                    bankAccounts:
                      description: >-
                        accounts registered with allocation plan or for
                        withdrawal
                      type: object
                      additionalProperties: false
                      properties:
                        id:
                          allOf:
                            - $ref: '#/components/schemas/uuid'
                            - description: id of payment account
                        status:
                          $ref: '#/components/schemas/properties-status'
                        iban:
                          type: string
                          description: IBAN (ISO 13616, International Bank Account Number)
                          example: SE7280000810340009783242
                    transfers:
                      description: >-
                        If transfers from other custodian was created, the
                        results are provded here. One item per account.
                      type: array
                      items:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - cash
                            description: Type of transfer
                          custodian:
                            allOf:
                              - $ref: '#/components/schemas/uuid'
                              - description: ID matching an institution.
                          account:
                            type: string
                            description: Account number at institution
                            example: '1223456789'
                    allocationPlan:
                      description: >
                        If an allocationPlan was created. The results are
                        provided here
                      type: object
                      properties:
                        id:
                          type: string
                          allOf:
                            - $ref: '#/components/schemas/uuid'
                            - description: id of allocation plan
                        paymentAccount:
                          type: object
                          description: >-
                            The details of the bank account to charge from
                            (autogiro)
                          properties:
                            id:
                              allOf:
                                - $ref: '#/components/schemas/uuid'
                                - description: id of bank account
                            iban:
                              type: string
                              description: >-
                                IBAN (ISO 13616, International Bank Account
                                Number)
                              example: SE7280000810340009783242
                        instruments:
                          description: >-
                            Instrument allocations. The sum of all allocations
                            must be exactly 100.
                          type: array
                          example:
                            - instrument: SE0000810798SEK
                              amount: 100
                          items:
                            type: object
                            properties:
                              instrument:
                                description: Instrument ID
                                type: string
                                example: SE0000810798SEK
                              allocation:
                                type: number
                                example: 100
                                description: Allocation in percent for this instrument
                - title: updateAllocationPlan
                  additionalProperties: false
                  properties:
                    journeyType:
                      type: string
                      title: updateAllocationPlan
                      enum:
                        - updateAllocationPlan
                    allocationPlan:
                      type: object
                      properties:
                        account:
                          allOf:
                            - $ref: '#/components/schemas/uuid'
                            - description: Fondo account
                        paymentAccount:
                          type: object
                          description: >-
                            The details of the bank account to charge from
                            (autogiro)
                          properties:
                            id:
                              allOf:
                                - $ref: '#/components/schemas/uuid'
                                - description: id of payment account
                - title: kycRenewal
                  additionalProperties: false
                  properties:
                    journeyType:
                      type: string
                      title: kycRenewal
                      enum:
                        - kycRenewal
                - title: addBankAccount
                  additionalProperties: false
                  properties:
                    journeyType:
                      type: string
                      title: addBankAccount
                      enum:
                        - addBankAccount
    journey_post:
      title: journey
      type: object
      additionalProperties: false
      description: >
        A `Journey` is a web journey for interacting with Fondo functionality,
        such as setting up an account.

        The callback at the partner will be called with status of the journey,
        such as when it is completed or aborted due to end-user decision or
        error.

        The callback information will also be sent over websocket if active.


        The scope parameter can be any value and used to keep state on partners
        end.


        The callback will be retried for any other status code than `200`.


        To ensure it is Fondo calling the callback URL, use the `scope`
        parameter to match.

        Fondo will also provide the IP address used from Fondos side.
      required:
        - journey
        - callbackUrl
        - scope
      properties:
        journey:
          type: object
          required:
            - journeyType
          oneOf:
            - title: createAccount
              required:
                - accountTypes
                - accountServiceType
              additionalProperties: false
              properties:
                journeyType:
                  type: string
                  title: createAccount
                  enum:
                    - createAccount
                accountTypes:
                  type: array
                  description: Allowed account types
                  items:
                    enum:
                      - isk
                      - depot
                      - insurance
                accountName:
                  type: string
                  maxLength: 500
                  description: >-
                    If not provided, the end-user will be asked to select
                    accountName. If provided, the accountName will not be
                    visible to the customer in this journey.
                email:
                  type: string
                  format: email
                  description: end-user email address
                  example: enduser@endUserDomain.com
                  nullable: true
                accountServiceType:
                  description: Account service type
                  type: string
                  title: accountServiceType
                  enum:
                    - portfolioManagement
                    - investmentAdvise
                    - executionOnly
                allocationPlan:
                  description: >
                    Setup an allocation plan for the account. Deposits will
                    allocate based on this plan.

                    If `null` the view will not be shown
                  nullable: true
                  type: object
                  required:
                    - instruments
                  properties:
                    paymentAccount:
                      type: object
                      description: >-
                        The details of the bank account to charge from
                        (autogiro)
                      properties:
                        iban:
                          type: string
                          description: IBAN (ISO 13616, International Bank Account Number)
                          example: SE7280000810340009783242
                    instruments:
                      description: >-
                        Instrument allocations. The sum of all allocations must
                        be exactly 100.
                      type: array
                      example:
                        - instrument: SE0000810798SEK
                          allocation: 100
                      items:
                        type: object
                        required:
                          - instrument
                          - allocation
                        properties:
                          instrument:
                            description: Instrument ID
                            type: string
                            example: SE0000810798SEK
                          allocation:
                            type: number
                            example: 100
                            description: Allocation in percent for this instrument
                kycs:
                  nullable: true
                  description: >-
                    Valid Know Your Customer answers used to prefill the options
                    in the journey.
                  type: array
                  items:
                    type: object
                    required:
                      - qid
                      - answer
                    properties:
                      qid:
                        description: Fondo ID of the question
                        example: money_origin
                        type: string
                      answer:
                        description: Answer
                        example: lön/pension
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                          - type: array
                          - type: object
                transfer:
                  description: >
                    If defined, the view with options to instruct Fondo to
                    initate transfers

                    from other custodians will be shown.

                    If `null` the view will not be shown.
                  nullable: true
                  type: object
                  properties:
                    forced:
                      type: boolean
                      description: >
                        If set to true, a transfer journey is implied and the
                        welcome screen will reflect this.

                        If the instruction set contains only one instruction and
                        it contains both `institutionId` and `account` the
                        selection view will not be displayed.
                    instructions:
                      description: Transfer instructions to be sent to other custodians
                      type: array
                      additionalProperties: false
                      items:
                        type: object
                        additionalProperties: false
                        required:
                          - custodian
                          - type
                        properties:
                          type:
                            type: string
                            enum:
                              - cash
                            description: Type of transfer
                          custodian:
                            allOf:
                              - $ref: '#/components/schemas/uuid'
                              - description: ID matching an custodian
                          account:
                            type: string
                            description: Account number or reference at custodian
                            example: '1223456789'
            - title: addBankAccount
              required:
                - account
                - autogiro
              additionalProperties: false
              description: |
                Let end-user connect bank account that will be
                validated (usable for withdrawals).
                Optionally: ask for autogiro-mandate.
                Mandates have a lead time for at least one bank day
              properties:
                account:
                  allOf:
                    - $ref: '#/components/schemas/uuid'
                    - description: Fondo account
                autogiro:
                  type: object
                  required:
                    - enforce
                  properties:
                    enforce:
                      oneOf:
                        - type: string
                          enum:
                            - required
                          title: required
                          description: End-user MUST sign autogiro mandate
                        - type: string
                          enum:
                            - optional
                          title: optional
                          description: End-user may choose to sign autogiro mandate
                        - type: string
                          enum:
                            - none
                          title: none
                          description: End-User have no option to sign autogiro mandate.
                    forceNewBankAccount:
                      type: boolean
                      description: >
                        Defaults to false.

                        If *set to false* and autogiro enforce is set to
                        required or optional,

                        the end-user may select an existing account to connect
                        to autogiro

                        instead of connecting a new account.


                        If *set to true* and autogiro enforce is set to required
                        or

                        optional, force the end-user to connect a new
                        bankAccount

                        irrespective of if old accounts exists.
                journeyType:
                  type: string
                  title: addBankAccount
                  enum:
                    - addBankAccount
            - title: kycRenewal
              required:
                - account
                - journeyType
              additionalProperties: false
              properties:
                account:
                  allOf:
                    - $ref: '#/components/schemas/uuid'
                    - description: Fondo account
                journeyType:
                  type: string
                  title: kycRenewal
                  enum:
                    - kycRenewal
            - title: updateAllocationPlan
              required:
                - account
              additionalProperties: false
              properties:
                journeyType:
                  type: string
                  title: updateAllocationPlan
                  enum:
                    - updateAllocationPlan
                account:
                  allOf:
                    - $ref: '#/components/schemas/uuid'
                    - description: Fondo account
                paymentAccount:
                  type: object
                  description: The details of the bank account to charge from (autogiro)
                  properties:
                    iban:
                      type: string
                      description: IBAN (ISO 13616, International Bank Account Number)
                      example: SE7280000810340009783242
        callbackUrl:
          type: string
          description: Url for partner callback
          example: https://api.habibisfonder.se/v1/fondo/callback
        redirectUrl:
          nullable: true
          type: string
          description: Redirect URL when leaving the Fondo Journey (BankID etc)
          example: customerApp:///
        errorCode:
          nullable: true
          readOnly: true
          type: string
          description: Frontend facing error code
        scope:
          nullable: true
          maxLength: 500
          type: string
          description: >-
            BASE64 encoded partner specific data attached to the journey, such
            as encrypted data containing session information. It will be passed
            back to callback.
servers:
  - url: https://api.fondo.se
    description: Production
  - url: https://api.sandbox.fondo.se
    description: Sandbox
