Flanks
Search…
API Documentation

Flanks API Overview

Currently Flanks provides the following endpoints:
AUTHENTICATION
POST v0/token
CREDENTIALS
POST v0/bank/credentials/status
PUT v0/bank/credentials/status
DELETE v0/bank/credentials
CASH ACCOUNTS
POST v0/bank/credentials/data POST v0/bank/credentials/account
INVESTMENTS
POST v0/bank/credentials/portfolio
POST v0/bank/credentials/investment
POST v0/bank/credentials/investment/transactions
POST v0/bank/credentials/investment/detail
LIABILITIES
POST v0/bank/credentials/liability
MIFID
POST v0/bank/credentials/mifid/raw
IDENTITY
POST v0/bank/credentials/auth
CARDS
POST v0/bank/credentials/card
POST v0/bank/credentials/card/transaction
LINK CODES
GET v0/platform/link
POST v0/platform/link
ENTITY
GET v0/bank/available
ALL
POST v0/bank/credentials/all
HOLDERS
POST v0/bank/credentials/holder

Testing with Postman

We have created a Postman Collection with all the requests explained in this page, in order to test all the API methods.
In order to use the methods you must complete the fields accordingly following the documentation. In every request you should, at least, fill the Authorization header field with your Oauth2 access token.
You can download the collection here:

AUTHENTICATION

In order to use Flanks API, you need to authenticate yourself. This is done by the following endpoints, following the OAuth schema. Only one access token can be enabled at any time, so at the moment of generation of a new access token the previous one will be invalidated.
post
https://api.flanks.io
/v0/token
GET OAUTH TOKEN
post
https://api.flanks.io
/v0/token
REFRESH ACCESS TOKEN

CREDENTIALS

In our system, Credentials is an entity that is linked to a company through its Oauth2 token. Each set of credentials corresponds to a banking user. That means that a set of credentials has only one bank but can have multiple accounts and multiple associated products.
post
https://api.flanks.io
/v0/bank/credentials/status
CREDENTIALS STATUS
put
https://api.flanks.io
/v0/bank/credentials/status
FORCE USER TRANSACTION OR CREDENTIALS RESET
delete
https://api.flanks.io
/v0/bank/credentials
DELETE CREDENTIALS TOKEN

AGGREGATION

Aggregation is the process by which you can extract data from online banking entity website, such as transactions, accounts, cards, portfolios, investments and liabilitites.
post
https://api.flanks.io
/v0/bank/credentials/portfolio
PORTFOLIOS
  • name: portfolio name set by the "entity".
  • type: type of portfolio depends on the investments it contains, if it contains several types it will be marked as MIX otherwise it will follow this table:
    Investments type included in portfolio
    Portfolio type returned
    F
    M - (Managed Portfolio)
    F
    UM - (Unmanaged Portfolio)
    O
    O
    VI
    S
    D
    D
    PP
    PP
    F
    F
    FI
    FI
    ETF
    ETF
    C
    C
    CFD
    CFD
    L
    L
    More than one type of investments mentioned above
    MIX
  • currency: Currency of the product. Follow the ISO 4217.
  • _id: unique ID of the product, is a unic ID based on the user credentials_token and the refValores number.
  • refValores: Number of the investments accounts from the entiy.
  • refAccount*: IBAN of cash account of the product.
  • owners: LIst of the holders of the portfolio.
  • balance: Current valuation of the portfolio on the currency.
  • entity: Name of the entity where the credentials belongs to.
  • external_id*: Same as the _id field, but it is based on the external_id associated on the user credentials_token instead of the credentials_token. In case there is no external_id for the user, the value of this field is null.
