Lean Technologies Raw Data API
The Raw Data API from Lean Technologies — 9 operation(s) for raw data.
The Raw Data API from Lean Technologies — 9 operation(s) for raw data.
openapi: 3.1.0
info:
title: Consents Account On File Account Controls (New) Account Controls (New) Raw Data API
version: v0.2.3
servers:
- url: https://sandbox.leantech.me
description: Sandbox
- url: https://api2.leantech.me
description: Production
security:
- bearerAuth: []
tags:
- name: Raw Data
paths:
/data/v2/accounts:
get:
summary: Get Accounts
deprecated: false
description: Retrieve the accounts for an Entity ID
operationId: fetchAccounts
tags:
- Raw Data
parameters:
- name: async
in: query
description: When `true` the API will only return a `results_id` which can be fetched from the `/results` endpoint when ready.
required: false
schema:
default: false
type: boolean
- name: page
in: query
description: The page you're requesting - returns page 0 of a response if not specified.
required: false
schema:
format: int32
default: 0
type: integer
- name: size
in: query
description: The number of objects you want to return as a page size.
required: false
schema:
format: int32
default: 50
maximum: 100
type: integer
- name: entity_id
in: query
description: The `entity_id` you're querying for.
required: true
schema:
format: uuid
type: string
- name: meta
in: query
description: 'Additional data you would like to store against the request. Example: {"foo": "val"}'
required: false
schema:
type: string
- name: force_refresh
in: query
description: 'Ignore Lean''s caching and force a call to the bank. This may have unwanted performance issues. '
required: false
schema:
default: false
type: boolean
- name: verbose
in: query
description: Shows `regional_data` values in responses when true. Defaults to `false`.
required: false
schema:
default: false
type: boolean
- name: customer-ip
in: header
description: IP Address of the customer. Required to indicate that the user is currently on-session. When this value isn't supplied the request is treated as a background refresh. Banks may place limits on the number of background refreshes can be performed over 24 hours.
required: false
example: ''
schema:
type: string
responses:
'200':
description: OK
content:
'*/*':
schema:
type: object
properties:
status:
type: string
enum:
- OK
- FAILED
- PENDING
- CONSENT_EXPIRED
description: The status of the request
data:
type: object
properties:
accounts:
type: array
items:
type: object
properties:
account_id:
type: string
description: The unique identifier for the account. Provided as a UUID.
format: uuid
status:
type: string
description: The current status of the account. Indicating whether it is in active use or not.
enum:
- ENABLED
- DISABLED
- PENDING
- PROFORMA
- DELETED
- UNSUPPORTED
currency:
type: string
description: The ISO 3 letter currency code that the account stores value in.
account_type:
type: string
description: Indicates whether the account is a retail consumer account or a business account.
enum:
- PERSONAL
- BUSINESS
- UNSUPPORTED
account_sub_type:
type: string
description: Indicates the type of account.
enum:
- CALL
- CHARGE_CARD
- CREDIT
- CURRENT
- EMONEY
- LOAN
- MORTGAGE
- PREPAID
- SAVINGS
- UNSUPPORTED
nickname:
type: string
description: The name for this account as set by the owner of the account. This name is known to the user.
account:
type: array
items:
type: object
properties:
scheme_name:
type: string
description: Specifies the type of account identifier being provided
enum:
- PAN
- IBAN
- BBAN
- OTHER
- UNSUPPORTED
identification:
type: string
description: The identification value specified by the scheme_type
name:
type: string
description: Associated name of the identifier
required:
- scheme_name
- identification
description:
type: string
description: Specifies the description of the account sub-type.
regional_data:
type: object
properties:
standard:
type: string
description: A description of the standard the regional data is returned in formatted as `"{ISO 3 Letter Country Code}.{Standard}.{Version}"`. In the UAE V2 API this will always return as `"ARE.LEAN.V1"`
data:
properties:
account_id:
type: string
description: The unique identifier for the account. Provided as a UUID.
account_number:
type: string
description: The account number for the account.
name:
type: string
description: The product name of the account
currency_code:
type: string
description: The ISO 3 letter currency code the account stores value in,
type:
type: string
enum:
- CURRENT
- SAVINGS
- CREDIT
description: Indicates the type of account
iban:
type: string
description: The IBAN for the account.
required:
- account_id
- account_number
- name
- currency_code
- type
- iban
$ref: '#/components/schemas/Accounts'
required:
- standard
- data
description: Region specific data response. Only provided when verbose=true in the originating request.
required:
- account_id
description: An array of accounts associated with the Entity
page:
$ref: '#/components/schemas/Pagination'
type:
type: string
description: The endpoint the original request was made to.
required:
- accounts
- page
- type
results_id:
type: string
description: The ID for this result, this is used when retrieving results from the /results endpoint.
message:
type: string
description: Further explanation of the response
timestamp:
type: string
description: The timestamp of when the response was retrieved
status_detail:
type: object
properties:
granular_status_code:
type: string
description: Detailed error code
status_additional_info:
type: string
description: Further detail on the encountered error
required:
- granular_status_code
- status_additional_info
description: Further detail on the error if status=FAILED
required:
- status
- data
- results_id
- message
- timestamp
- status_detail
example:
status: OK
data:
accounts:
- account_id: c568aac1-df29-489b-80f8-63aaad5f6a2f
status: ENABLED
currency: AED
account_type: PERSONAL
account_sub_type: CURRENT
nickname: Current Account
account:
- scheme_name: IBAN
identification: AE070331234567890123456
- scheme_name: BBAN
identification: '4567890123456'
description: Current Account
regional_data:
standard: ARE.LEAN.V1
data:
account_id: c568aac1-df29-489b-80f8-63aaad5f6a2f
account_number: '4567890123456'
name: Current Account
currency_code: AED
type: CURRENT
iban: AE070331234567890123456
page:
number: 0
size: 1
total_elements: 1
total_pages: 1
type: accounts
results_id: f5e6ab0e-9586-4d42-81c2-f2c5cbdad3cf
message: Data successfully retrieved
timestamp: '2023-10-19T16:27:10.500036785Z'
headers: {}
security:
- bearer: []
/data/v2/accounts/{account_id}/balances:
get:
summary: Get Balances
deprecated: false
description: 'Get the balances for a specific account given an accountId. The accountId can be found by making a call to the /accounts endpoint.
Requires an active entity with the `balances` permission to use.'
operationId: fetchBalances
tags:
- Raw Data
parameters:
- name: account_id
in: path
description: 'The `account_id` to fetch balance(s) for '
required: true
example: ''
schema:
type: string
- name: async
in: query
description: When `true` the API will only return a `results_id` which can be fetched from the `/results` endpoint when ready.
required: false
schema:
default: false
type: boolean
- name: page
in: query
description: The page you're requesting - returns page 0 of a response if not specified.
required: false
schema:
format: int32
default: 0
type: integer
- name: size
in: query
description: The number of objects you want to return as a page size.
required: false
schema:
format: int32
default: 50
maximum: 100
type: integer
- name: entity_id
in: query
description: The `entity_id` you're querying for.
required: true
schema:
format: uuid
type: string
- name: meta
in: query
description: 'Additional data you would like to store against the request. Example: {"foo": "val"}'
required: false
schema:
type: string
- name: force_refresh
in: query
description: 'Ignore Lean''s caching and force a call to the bank. This may have unwanted performance issues. '
required: false
schema:
default: false
type: boolean
- name: verbose
in: query
description: Shows `regional_data` values in responses when true. Defaults to `false`.
required: false
schema:
default: false
type: boolean
- name: customer-ip
in: header
description: IP Address of the customer. Required to indicate that the user is currently on-session. When this value isn't supplied the request is treated as a background refresh. Banks may place limits on the number of background refreshes can be performed over 24 hours.
required: false
example: ''
schema:
type: string
responses:
'200':
description: OK
content:
'*/*':
schema:
type: object
properties:
data:
type: object
properties:
type:
type: string
description: The endpoint the original request was made to
page:
type: object
properties: {}
balances:
type: array
items:
type: object
properties:
account_id:
type: string
description: The `account_id` this balance is related to.
credit_debit_indicator:
type: string
description: Indicates whether the amount returned is a credit or a debit amount. A value of 0 is returned as CREDIT.
enum:
- CREDIT
- DEBIT
- UNSUPPORTED
amount:
$ref: '#/components/schemas/CurrencyAmount'
type:
type: string
description: 'The type of balance for the account.
Note: Banks support different types for presenting account balance, so this list is used to support different Bank systems in KSA.'
enum:
- CLOSING_AVAILABLE
- CLOSING_BOOKED
- CLOSING_CLEARED
- EXPECTED
- FORWARD_AVAILABLE
- INFORMATION
- INTERIM_AVAILABLE
- INTERIM_BOOKED
- INTERIM_CLEARED
- OPENING_AVAILABLE
- OPENING_BOOKED
- OPENING_CLEARED
- PREVIOUSLY_CLOSED
date_time:
type: string
description: The date and time that this balance object was generated.
credit_line:
type: array
items:
type: object
properties:
included:
type: boolean
description: 'Boolean flag to Indicate whether or not a credit line is included in the balance of the account. Usage: If not present, credit line is not included in the balance amount of the account.'
amount:
$ref: '#/components/schemas/CurrencyAmount'
type:
type: string
enum:
- AVAILABLE
- CREDIT
- EMERGENCY
- "PRE-AGREED\t"
- TEMPORARY
description: 'Type of credit line provided to the account.
Note: Banks support different types of credit lines on accounts, so this list is used to support different banking systems in KSA.'
required:
- included
- amount
- type
description: Information on any credit available to the balance of this account. Returned as an array.
regional_data:
type: object
properties:
standard:
type: string
description: A description of the standard the regional data is returned in formatted as `"{ISO 3 Letter Country Code}.{Standard}.{Version}"`. In the UAE V2 API this will always return as `"ARE.LEAN.V1"`
data:
properties:
account_id:
type: string
description: The `account_id` this balance is related to.
balance:
type: number
description: The stored balance in the account a negative value may be returned for example for `CREDIT` accounts or current accounts in overdraft.
currency_code:
type: string
maxLength: 3
minLength: 3
examples:
- AED
- SAR
- USD
description: The 3 letter ISO code for the denominated currency of the account balance.
account_name:
type: string
description: The name of the account the balance has been fetched for
account_type:
type: string
description: The type of the account
enum:
- CURRENT
- SAVINGS
- CREDIT
required:
- account_id
- balance
- currency_code
- account_name
- account_type
$ref: '#/components/schemas/Balances'
required:
- data
- standard
description: Region specific data response. Only provided when `verbose=true` in the originating request.
required:
- account_id
- credit_debit_indicator
- amount
- date_time
required:
- type
- page
- balances
status:
type: string
description: The status of the request.
enum:
- OK
- FAILED
- PENDING
- CONSENT_EXPIRED
results_id:
type: string
description: The ID for this result, this is used when retrieving results from the `/results` endpoint.
message:
type: string
description: Further explanation of the response
timestamp:
type: string
description: The timestamp of when the response was retrieved
meta:
type: string
status_detail:
type: object
properties:
granular_status_code:
type: string
description: Detailed error code
status_additional_info:
type: string
description: Further detail on the encountered error.
description: Further detail on the error if status is `FAILED`
required:
- data
- status
- results_id
- message
- timestamp
example:
status: OK
data:
balances:
- account_id: c568aac1-df29-489b-80f8-63aaad5f6a2f
credit_debit_indicator: CREDIT
amount:
amount: 132.31
currency: AED
type: INTERIM_AVAILABLE
regional_data:
standard: ARE.LEAN.V1
data:
balance: 132.31
currency_code: AED
account_id: c568aac1-df29-489b-80f8-63aaad5f6a2f
account_name: Liv Current Account
account_type: CURRENT
page:
number: 0
size: 1
total_elements: 1
total_pages: 1
type: balances
results_id: cf7700fa-01b6-4f06-b77f-e173b6ab84ae
message: Data successfully retrieved
timestamp: '2023-10-20T06:46:09.934801534Z'
headers: {}
security:
- bearer: []
/data/v2/accounts/{account_id}/transactions:
get:
summary: Get Transactions
deprecated: false
description: Get the transactions for a specific account given an accountId. The accountId can be found by making a call to the /accounts endpoint.
operationId: fetchTransactions
tags:
- Raw Data
parameters:
- name: account_id
in: path
description: ''
required: true
example: ''
schema:
type: string
- name: async
in: query
description: When `true` the API will only return a `results_id` which can be fetched from the `/results` endpoint when ready.
required: false
schema:
default: false
type: boolean
- name: page
in: query
description: The page you're requesting - returns page 0 of a response if not specified.
required: false
schema:
format: int32
default: 0
type: integer
- name: size
in: query
description: The number of objects you want to return as a page size.
required: false
schema:
format: int32
default: 50
maximum: 100
type: integer
- name: entity_id
in: query
description: The `entity_id` you're querying for.
required: true
schema:
format: uuid
type: string
- name: meta
in: query
description: 'Additional data you would like to store against the request. Example: {"foo": "val"}'
required: false
schema:
type: string
- name: verbose
in: query
description: Shows `regional_data` values in responses when true. Defaults to `false`.
required: false
schema:
default: false
type: boolean
- name: start_date
in: query
description: The start date in UTC (in the format YYYY-MM-DD) you want to query transactions for.
required: false
schema:
format: date
type: string
- name: end_date
in: query
description: The end date in UTC (in the format YYYY-MM-DD) you want to query transactions for.
required: false
schema:
format: date
type: string
- name: customer-ip
in: header
description: IP Address of the customer. Required to indicate that the user is currently on-session. When this value isn't supplied the request is treated as a background refresh. Banks may place limits on the number of background refreshes can be performed over 24 hours.
required: false
example: ''
schema:
type: string
responses:
'200':
description: OK
content:
'*/*':
schema:
type: object
properties:
status:
type: string
description: The status of the request.
enum:
- OK
- PENDING
- FAILED
- CONSENT_EXPIRED
data:
type: object
properties:
transactions:
type: array
items:
type: object
properties:
account_id:
type: string
description: Unique identifier for the account where the transaction is credited/debited from
format: uuid
transaction_id:
type: string
description: Unique identifier for a transaction
transaction_information:
type: string
credit_debit_indicator:
type: string
enum:
- CREDIT
- DEBIT
- UNSUPPORTED
amount:
$ref: '#/components/schemas/CurrencyAmount'
transaction_mutability:
type: string
description: Whether this transaction can be considered in a final state or may change in future fetches of transaction data.
enum:
- MUTABLE
- IMMUTABLE
- UNSUPPORTED
booking_date_time:
type: string
description: The UTC datetime the transaction was executed. Note that in the case the bank only provides the date with no time, we assume the transaction ocurred at 00:00 in the local timezone and then convert to UTC.
insights:
type: object
properties:
description_cleansed:
type: string
description: A cleansed statement descriptor
category:
type: string
enum:
- BANK_FEES_AND_CHARGES
- CHARITY
- EDUCATION
- ENTERTAINMENT
- GOVERNMENT
- GROCERIES
- HEALTH_AND_WELLBEING
- LOANS_AND_INVESTMENT
- RENT_AND_SERVICES
- RESTAURANTS_DINING
- RETAIL
- SALARY_AND_REVENUE
- TRANSFER
- TRANSPORT
- TRAVEL
- OTHER
category_confidence:
type: number
minimum: 0
maximum: 1
description: Confidence of category expressed as a percentage between 0 and 1
required:
- description_cleansed
- category
- category_confidence
status:
type: string
enum:
- BOOKED
- PENDING
- REJECTED
- UNSUPPORTED
description: Status of the transaction
index:
type: integer
description: Indicates the order of the transactions. For each date, the first transaction will have an index of 0.
regional_data:
type: object
properties:
standard:
type: string
description: A description of the standard the regional data is returned in formatted as "{ISO 3 Letter Country Code}.{Standard}.{Version}". In the UAE V2 API this will always return as `"ARE.LEAN.V1"`
data:
type: object
prop
# --- truncated at 32 KB (102 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/lean-technologies/refs/heads/main/openapi/lean-technologies-raw-data-api-openapi.yml