openapi: 3.0.3
info:
  title: Flinks API
  description: |
    Flinks API provides financial data connectivity, enrichment, and payment solutions.

    ## Authentication
    Endpoints require authentication using `flinks-auth-key` header (Bearer token).

    For more information, visit: https://docs.flinks.com
  version: 3.0.0
  contact:
    name: Flinks Support
    url: https://www.flinks.com/contact/sales
  termsOfService: https://www.flinks.com


tags:
  - name: Authorization
    description: Endpoints for generating authorization tokens and authenticating requests
  - name: Enrich - Consumer Attributes
    description: Consumer financial attribute analysis and credit risk assessment

servers:
  - url: https://{instanceWealth}-api.private.fin.ag
    description: Flinks Wealth API
    variables:
      instanceWealth:
        default: toolbox-wealth
        description: The environment instance (e.g., toolbox-wealth, sandbox-wealth)
paths:
  /v3/{customerId}/BankingServices/GetWealthNightlyRefreshStatus/:
    get:
      tags:
        - Wealth
      summary: Get Nightly Refresh Status on Investments
      operationId: getWealthNightlyRefreshStatus
      deprecated: true
      parameters:

        - name: customerId
          in: path
          required: true
          schema:
            type: string
            default: 1d43ba20-72da-4c6a-9621-30bdb1362f6b
          description: "Unique GUID provided by Flinks that grants you access to the environment specified in the instance field. By default, the value is the key for the toolbox environment."
        - name: Authorization
          in: header
          description: Contains the Bearer Token (the API secret key that Flinks provides you with).
          schema:
            type: string
            default: Bearer {API Secret}
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  HttpStatusCode:
                    type: integer
                    default: 0
                  IneligibleWealths:
                    type: array
                    items:
                      type: object
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  HttpStatusCode:
                    type: integer
                    default: 0
                  Message:
                    type: string
                  FlinksCode:
                    type: string

  /v3/{customerId}/Investments/Delete/{loginId}:
    delete:
      tags:
        - Wealth
      summary: Delete Investments
      description: Specific endpoint to delete both Investments and Banking Data.
      operationId: deleteInvestments
      deprecated: true

      parameters:
        - name: customerId
          in: path
          required: true
          schema:
            type: string
            default: 1d43ba20-72da-4c6a-9621-30bdb1362f6b
          description: "Unique GUID provided by Flinks that grants you access to the environment specified in the instance field. By default, the value is the key for the toolbox environment."
        - name: loginId
          in: path
          required: true
          schema:
            type: string
          description: "A unique identifier that represents the login information for the customer that you want to delete data for."
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  Message:
                    type: string
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  Title:
                    type: string
                  Message:
                    type: string
                  HttpStatusCode:
                    type: integer
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  Title:
                    type: string
                  Message:
                    type: string
                  HttpStatusCode:
                    type: integer

  /v3/{customerId}/Investments:
    post:
      tags:
        - Wealth
      summary: Get Investments
      operationId: getInvestments
      deprecated: true

      parameters:
        - name: customerId
          in: path
          required: true
          schema:
            type: string
            default: 1d43ba20-72da-4c6a-9621-30bdb1362f6b
          description: "Unique GUID provided by Flinks that grants you access to the environment specified in the instance field. By default, the value is the key for the toolbox environment."
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                LoginId:
                  type: string
                  description: Access Token that's associated with a customer account.
                RequestId:
                  type: string
                  default: "3fa391bc-bc52-4424-82c5-8662600df9b2"
                  description: Connected account's Session Token.
                MostRecentCached:
                  type: string
                  default: "true"
                  description: "Tells the API to pull the most recent data. Must = 'true'."
              example:
                MostRecentCached: "true"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  Investments:
                    type: array
                    items:
                      type: object
                  Message:
                    type: string
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  Title:
                    type: string
                  Message:
                    type: string
                  HttpStatusCode:
                    type: integer

components:
  securitySchemes:
    FlinksAuthKey:
      type: apiKey
      in: header
      name: flinks-auth-key
    OptionalApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Optional security feature (must be enabled by Flinks). Contact your Flinks representative to activate.

  schemas:
    Login:
      type: object
      description: End user's technical login information
      properties:
        Id:
          type: string
          format: uuid
        Username:
          type: string
        IsScheduledRefresh:
          type: boolean
          default: false
        LastRefresh:
          type: string
          format: date-time
        Type:
          type: string

    Link:
      type: object
      properties:
        rel:
          type: string
          description: Relationship type of the link
        href:
          type: string
          description: Endpoint path
        example:
          type: string
          nullable: true

    SecurityChallenge:
      type: object
      properties:
        Type:
          type: string
          description: Type of security challenge (e.g., QuestionAndAnswer)
          example: QuestionAndAnswer
        Prompt:
          type: string
          description: The security question to present to the user
          example: What shape do people like most?

security: []