*Can be null
post
https://api.flanks.io
/v0/bank/credentials/investment
INVESTMENTS
  • _id: unique ID of the product, is a unic ID based on the user credentials_token and the ISIN number.
  • name: General name of the product.
  • isin: General identification number, if the product has other identifiers they will be included in this field.
  • symbol*: Market symbol of the product in case that the product is equity. Symbol follows the ISO XXX.
  • amount: Number of shares the user has on this product.
  • balance: Valuation of the investment using the currency of the product.
  • currency: Currency of the product. Follows the ISO 4217.
  • portfolio_id: Flanks identifier that can be linked with the _id of the /portfolios call.
  • detail: This field will return some public information of the product. We can link your product with information sources like MorningStar or Bloomberg.
  • external_id*: Same as the _id field, but it is based on the external_id associated on the user credentials_token instead of the credentials_token. In case there is no external_id for the user, the value of this field is null.
  • cost*: Investment cost at time of purchase.
  • is_nominal: Indicates if amount is nominal is in participations or in nominal.
  • cnmv*: This field will be included only if the product is a Fund (investment type F) and is registered with the cnmv.
    • isin: General identification number (the same as in the previous ISIN field)
    • gestora*: Name of the investment management company
    • cif_gestora*: CIF (tax identification code) of the investment management company
    • depositaria*: Name of the investment custodian company
    • cif_depositaria*: CIF (tax identification code) of the investment custodian company
    • num_registro_gestora*: CNMV code of the investment management company
    • num_registro_depositaria*: CNMV code of the investment custodian company
  • initial_date*: Date of first buy, suscription or switch was realized.
  • valuation_date*: Date where balance was calculated, if given by the bank.
  • performance*: Those issues dealing with the amount and value of money, wealth, debt, and investment. The performance is a number over 1.
  • performance_detail*: The performance detail are taken over 1, not percentage.
    • MTD: performance from the last month
    • QTD: performance from the last 3 months
    • Halfyear: performance from the last 6 months
    • YTD: performance in the current year
    • Yearly: performance from the last 12 months
    • InitialToDate: performance since the begining
    • InitialToDateYearly: performance since the begining annualized
  • analytics*: The ratios are taken over 1, not percentage.
    • risk: Value at risk (only funds and PP)
    • sharpe_ratio: is commonly used to gauge the performance of an investment by adjusting for its risk (only funds and PP)
    • beta_ratio: Beta is a measure of a stock's volatility in relation to the overall market
    • tracking_error_ratio: Tracking error is a measure of financial performance that determines the difference between the return fluctuations of an investment portfolio and the return fluctuations of a chosen benchmark (only funds and PP)
    • volatility: statistical measure of the dispersion of returns for a given security or market index
    • PER: ratio of a company's share stock price to the company's earnings per share (Only VI and ETF)
    • ROE: Return to equity (Only VI and ETF)
    • PES: Price to Earnings (Only VI and ETF)
    • EPS: Earning per share (Only VI and ETF)
    • ROA: Return on Asset (Only VI and ETF)
  • market*: ISO MIC code
  • operating_market*: ISO Operating MIC code
  • capital_gain*: A capital gain is an increase in the value of an asset or investment resulting from the price appreciation of the asset or investment
  • accrued_interest*: accrued interest refers to the amount of interest that has been incurred, as of a specific date, on a loan or other financial obligation but has not yet been paid out. Accrued interest can either be in the form of accrued interest revenue, for the lender, or accrued interest expense, for the borrower. Is a number over 1 not percentage.
  • price_ex_cupon*: is the present discounted value of future cash stream generated by a bond. It refers to the sum of the present values of all likely coupon payments plus the present value of the par value at maturity.
*Can be null
Investment type
Description
F
Funds
VI
Variable Income
PP
Pension Plan
FI
Fixed Income
C
Crypto currencies
ETF
Exchange-traded fund
CFD
Contract for differences
L
Liquidity
O
Others
post
https://api.flanks.io
/v0/bank/credentials/investment/transactions
INVESTMENTS TRANSACTIONS
  • description: Concept of the investment_transaction, it will appear standardized on the type field.
  • type: Standard type of the investment_transaction, you will find all the operations that we have on the table below.
  • operationDate: Date when the investment_transaction was ordered.
  • valueDate: Date when the investment_transaction was effective.
  • amount: Number of shares involved on the investment_transaction, it will be negative or positive depending on the investment type.
  • entity: entity name of the associated credentials.
  • netCash: net cost of the transaction.
  • unitPrice: price of the participations or titles at the moment of the transaction
  • investment_id: Flanks id of the investment, it can be linked with the /investment response.
  • _id: Unique identification of the operation.
  • refAccountIBAN*: IBAN of the associated current account of the portfolio that contains the investment related to the transaction.
  • isin: ISIN or DGS of the product related to the transaction.
  • refValos*: contract of the portfolio containing the investment related to the transaction.
  • symb: indicates if the transaction increases (+) or decreases (-) the number of participations or titles.
  • commission*: commission of the transaction.
  • commission_detail: commission breakdown, composed by the entity, the broker, the canon (characteristics or qualities which a good tax system should possess) and the ITF (International Trade and Finance). Values inside can be null
  • retention*: total retention of the transaction.
  • retention_detail*: retention breakdown, composed by origin and destination retention. Values inside can be null.
  • referenceCurrency: currency reference of the portfolio that contains the investment related to the transaction.
  • originalCurrency: original investment currency value.
  • exchange: multiplier to convert between investment currency and portfolio currency. 1.0 if both currencies are equal.
  • external_id*: Same as the _id field, but it is based on the external_id associated on the user credentials_token instead of the credentials_token. In case there is no external_id for the user, the value of this field is null.
  • expenses_detail: expense is the cost of operations that a company incurs to generate revenue. The expenses details are custody, iva, financial and liquidation. Values inside can be null
  • origin_gain_detail*: is a list of dictionaries. The keys of the dictionaries are the same as in origin gain. Origin gain detail is the historical data of each transfer.
*Can be null

Investment transactions type

Type
Description
1
SUSCRIPTION
2
REIMBURSEMENT
3
NEW SECURITY CONTRACT
4
FUND TRANSFER
5
REJECT SECURITY CONTRACT
6
PLEDGES
7
COUPONS
8
BUY
9
SELL
10
CHARGEBACKS
11
SUM
14
COMMISSION
17
FOREX
18
EXTERNAL FUND TRANSFER
23
EXTERNAL FUND TRANSFER PP
25
TAXES
26
REDEMPTION
28
CANCELLATION
30
FINANCIAL OPERATIONS
Cryptocurrencies transactions type
Type
Description
81
SEND
82
REQUEST
83
TRANSFER
84
BUY
85
SELL
86
RECEIVE
90
OTHERS
Type values can and will be added over time
post
https://api.flanks.io
/v0/bank/credentials/investment/detail
INVESTMENT DETAIL
post
https://api.flanks.io
/v0/bank/credentials/account
CASH ACCOUNTS
  • iban: IBAN code of the account.
  • entity: entity identifier.
  • alias: account alias if present, otherwise it will be same as the IBAN.
  • balance: balance of the account.
  • currency: ISO currency code of the account.
  • description*: description
  • isOwner*: indicates if credentials owner is owner of account.
  • numOwners: number of owner swith role Titular.
  • owners: holders list.
  • _id: unique identifier for the account, created by Flank's System.
  • external_id*: Same as the _id field, but it is based on the external_id associated on the user credentials_token instead of the credentials_token. In case there is no external_id for the user, the value of this field is null.
* Can be null
post
https://api.flanks.io
/v0/bank/credentials/data
ACCOUNTS TRANSACTIONS
  • _id: Unique ID of the cash transaction.
  • account_id: Unique ID of the cash account. Usually the IBAN.
  • balance*: Cash balance after the transaction.
  • amount: Total cash amount of the transaction.
  • entity: Bank where credentials_token belongs to.
  • cardNumber*: cardNumber in the case that are a transactions done by card.
  • category*: category of the movment set by the bank.
  • flanks_category: flanks category classification as indicated in Data Types.
  • type: flanks transactions classification as indicated in Data Types.
  • currency: currency of the transaction.
  • operationDate: Operation when the transaction was ordered.
  • valueDate: Date when the operation was received.
  • description: Concept of the transaction.
  • transfer.beneficiary*: Name of the beneficiary in case there are a cash transfer.
  • transfer.ibanBeneficiary*: IBAN of the beneficiary cash account.
  • transfer.ibanPayer*: IBAN of the payer.
  • transfer.payer*: Name of the payer.
  • external_id*: Same as the _id field, but it is based on the external_id associated on the user credentials_token instead of the credentials_token. In case there is no external_id for the user, the value of this field is null.
  • norma43*: Norma 43 code as indicated in Data Types.
*Can be null

Query Object

On query object you can set multiple filters to find transactions in bank's account. For more info on query objects and their usage, refer to query engine documentation.
post
https://api.flanks.io
/v0/bank/credentials/auth
IDENTITY
  • _id: same as credentials token identifying online banking credentials.
  • name*: first name of the owner of the online banking credentials.
  • surname1*: first surname of the owner of the online banking credentials.
  • surname2*: last name of the owner of the online banking credentials.
  • fullName*: complete name of the owner of the online banking credentials.
  • birthDate*: date of birth of the owner of the online banking credentials.
  • address*: postal address for the owner of the bank access. Any of the values inside can be null.
  • contactInfo*: email and/or phone contact information.
  • identityDocument*: document number.
  • gender*:
  • occupation*: job category of the owner of the online banking credentials.
  • sector*: laboral sector of the owner of the online banking credentials. Standarized type listed below
Standarization for sector field
Directores y gerentes empresas relacionadas con la minería y construcción
Directores y gerentes sector público
Artes
Deportes
Otros directores y gerentes
Técnicos y profesionales relacionados con la ingeniería (actividad de construcción y obra civil, arquitectos, urbanistas)
Técnicos y procesionales del derecho público, tasaciones, inmobiliarias, aduanas y emisión y control de licencias
Técnicos y asesores financieros y en inversiones
Otros técnicos y profesionales científicos e intelectuales
Empleados de casas de apuestas, juego, galerías de arte, empeños, préstamos y deudas
Empleados de oficina (que atienden o no al público)
Trabajadores de servicios
Trabajadores cualificados en el sector agrícola, ganadero, forestal y pesquero
Trabajadores cualificados de las industrias metalurgicas
Viajes y turismo
Trabajadores cualificados de la construcción, excepto operadores de máquinas
Trabajadores cualificados de las industrias manufactureras relacionadas con la joyería/sastrería
Otros trabajadores cualificados de las industrias manufactureras, excepto operadores de instalaciones y máquinas
Otros
Comercial
Standarization for occupation field
Funcionario o similar (militar, policía, notarios, registradores...)
Funcionario no TGSS
Pensionista
Trabajador por cuenta ajena
Desempleado
Estudiante
Rentista
Ama de casa o similar
Trabajador por cuenta propia
Otros
Standarization for addres.streetType field
Acera
Aeropuerto
Agregado
Alameda
Aldea
Andén
Angosta
Apartado de correos
Apartamento
Arrabal
Arroyo
Autopista
Autovía
Avenida
Bajada
Barranco
Barriada
Barrio
Bloque
Bulevar
* Can be null
post
https://api.flanks.io
/v0/bank/credentials/liability
LIABILITIES
  • name: liability name
  • type: Credit or Loan
  • balance: amount to return
  • currency: ISO currency of the liability
  • avaiableBalance*: in case of credit amount not consumed.
  • openingDate*: date of opening liability contract
  • expirationDate*: finish date for the liability contract
  • _id: unique identifier for the liablity
  • initialCapital*: initial amount
  • initialCapitalCurrency: currency of the inicial amount
  • entity: entity name
  • external_id*: Same as the _id field, but it is based on the external_id associated on the user credentials_token instead of the credentials_token. In case there is no external_id for the user, the value of this field is null.
* Can be null
post
https://api.flanks.io
/v0/bank/credencial/mifid/raw
MIFID
Can be an empty list
post
https://api.flanks.io
/v0/bank/credentials/card
CARDS
  • _id: unique ID for the card.
  • external_id*: Same as the _id field, but it is based on the external_id associated on the user credentials_token instead of the credentials_token. In case there is no external_id for the user, the value of this field is null.
  • product*: product description.
  • contractNumber*: contract number associated to the card.
  • pan: pan number of the card.
  • emissionDate*: emission date of the card.
  • expirationDate*: date of card expiration.
  • availableBalance*: in case of credit amount not consumed.
  • cardType: will be credit or debit
* Can be null
post
https://api.flanks.io
/v0/bank/credentials/card/transaction
CARDS TRANSACTIONS
  • _id: unique ID for the transaction.
  • card_id: unique ID for the card used to make the transaction
  • operationDate: Date of operation when the transaction was ordered.
  • valueDate: Date when the operation was received.
  • amount: Total cash amount of the transaction.
  • commission*: commission fee of the transaction.
  • currency: currency of the transaction.
  • shop*: shop name.
  • category*: category of the movment set by the bank.
  • external_id*: Same as the _id field, but it is based on the external_id associated on the user credentials_token instead of the credentials_token. In case there is no external_id for the user, the value of this field is null.
post
https://api.flanks.io
/v0/bank/credentials/all
ALL DATA OF A CREDENTIALS
  • accounts: response of /credentials/account including owners (with relation) and its associated transactions.
  • cards: information regarding cards including owners (with relation) and transactions for each card.
  • fidexIncome: investments of type FI with its transactions.
  • funds: investments of type F with its transactions.
  • liabilities: response of /credentials/liability including owners (with relation) and its associated transactions.
  • others: investments of type O with its transactions.
  • etfs: investments of type ETF with its transactions.
  • pensionPlans: investments of type PP with its transactions.
  • portfolios: response of /portfolio including owners (with relation).
  • stocks: response of /investment filtered by investment.type equals to VI with its transactions.
  • deposits: actually empty because this type of product is not being retrieved.
  • identity: response of credentials/auth.
post
https://api.flanks.io
/v0/bank/credentials/holder
HOLDERS
  • product_name: General name of the product.
  • name: Holder name.
  • product_id: _id corresponding to the returned in /account, /card, /portfolio or /liability
  • rel: Holder relation. Given values:
Values returned
Description meaning
Titular
Holder
Autorizado
Authorized
Representante
Representative
Aut.Online
Online authorized
Apoderado
Proxy
Depositante
Depositor
Propietario
Owner
Administrador /Rep Leg Jurid
Administrator
Firma
Signature
Derechohabiente
Applicant
Garante
Guarantor
Participe
Participant
Tutor
Guardian
Firmante Póliza
Policy signer
Cotitular
Co-Holder
Usufructuario
Usufructuary
  • external_id*: Only for technology provider case. In case there is no alias for the user, the value of this field is null.
* Can be null

LINK CODES

These endpoints allow you to interact with your links created via Flanks Platform.
Tip
You need to create an App and add a Link to it. Check the docs for more:
get
https://api.flanks.io
/v0/bank/available
ENTITIES